From 0a526711e0957bffce8039d8fffbe16a5efcc070 Mon Sep 17 00:00:00 2001 From: Mudiwa Matanda Date: Mon, 27 Jan 2025 08:44:44 +0200 Subject: [PATCH 1/3] changed contentrepo UI naming from assessments to CMS forms --- home/views.py | 8 +++++++- home/wagtail_hooks.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/home/views.py b/home/views.py index ae6bc327..d59f5f09 100644 --- a/home/views.py +++ b/home/views.py @@ -59,7 +59,13 @@ class CustomIndexView(SpreadsheetExportMixin, IndexView): class CustomIndexViewAssessment(SpreadsheetExportMixinAssessment, IndexViewAssessment): - pass + def get_template_names(self): + return ["wagtailsnippets/snippets/home/assessment/index.html"] + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['model_opts'].verbose_name_plural = "CMS Form" + return context class CustomIndexViewWhatsAppTemplate( diff --git a/home/wagtail_hooks.py b/home/wagtail_hooks.py index 73384a0d..bc44f6b6 100644 --- a/home/wagtail_hooks.py +++ b/home/wagtail_hooks.py @@ -300,6 +300,7 @@ class WhatsAppTemplateAdmin(SnippetViewSet): class AssessmentAdmin(SnippetViewSet): + menu_label = 'CMS Forms' model = Assessment add_to_admin_menu = True list_display = ("title", "slug", "version", "locale") From f9cdfee1cf52ac0f23d4ad9d35394c43158e182e Mon Sep 17 00:00:00 2001 From: Mudiwa Matanda Date: Mon, 27 Jan 2025 09:22:37 +0200 Subject: [PATCH 2/3] fixed linting --- home/views.py | 4 ++-- home/wagtail_hooks.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/home/views.py b/home/views.py index d59f5f09..8ea63caf 100644 --- a/home/views.py +++ b/home/views.py @@ -60,11 +60,11 @@ class CustomIndexView(SpreadsheetExportMixin, IndexView): class CustomIndexViewAssessment(SpreadsheetExportMixinAssessment, IndexViewAssessment): def get_template_names(self): - return ["wagtailsnippets/snippets/home/assessment/index.html"] + return ["wagtailsnippets/snippets/home/assessment/index.html"] def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context['model_opts'].verbose_name_plural = "CMS Form" + context["model_opts"].verbose_name_plural = "CMS Form" return context diff --git a/home/wagtail_hooks.py b/home/wagtail_hooks.py index bc44f6b6..ecd922d9 100644 --- a/home/wagtail_hooks.py +++ b/home/wagtail_hooks.py @@ -300,7 +300,7 @@ class WhatsAppTemplateAdmin(SnippetViewSet): class AssessmentAdmin(SnippetViewSet): - menu_label = 'CMS Forms' + menu_label = "CMS Forms" model = Assessment add_to_admin_menu = True list_display = ("title", "slug", "version", "locale") From 9b31783d41f540dcfe2d7db2236084bc0682dd41 Mon Sep 17 00:00:00 2001 From: Mudiwa Matanda Date: Mon, 27 Jan 2025 09:27:47 +0200 Subject: [PATCH 3/3] fixed spelling --- home/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/views.py b/home/views.py index 8ea63caf..1cbe4b3d 100644 --- a/home/views.py +++ b/home/views.py @@ -64,7 +64,7 @@ def get_template_names(self): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context["model_opts"].verbose_name_plural = "CMS Form" + context["model_opts"].verbose_name_plural = "CMS Forms" return context