Skip to content

Commit

Permalink
simplified rendering secondary content and added feedback component o…
Browse files Browse the repository at this point in the history
…n more pages
  • Loading branch information
smanga24 committed Dec 18, 2024
1 parent cc92dfb commit 25a38cb
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 30 deletions.
8 changes: 0 additions & 8 deletions src/content/templates/content/content_page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "dwds_content.html" %}
{% load wagtailcore_tags bookmarks %}
{% load template_renderer %}

{% block primary_content %}
{% if attribution %}
Expand All @@ -21,10 +20,3 @@
{% endif %}
{{ block.super }}
{% endblock post_primary_content %}

{% block secondary_content %}
{% render_dynamic_templates page_type="secondary_page" as secondary_page_templates %}
{% for template in secondary_page_templates %}
{% include template.template_name with title=template.title description=template.description %}
{% endfor %}
{% endblock secondary_content %}
5 changes: 5 additions & 0 deletions src/content/templates/content/navigation_page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "dwds_content.html" %}
{% load wagtailcore_tags %}
{% load template_renderer %}

{% block primary_content_classes %}
content-stack large
Expand Down Expand Up @@ -30,6 +31,10 @@ <h1>{{ page.title }}</h1>
<div class="dwds-content-item-card no-shadow">{% include_block block %}</div>
{% endfor %}
</div>
{% render_dynamic_templates page_type="secondary_page" as secondary_page_templates %}
{% for template in secondary_page_templates %}
{% include template.template_name with title=template.title description=template.description %}
{% endfor %}
{% endblock secondary_content %}

{% block scripts %}
Expand Down
5 changes: 5 additions & 0 deletions src/core/templates/dwds_content.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% load bookmarks %}
{% load static %}
{% load template_renderer %}

{% block body_classes %}dwds-body{% endblock %}

Expand Down Expand Up @@ -41,6 +42,10 @@ <h1>{% firstof page_title page.title %}</h1>
{% block pre_secondary_content %}
{% endblock pre_secondary_content %}
{% block secondary_content %}
{% render_dynamic_templates page_type="secondary_page" as secondary_page_templates %}
{% for template in secondary_page_templates %}
{% include template.template_name with title=template.title description=template.description %}
{% endfor %}
{% endblock secondary_content %}
{% block post_secondary_content %}
{% endblock post_secondary_content %}
Expand Down
3 changes: 0 additions & 3 deletions src/events/templates/events/event_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,3 @@
</div>
</div>
{% endblock primary_content %}

{% block secondary_content %}
{% endblock secondary_content %}
3 changes: 0 additions & 3 deletions src/events/templates/events/events_home.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@ <h2>Past events</h2>
{% include "events/includes/listing_footer.html" with middle_text=current_month|date:"F" %}
</div>
{% endblock primary_content %}

{% block secondary_content %}
{% endblock secondary_content %}
5 changes: 5 additions & 0 deletions src/news/templates/news/news_page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "dwds_content.html" %}
{% load wagtailcore_tags wagtailimages_tags %}
{% load template_renderer %}

{% block primary_content %}
<div class="content-stack">
Expand Down Expand Up @@ -109,4 +110,8 @@ <h2 class="govuk-heading-m">Leave a comment</h2>

{% block secondary_content %}
{% include "news/includes/news_categories.html" %}
{% render_dynamic_templates page_type="secondary_page" as secondary_page_templates %}
{% for template in secondary_page_templates %}
{% include template.template_name with title=template.title description=template.description %}
{% endfor %}
{% endblock secondary_content %}
8 changes: 0 additions & 8 deletions src/peoplefinder/templates/peoplefinder/team.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% extends "dwds_content.html" %}

{% load markdown %}
{% load template_renderer %}

{% block title %}
{{ page_title }}
Expand Down Expand Up @@ -108,10 +107,3 @@ <h2>People in {{ team.short_name }}</h2>
{% endif %}
</div>
{% endblock primary_content %}

{% block secondary_content %}
{% render_dynamic_templates page_type="secondary_page" as secondary_page_templates %}
{% for template in secondary_page_templates %}
{% include template.template_name with title=template.title description=template.description %}
{% endfor %}
{% endblock secondary_content %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "content/content_page.html" %}
{% load wagtailcore_tags %}
{% load template_renderer %}

{% block secondary_content %}
{% if page_topics %}
Expand All @@ -20,4 +21,8 @@ <h2>Related topics</h2>
</div>
</div>
{% endif %}
{% render_dynamic_templates page_type="secondary_page" as secondary_page_templates %}
{% for template in secondary_page_templates %}
{% include template.template_name with title=template.title description=template.description %}
{% endfor %}
{% endblock secondary_content %}
5 changes: 5 additions & 0 deletions src/working_at_dit/templates/working_at_dit/topic.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "content/content_page.html" %}
{% load wagtailcore_tags %}
{% load template_renderer %}

{% block primary_content %}
{{ block.super }}
Expand Down Expand Up @@ -50,4 +51,8 @@ <h2 class="govuk-heading-m">Related news</h2>
{% endfor %}
</ul>
{% endif %}
{% render_dynamic_templates page_type="secondary_page" as secondary_page_templates %}
{% for template in secondary_page_templates %}
{% include template.template_name with title=template.title description=template.description %}
{% endfor %}
{% endblock secondary_content %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "dwds_content.html" %}
{% load wagtailcore_tags %}
{% load template_renderer %}

{% block bookmark %}
{% endblock bookmark %}
Expand Down Expand Up @@ -37,10 +36,3 @@ <h2 class="govuk-accordion__section-heading">
{% endfor %}
</div>
{% endblock %}

{% block secondary_content %}
{% render_dynamic_templates page_type="secondary_page" as secondary_page_templates %}
{% for template in secondary_page_templates %}
{% include template.template_name with title=template.title description=template.description %}
{% endfor %}
{% endblock secondary_content %}

0 comments on commit 25a38cb

Please sign in to comment.