From 6eaa2bbbf87b2257cb8d5651eb38e89b40eab5a1 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Fri, 4 Mar 2011 13:23:45 -0500 Subject: rewrote blog.entry based on django-debug-toolbar profiling to cut down on database queries. probably pointless given the size of the image I load, but what the heck. --- templates/archives/homepage.html | 2 +- templates/archives/writing.html | 2 +- templates/details/about.html | 12 ++++++------ templates/details/entry.html | 23 +++++++++++++---------- 4 files changed, 21 insertions(+), 18 deletions(-) (limited to 'templates') diff --git a/templates/archives/homepage.html b/templates/archives/homepage.html index 423474b..37e8048 100644 --- a/templates/archives/homepage.html +++ b/templates/archives/homepage.html @@ -15,7 +15,7 @@ {{ featured.title }}

- {% if featured.location.state.country.name == "United States" %}{{featured.location.name|smartypants|safe}}, {{featured.location.state.name}}{%else%}{{featured.location.name|smartypants|safe}}, {{featured.location.state.country.name}}{%endif%} + {% if featured.country_name == "United States" %}{{featured.location_name|smartypants|safe}}, {{featured.state_name}}{%else%}{{featured.location_name|smartypants|safe}}, {{featured.country_name}}{%endif%}   diff --git a/templates/archives/writing.html b/templates/archives/writing.html index 51dd13f..952bf9f 100644 --- a/templates/archives/writing.html +++ b/templates/archives/writing.html @@ -25,7 +25,7 @@ {{ object.title }}

- {% if object.location.state.country.name == "United States" %}{{object.location.name|smartypants|safe}}, {{object.location.state.name}}{%else%}{{object.location.name|smartypants|safe}}, {{object.location.state.country.name}}{%endif%} + {% if object.country_name == "United States" %}{{object.location_name|smartypants|safe}}, {{object.state_name}}{%else%}{{object.location_name|smartypants|safe}}, {{object.country_name}}{%endif%}   diff --git a/templates/details/about.html b/templates/details/about.html index b2ac90d..e2090d8 100644 --- a/templates/details/about.html +++ b/templates/details/about.html @@ -20,22 +20,22 @@

Background

me -
- {{top.content|smartypants|safe}} +
{%for object in object_list %}{%if forloop.first %} + {{object.content|smartypants|safe}}{%endif%} {% endfor %}

About the Site

me -
- {{middle.content|smartypants|safe}} +
{%for object in object_list %}{%if forloop.last %} + {{object.content|smartypants|safe}}{%endif%} {% endfor %}

Colophon

me -
- {{bottom.content|smartypants|safe}} +
{%for object in object_list %}{%if forloop.counter = 1 %} + {{object.content|smartypants|safe}}{%endif%} {% endfor %}
diff --git a/templates/details/entry.html b/templates/details/entry.html index 270c980..1ab9ff3 100644 --- a/templates/details/entry.html +++ b/templates/details/entry.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% load typogrify %} -{% block pagetitle %}{{object.title|title|smartypants|safe}} | Luxagraf, a travelogue | {% if object.location.state.country.name == "United States" %}{{object.location.name|smartypants|safe}}, {{object.location.state.name}}{%else%}{{object.location.name|smartypants|safe}}, {{object.location.state.country.name}}{%endif%}){% endblock %} +{% block pagetitle %}{{object.title|title|smartypants|safe}} | Luxagraf, a travelogue | {% if object.country_name == "United States" %}{{object.location_name|smartypants|safe}}, {{object.state_name}}{%else%}{{object.location_name|smartypants|safe}}, {{object.country_name}}{%endif%}){% endblock %} {%block stylesheet%}{%if object.template_name == 2 or object.template_name == 3 %} - - + + {%endblock%} {%block bodyid%}class="{%if object.template_name == 0 %}single"{%endif%}{%if object.template_name == 2%}single"{%endif%}{%if object.template_name == 1 %}double"{%endif%}{%if object.template_name == 3 %}double"{%endif%}{%endblock%} @@ -26,7 +26,7 @@

{{object.title|smartypants|widont|safe}}