diff --git a/district/forms.py b/district/forms.py index cf75cf005e99eec93e99accf483123ea4389a59b..32038916a5be5ba3961705e0b6e60b0e4c12fb03 100644 --- a/district/forms.py +++ b/district/forms.py @@ -62,9 +62,10 @@ class DistrictArticlesPageForm(SharedArticlesPageForm, JekyllImportForm): self.fields["shared_tags"].queryset = SharedTag.objects.order_by("name") if self.instance.pk: - # Get tags assigned to child DistrictArticlePage instances - valid_tag_ids = DistrictArticleTag.objects.filter( + valid_tag_ids = list(DistrictArticleTag.objects.filter( content_object__in=self.instance.get_children().specific() - ).values_list('tag_id', flat=True).distinct() + ).values_list('tag_id', flat=True).distinct().all()) + + valid_tag_ids += list(self.instance.shared_tags.all()) self.fields['displayed_tags'].queryset = DistrictArticleTag.objects.filter(id__in=valid_tag_ids).order_by("tag__name") \ No newline at end of file diff --git a/elections/templates/elections/elections_articles_page.html b/elections/templates/elections/elections_articles_page.html index 6fd46685caf50494f5aca019d01d9fa5d32de2b6..6a0f9e8ccb388242edd66318c3e6f2066bc2a9c3 100644 --- a/elections/templates/elections/elections_articles_page.html +++ b/elections/templates/elections/elections_articles_page.html @@ -2,7 +2,7 @@ {% block content %} {% include 'styleguide2/includes/organisms/layout/elections/navbar.html' with selected_item=page.get_menu_title %} - {% include 'styleguide2/includes/organisms/header/elections/articles_header.html' with title=page.title tags=tags %} + {% include 'styleguide2/includes/organisms/header/elections/articles_header.html' with show_tags=page.show_tags title=page.title tags=tags %} <main role="main"> {% include 'styleguide2/includes/organisms/articles/main_articles_timeline.html' %} diff --git a/uniweb/forms.py b/uniweb/forms.py index 59ca31ca408dbab631cc400f2073613532268299..94b293c481875884e818c993fd45aa56840e0869 100644 --- a/uniweb/forms.py +++ b/uniweb/forms.py @@ -32,6 +32,6 @@ class UniwebArticlesPageForm(SharedArticlesPageForm, WagtailAdminPageForm): if self.instance.pk: valid_tag_ids = UniwebArticleTag.objects.filter( content_object__in=self.instance.get_children().specific() - ).values_list('tag_id', flat=True).distinct() - - self.fields['displayed_tags'].queryset = UniwebArticleTag.objects.filter(id__in=valid_tag_ids).order_by("tag__name") \ No newline at end of file + ).values_list('id', flat=True).distinct() + + self.fields['displayed_tags'].queryset = UniwebArticleTag.objects.filter(id__in=valid_tag_ids).order_by("tag__name").distinct("tag__name") \ No newline at end of file diff --git a/uniweb/templates/uniweb/uniweb_articles_index_page.html b/uniweb/templates/uniweb/uniweb_articles_index_page.html index 6e6c2c1196eb71321f9774bc156e9f89f8de3f08..1e1a317ef3225de0efbe16f9eb2b8290a1f81733 100644 --- a/uniweb/templates/uniweb/uniweb_articles_index_page.html +++ b/uniweb/templates/uniweb/uniweb_articles_index_page.html @@ -4,7 +4,7 @@ {% block content %} {% include 'styleguide2/includes/organisms/layout/district/navbar.html' with selected_item=page.get_menu_title %} -{% include 'styleguide2/includes/organisms/header/articles_header.html' with title=page.title tags=tags %} +{% include 'styleguide2/includes/organisms/header/articles_header.html' with title=page.title tags=tags show_tags=page.show_tags %} <main role="main"> {% include 'styleguide2/includes/organisms/articles/main_articles_timeline.html' %}