diff options
author | luxagraf <sng@luxagraf.net> | 2011-03-04 13:23:45 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2011-03-04 13:23:45 -0500 |
commit | 6eaa2bbbf87b2257cb8d5651eb38e89b40eab5a1 (patch) | |
tree | 87b0cf811ab8c59fc318dd0ded8b106359433583 /templates | |
parent | e5aced9eac7f201826f60c37e58c3ea909cffaa3 (diff) |
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.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/archives/homepage.html | 2 | ||||
-rw-r--r-- | templates/archives/writing.html | 2 | ||||
-rw-r--r-- | templates/details/about.html | 12 | ||||
-rw-r--r-- | templates/details/entry.html | 23 |
4 files changed, 21 insertions, 18 deletions
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 @@ <a href="{{featured.get_absolute_url}}" title="{{featured.title}}"><img src="{{featured.get_image_url}}" alt="{{ featured.title }}" class="post-image" width="{{featured.image_width}}" height="{{featured.image_height}}" /></a> </div> <p class="dateline"> - <span class="location" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">{% if featured.location.state.country.name == "United States" %}{{featured.location.name|smartypants|safe}}, <a href="/writing/united-states/1/" title="travel writing from the United States">{{featured.location.state.name}}</a>{%else%}{{featured.location.name|smartypants|safe}}, <a href="/writing/{{featured.location.state.country.slug}}/1/" title="travel writing from {{featured.location.state.country.name}}">{{featured.location.state.country.name}}</a>{%endif%} + <span class="location" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">{% if featured.country_name == "United States" %}{{featured.location_name|smartypants|safe}}, <a href="/writing/united-states/1/" title="travel writing from the United States">{{featured.state_name}}</a>{%else%}{{featured.location_name|smartypants|safe}}, <a href="/writing/{{featured.country_name|slugify}}/1/" title="travel writing from {{featured.country_name}}">{{featured.country_name}}</a>{%endif%} <meta itemprop="latitude" content="{{featured.latitude}}" /> <meta itemprop="longitude" content="{{featured.longitude}}" /></span> <time datetime="{{featured.pub_date|date:'c'}}">{{featured.pub_date|date:"m/d/y"}}</time> 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 @@ <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.get_image_url}}" alt="{{ object.title }}" width="{{object.image_width}}" height="{{object.image_height}}" class="post-image" /></a> </div> <p class="dateline"> - <span class="location" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">{% if object.location.state.country.name == "United States" %}{{object.location.name|smartypants|safe}}, <a href="/writing/united-states/1/" title="travel writing from the United States">{{object.location.state.name}}</a>{%else%}{{object.location.name|smartypants|safe}}, <a href="/writing/{{object.location.state.country.slug}}/1/" title="travel writing from {{object.location.state.country.name}}">{{object.location.state.country.name}}</a>{%endif%} + <span class="location" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">{% if object.country_name == "United States" %}{{object.location_name|smartypants|safe}}, <a href="/writing/united-states/1/" title="travel writing from the United States">{{object.state_name}}</a>{%else%}{{object.location_name|smartypants|safe}}, <a href="/writing/{{object.country_name|slugify}}/1/" title="travel writing from {{object.country_name}}">{{object.country_name}}</a>{%endif%} <meta itemprop="latitude" content="{{object.latitude}}" /> <meta itemprop="longitude" content="{{object.longitude}}" /></span> <time datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"m/d/y"}}</time> 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 @@ <section> <h2>Background</h2> <img src="{{IMAGES_URL}}bio.jpg" alt="me" /> - <div class="content"> - {{top.content|smartypants|safe}} + <div class="content">{%for object in object_list %}{%if forloop.first %} + {{object.content|smartypants|safe}}{%endif%} {% endfor %} </div> </section> <section> <h2>About the Site</h2> <img src="{{IMAGES_URL}}site.jpg" alt="me" /> - <div class="content"> - {{middle.content|smartypants|safe}} + <div class="content">{%for object in object_list %}{%if forloop.last %} + {{object.content|smartypants|safe}}{%endif%} {% endfor %} </div> </section> <section> <h2>Colophon</h2> <img src="{{IMAGES_URL}}colo.jpg" alt="me" /> - <div class="content"> - {{bottom.content|smartypants|safe}} + <div class="content">{%for object in object_list %}{%if forloop.counter = 1 %} + {{object.content|smartypants|safe}}{%endif%} {% endfor %} </div> </section> </article> 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 %}<link rel="stylesheet" href="{{MEDIA_URL}}css/dark.css" @@ -14,8 +14,8 @@ <link rel="canonical" href="http://luxagraf.net{{object.get_absolute_url}}" /> <meta name="ICBM" content="{{object.latitude}}, {{object.longitude}}" /> <meta name="geo.position" content="{{object.latitude}}; {{object.longitude}}" /> - <meta name="geo.placename" content="{% 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%}"> - <meta name="geo.region" content="{% if object.location.state.country.name == "United States" %}{{object.location.state.country.iso2}}-{{object.location.state.iso2}}{%else%}{{object.location.state.country.iso2}}{% endif%}"> + <meta name="geo.placename" content="{% if object.country_name == "United States" %}{{object.location_name|smartypants|safe}}, {{object.state_name}}{%else%}{{object.location_name|smartypants|safe}}, {{object.country_name}}{%endif%}"> + <meta name="geo.region" content="{{object.country_iso}}{%if object.state_iso != None %}-{{object.state_iso}}{%endif%}"> {%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 @@ <header> <h1>{{object.title|smartypants|widont|safe}}</h1> <aside class="geo"> - <span class="location" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">{% if object.location.state.country.name == "United States" %}{{object.location.name|smartypants|safe}}, <a href="/writing/united-states/1/" title="travel writing from the United States">{{object.location.state.name}}</a>{%else%}{{object.location.name|smartypants|safe}}, <a href="/writing/{{object.location.state.country.slug}}/1/" title="travel writing from {{object.location.state.country.name}}">{{object.location.state.country.name}}</a>{%endif%} + <span class="location" itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">{% if object.country_name == "United States" %}{{object.location_name|smartypants|safe}}, <a href="/writing/united-states/1/" title="travel writing from the United States">{{object.state_name}}</a>{%else%}{{object.location_name|smartypants|safe}}, <a href="/writing/{{object.country_name|slugify}}/1/" title="travel writing from {{object.country_name}}">{{object.country_name}}</a>{%endif%} <meta itemprop="latitude" content="{{object.latitude}}" /> <meta itemprop="longitude" content="{{object.longitude}}" /></span> {%comment%} (<a href="" title="">Map</a>, <a href="" title="">Photos</a>){%endcomment%} @@ -38,25 +38,28 @@ <div class="clearfix"></div>{%endif%}{%if object.template_name == 3 %}<div class="clearfix"></div>{%endif%} <footer id="post-metadata"> <h4 class="hide">About {{object.title|smartypants|safe}}</h4> - <p>Posted <time datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"F j, Y"}}</time>, from {{object.location.name|smartypants|safe}}, {%if object.location.state.country.name == 'United States'%}<a href="/map/#{{object.location.state.country.slug}}" title="see other entries from {{object.location.state.name}}">{{object.location.state.name|smartypants|safe}}</a>{% else %}<a href="/map/#{{object.location.state.country.slug}}" title="view all entries from {{object.location.state.country.name}}">{{object.location.state.country.name}}</a>{%endif%}. + <p>Posted <time datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"F j, Y"}}</time>, from {% if object.country_name == "United States" %}{{object.location_name|smartypants|safe}}, <a href="/writing/united-states/1/" title="travel writing from the United States">{{object.state_name}}</a>{%else%}{{object.location_name|smartypants|safe}}, <a href="/writing/{{object.country_name|slugify}}/1/" title="travel writing from {{object.country_name}}">{{object.country_name}}</a>{%endif%}. Follow along on <a href="http://twitter.com/luxagraf" title="twitter" rel="me">Twitter</a> or by subscribing to the <a href="http://feeds.feedburner.com/luxagraf/blog" title="writing RSS 2.0 feed">RSS Feed</a>. For more about me, see the <a href="/about/" title="about luxagraf">about page</a>. To get in touch please use the <a href="/contact/" title="contact me">contact form</a> or leave a comment below.</p> </footer> + {% with object.get_next_published as next %} + {% with object.get_previous_published as prev %} <nav id="page-navigation"> - <ul>{% if object.get_next_published%} + <ul>{% if next%} <li id="prev"> - <a href="{{ object.get_next_published.get_absolute_url }}" title=" {{object.get_next_published.title}}">← newer</a> + <a href="{{ next.get_absolute_url }}" title=" {{next.title}}">← newer</a> </li>{%endif%} - {% if object.get_previous_published%}<li id="next"> - <a href="{{ object.get_previous_published.get_absolute_url }}" title=" {{object.get_previous_published.title}}">older →</a> + {% if prev%}<li id="next"> + <a href="{{ prev.get_absolute_url }}" title=" {{prev.title}}">older →</a> </li>{%endif%} </ul> - </nav> + </nav>{%endwith%}{%endwith%} <section id="comments"> <h4><a class="disqus-link-count" href="{{object.get_absolute_url}}#disqus_thread">Comments</a></h4> <div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/luxagraf/embed.js"></script><noscript><a href="http://luxagraf.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> </section> </article> {% endblock %} + {% block js %} <script type="text/javascript"> //<![CDATA[ |