From 48644f6a70ac24f674469e3c8ab130cbd730ffc0 Mon Sep 17 00:00:00 2001 From: Virginia Dooley Date: Wed, 18 Oct 2023 16:07:55 +0100 Subject: [PATCH] Update blog tags with instructions --- README.md | 3 +++ democracy_club/apps/hermes/admin.py | 24 ++++++++++--------- .../templates/projects/candidates.html | 2 +- .../projects/polling-stations/home.html | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c47af00e..0a409c3c 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,9 @@ New posts are created at `/admin/hermes/post`. Blog posts now include tags which correspond to projects, such as `representatives`. + +We've hard-coded tags to reduce the risk of typos and to ensure that tags are used consistently. To add or edit a tag, change the `tag_values` variable in `democracy_club/apps/hermes/admin.py`. + ## Staging environment Add your branch to the staging env on .circleci/config to deploy to https://stage.democracyclub.org.uk and test/view edits diff --git a/democracy_club/apps/hermes/admin.py b/democracy_club/apps/hermes/admin.py index f3941608..a9870eb7 100644 --- a/democracy_club/apps/hermes/admin.py +++ b/democracy_club/apps/hermes/admin.py @@ -10,17 +10,19 @@ class Meta: fields = "__all__" tag_values = [ - ("who_can_i_vote_for", "WCIVF"), - ("case_study", "case_study"), - ("research", "research"), - ("elections", "elections"), - ("councils", "councils"), - ("candidates", "candidates"), - ("representatives", "representatives"), - ("data", "data"), - ("where_do_i_vote", "WDIV"), - ("election_leaflets", "electionleaflets"), - ("blog", "blog"), + ("WCIVF", "Who Can I Vote For?"), + ("case_study", "Case Study"), + ("research", "Research"), + ("elections", "Elections"), + ("councils", "Councils"), + ("candidates", "Candidates"), + ("representatives", "Representatives"), + ("data", "Data"), + ("WDIV", "Where Do I Vote?"), + ("election_leaflets", "Election Leaflets"), + ("blog", "Blog"), + ("impact", "Impact"), + ("featured", "Featured"), ] tags = forms.MultipleChoiceField( diff --git a/democracy_club/apps/projects/templates/projects/candidates.html b/democracy_club/apps/projects/templates/projects/candidates.html index d16db968..b2bb7620 100644 --- a/democracy_club/apps/projects/templates/projects/candidates.html +++ b/democracy_club/apps/projects/templates/projects/candidates.html @@ -49,7 +49,7 @@

Candidates Wiki

{% endfilter %} {% load post_tags %} -{% posts_for_tag "WCIVF" %} +{% posts_for_tag "wcivf" %} {% endblock %} diff --git a/democracy_club/apps/projects/templates/projects/polling-stations/home.html b/democracy_club/apps/projects/templates/projects/polling-stations/home.html index a01df0ed..b105511e 100644 --- a/democracy_club/apps/projects/templates/projects/polling-stations/home.html +++ b/democracy_club/apps/projects/templates/projects/polling-stations/home.html @@ -34,6 +34,6 @@ {% endfilter %} {% load post_tags %} -{% posts_for_tag "WDIV" %} +{% posts_for_tag "wdiv" %} {% endblock main_content %}