Skip to content

Commit

Permalink
Update blog tags with instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley committed Oct 18, 2023
1 parent 7017eea commit 48644f6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 13 additions & 11 deletions democracy_club/apps/hermes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1>Candidates Wiki</h1>
{% endfilter %}

{% load post_tags %}
{% posts_for_tag "WCIVF" %}
{% posts_for_tag "wcivf" %}
</div>

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
{% endfilter %}

{% load post_tags %}
{% posts_for_tag "WDIV" %}
{% posts_for_tag "wdiv" %}

{% endblock main_content %}

0 comments on commit 48644f6

Please sign in to comment.