From 77816b6c5dfe11ff59c2eebd1463b393dcde2617 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 25 Jun 2018 10:43:45 +1000 Subject: [PATCH] Complete migration to Jinja2 by porting the home page template --- entries/templates/entries/entry.html | 17 --- entries/templates/entries/h-entry.html | 67 --------- entries/templates/entries/index.html | 17 --- home/jinja2/home/index.html | 102 +++++++++++++ home/templates/home/index.html | 70 --------- lemoncurry/jinja2/lemoncurry/layout.html | 35 +++++ lemoncurry/templates/lemoncurry/layout.html | 134 ------------------ .../lemoncurry/tags/breadcrumbs.html | 11 -- lemoncurry/templates/lemoncurry/tags/nav.html | 8 -- 9 files changed, 137 insertions(+), 324 deletions(-) delete mode 100644 entries/templates/entries/entry.html delete mode 100644 entries/templates/entries/h-entry.html delete mode 100644 entries/templates/entries/index.html create mode 100644 home/jinja2/home/index.html delete mode 100644 home/templates/home/index.html delete mode 100644 lemoncurry/templates/lemoncurry/layout.html delete mode 100644 lemoncurry/templates/lemoncurry/tags/breadcrumbs.html delete mode 100644 lemoncurry/templates/lemoncurry/tags/nav.html diff --git a/entries/templates/entries/entry.html b/entries/templates/entries/entry.html deleted file mode 100644 index a620f55..0000000 --- a/entries/templates/entries/entry.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends 'lemoncurry/layout.html' %} -{% load absolute_url static %} - -{% block head %} - - -{% endblock %} - -{% block styles %} - -{% endblock %} - -{% block main %} -
-{% include 'entries/h-entry.html' %} -
-{% endblock %} diff --git a/entries/templates/entries/h-entry.html b/entries/templates/entries/h-entry.html deleted file mode 100644 index a3740a9..0000000 --- a/entries/templates/entries/h-entry.html +++ /dev/null @@ -1,67 +0,0 @@ -{% load bleach friendly_url humanize jsonify markdown %}
- {% if entry.photo %}{% endif %} - - {% if entry.in_reply_to %}{% with reply=entry.reply_context %} -
- - {{ reply.author.name }} - -
- {% if reply.name %}

{{ reply.name }}

{% endif %} -
{{ reply.content | bleach }}
-
-
{% endwith %}{% endif %} - -
- {% if entry.name %}

{{ entry.name }}

{% endif %} -
{{ entry.content | markdown }}
-
- - - - {% if entry.cats.exists %} - - {% endif %} - - {% if entry.syndications.exists %} - - {% endif %} - - -
diff --git a/entries/templates/entries/index.html b/entries/templates/entries/index.html deleted file mode 100644 index d16f517..0000000 --- a/entries/templates/entries/index.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends 'lemoncurry/layout.html' %} -{% load static %} -{% block html_class %}h-feed{% endblock %} - -{% block styles %} - -{% endblock %} - -{% block main %} -
    - {% for entry in entries %} -
  1. - {% include 'entries/h-entry.html' %} -
  2. - {% endfor %} -
-{% endblock %} diff --git a/home/jinja2/home/index.html b/home/jinja2/home/index.html new file mode 100644 index 0000000..ff6d51a --- /dev/null +++ b/home/jinja2/home/index.html @@ -0,0 +1,102 @@ +{% extends 'lemoncurry/layout.html' %} + +{% block html_attr %} + class="h-feed"{{ super() }} +{%- endblock %} + +{% block styles %} + + +{% endblock %} + +{% block head %} + {% for key in user.keys.all() %} + + {% endfor %} +{% endblock %} + +{% block main %} + + + {% import 'entries/h-entry.html' as h %} +
    + {% for entry in entries %} +
  1. + {{ h.hEntry(entry, indent_width=10) }} +
  2. + {% endfor %} +
+{% endblock %} + +{% block foot %} + +{% endblock %} diff --git a/home/templates/home/index.html b/home/templates/home/index.html deleted file mode 100644 index d5b76f5..0000000 --- a/home/templates/home/index.html +++ /dev/null @@ -1,70 +0,0 @@ -{% extends 'lemoncurry/layout.html' %} -{% load jsonify markdown static %} -{% block html_class %}h-feed{% endblock %} -{% block styles %} - - -{% endblock %} - -{% block head %}{% for key in user.keys.all %}{% endfor %}{% endblock %} - -{% block main %} - -
    - {% for entry in entries %} -
  1. - {% include 'entries/h-entry.html' %} -
  2. - {% endfor %} -
-{% endblock %} -{% block foot %} - -{% endblock %} diff --git a/lemoncurry/jinja2/lemoncurry/layout.html b/lemoncurry/jinja2/lemoncurry/layout.html index 1564b14..783879f 100644 --- a/lemoncurry/jinja2/lemoncurry/layout.html +++ b/lemoncurry/jinja2/lemoncurry/layout.html @@ -81,6 +81,41 @@ diff --git a/lemoncurry/templates/lemoncurry/layout.html b/lemoncurry/templates/lemoncurry/layout.html deleted file mode 100644 index 1b31cf3..0000000 --- a/lemoncurry/templates/lemoncurry/layout.html +++ /dev/null @@ -1,134 +0,0 @@ -{% load analytical compress favicon lemoncurry_tags meta static theme_colour %} - - {% site_name as site_name %}{% request_uri request as uri %}{% request_origin request as origin %} - - - - - - {% if title %}{{ title }} ~ {% endif %}{{ site_name }} - - {% analytical_head_top %} - {% if atom %}{% endif %} - {% if rss %} {% endif %} - {% block head %}{% endblock %} - - - - - - - - - - - - - {% get_package_json as package %} - - - - - {% include 'meta/meta.html' %} - {% get_favicons 'favicon/' %} - - - - - - {% compress css %} - - {% block styles %}{% endblock %} - {% endcompress %} - - {% analytical_head_bottom %} - - - {% analytical_body_top %} -
- - {% if request.resolver_match.view_name %} - {% nav_crumbs request.resolver_match %} - {% endif %} -
- -
- {% block main %}{% endblock %} -
- - - - - - - - - - {% compress js %} - - {% block foot %}{% endblock %} - {% endcompress %} - {% analytical_body_bottom %} - - diff --git a/lemoncurry/templates/lemoncurry/tags/breadcrumbs.html b/lemoncurry/templates/lemoncurry/tags/breadcrumbs.html deleted file mode 100644 index 0b1ddb0..0000000 --- a/lemoncurry/templates/lemoncurry/tags/breadcrumbs.html +++ /dev/null @@ -1,11 +0,0 @@ -{% load jsonify %}{% if crumbs %} - -{% endif %} diff --git a/lemoncurry/templates/lemoncurry/tags/nav.html b/lemoncurry/templates/lemoncurry/tags/nav.html deleted file mode 100644 index 8359cdc..0000000 --- a/lemoncurry/templates/lemoncurry/tags/nav.html +++ /dev/null @@ -1,8 +0,0 @@ -{% load activeurl %}{% activeurl %}{% endactiveurl %}