diff --git a/publichealth/home/templates/puput/base.html b/publichealth/home/templates/puput/base.html new file mode 100644 index 0000000..8de714b --- /dev/null +++ b/publichealth/home/templates/puput/base.html @@ -0,0 +1,115 @@ +{% extends "base.html" %} +{% load static i18n wagtailcore_tags wagtailimages_tags wagtailroutablepage_tags wagtailuserbar puput_tags %} + +{% block body_class %}blog{% endblock %} + +{% block extra_css %} + + + {% block social_share %}{% endblock social_share %} + + + + +{% endblock %} + +{% block content %} +
+ {% if blog_page.header_image %} + + {% image blog_page.header_image fill-1500x120 as header_image %} + {{ blog_page.header_image.title }} + + {% endif %} +
+
+

+ {{ blog_page.title }} +

+ {% if not blog_page.header_image %} +

{{ blog_page.description }}

+ {% endif %} +
+
+
+ +
+
+
+
+ {% block blog_content %}{% endblock blog_content %} + {% block extra_content %}{% endblock extra_content %} +
+ +
+
+ +
+
+ + + + +
+
+ + {% if blog_page.display_last_entries %} + + {% endif %} + {% if blog_page.display_popular_entries %} + + {% endif %} + {% if blog_page.display_categories %} + + {% endif %} + {% if blog_page.display_tags %} + + {% endif %} + {% if blog_page.display_archive %} + + {% endif %} +
+
+
+
+
+{% endblock %} diff --git a/publichealth/home/templates/puput/blog_page.html b/publichealth/home/templates/puput/blog_page.html index 7a2ccbc..3cbe09b 100644 --- a/publichealth/home/templates/puput/blog_page.html +++ b/publichealth/home/templates/puput/blog_page.html @@ -1,30 +1,48 @@ -{% extends "base.html" %} -{% load static i18n wagtailcore_tags wagtailimages_tags puput_tags %} +{% extends "puput/base.html" %} -{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %} +{% load static i18n wagtailcore_tags wagtailimages_tags puput_tags social_share %} + +{% block title %} + {% if search_term %} + {{ search_term }} | {{ blog_page.title }} + {% else %} + {{ block.super }} + {% endif %} +{% endblock title %} + +{% block meta_title %} + {% if search_term %} + {% trans 'Entries for' %} {{ search_type }} {{ search_term }} + {% else %} + {{ block.super }} + {% endif %} +{% endblock meta_title %} + +{% block meta_description %} + {% if search_term %} + {% trans 'Entries for' %} {{ search_type }} {{ search_term }} + {% else %} + {{ block.super }} + {% endif %} +{% endblock meta_description %} -{% block title %}{% if search_term %}{{ search_term }} | {{ blog_page.title }}{% else %}{{ block.super }}{% endif %}{% endblock title %} -{% block meta_title %}{% if search_term %}{% trans 'Entries for' %} {{ search_type }} {{ search_term }}{% else %}{{ block.super }}{% endif %}{% endblock meta_title %} -{% block meta_description %}{% if search_term %}{% trans 'Entries for' %} {{ search_type }} {{ search_term }}{% else %}{{ block.super }}{% endif %}{% endblock meta_description %} {% block social_share %} {% image blog_page.header_image fill-800x450 as share_image %} {% if blog_page.header_image %} - - - - + + + + {% endif %} - {% endblock social_share %} -{% block content %} -
+{% block blog_content %} {% with per_page=blog_page.num_entries_page %} {# 'paginate' tag cannot render dotted variables, so we need to create a context var #} {% paginate per_page entries %} @@ -32,33 +50,51 @@
{% trans 'Entries for' %} {{ search_type }} "{{ search_term }}"
{% endif %} {% for entry in entries %} -
+ {% entry_url entry blog_page as post_url %} +
{% include 'puput/entry_page_header.html' %} - {% if entry.header_image %} - - {% image entry.header_image fill-800x240 as header_image %} - {{ entry.header_image.title }} - - {% endif %} -
+
+ {% if entry.header_image %} + + {% image entry.header_image fill-800x240 as header_image %} + {{ entry.header_image.title }} + + {% endif %} + {% include 'puput/entry_links.html' %} +
+
{% if entry.excerpt %} {{ entry.excerpt|richtext }} {% else %} {{ entry.body|richtext|truncatewords_html:70 }} {% endif %} - {% trans 'Continue reading' %} » -
+
+ + +
+
{% empty %} {% trans 'No results found.' %} {% endfor %} + {% endwith %} - - - - RSS Feed - -{% endblock content %} +{% endblock blog_content %} diff --git a/publichealth/home/templates/puput/entry_page.html b/publichealth/home/templates/puput/entry_page.html index 398b415..0597970 100644 --- a/publichealth/home/templates/puput/entry_page.html +++ b/publichealth/home/templates/puput/entry_page.html @@ -1,50 +1,88 @@ -{% extends "base.html" %} -{% load wagtailcore_tags wagtailimages_tags puput_tags %} +{% extends "puput/base.html" %} +{% load i18n wagtailcore_tags wagtailimages_tags puput_tags social_share %} -{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %} +{% block title %} + {{ self.title }} | {{ blog_page.title }} +{% endblock title %} + +{% block meta_title %} + {% if self.seo_title %} + {{ self.seo_title }} + {% else %} + {{ self.title }} + {% endif %} +{% endblock meta_title %} + +{% block meta_description %} + {% if self.search_description %} + {{ self.search_description }} + {% else %} + {{ self.body|striptags|truncatewords:20 }} + {% endif %} +{% endblock meta_description %} + +{% block canonical %} + {% canonical_url entry=self %} +{% endblock canonical %} -{% block title %}{{ self.title }} | {{ blog_page.title }}{% endblock title %} -{% block meta_title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}{% endblock meta_title %} -{% block meta_description %}{% if self.search_description %}{{ self.search_description }}{% else %}{{ self.body|striptags|truncatewords:20 }}{% endif %}{% endblock meta_description %} -{% block canonical %}{% canonical_url entry=self %}{% endblock canonical %} {% block social_share %} {% image self.header_image fill-800x450 as share_image %} {% if self.header_image %} - - - - + + + + {% endif %} {% endblock social_share %} -{% block content %} -
-
+{% block blog_content %} +
+ {% include 'puput/entry_page_header.html' with entry=self %} + {% if self.header_image %} +
+ + {% image self.header_image fill-800x450 as header_image %} + {{ self.header_image.title }} + + {% include 'puput/entry_links.html' with entry=self %} +
+ {% endif %} +
+ {{ self.body|richtext}} +
+ + {% entry_url self blog_page as post_url %} + +
- {% if self.header_image %} -
- {% image self.header_image fill-940x300 as header_image %} - {{ self.header_image.title }} -
- {% endif %} - - {% include 'puput/entry_page_header.html' with entry=self %} - -
- {{ self.body|richtext}} -
- - {% show_comments %} -
-
-{% endblock content %} + + {% show_comments %} + +{% endblock blog_content %} {% block extra_content %} {% if self.has_related %} diff --git a/publichealth/home/templates/puput/entry_page_header.html b/publichealth/home/templates/puput/entry_page_header.html index 67f691f..39577fe 100644 --- a/publichealth/home/templates/puput/entry_page_header.html +++ b/publichealth/home/templates/puput/entry_page_header.html @@ -1,36 +1,6 @@ -{% load wagtailcore_tags wagtailroutablepage_tags puput_tags %} +{% load puput_tags %}

- {{ entry.title }} + {{ entry.title }}

- -
+ \ No newline at end of file