Skip to content

Commit

Permalink
fix all templates to access result contents using dictionary syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusty Phillips committed Jan 22, 2010
1 parent 838517c commit 8a78662
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions demos/blog/templates/archive.html
Expand Up @@ -23,8 +23,8 @@
<ul class="archive">
{% for entry in entries %}
<li>
<div class="title"><a href="/entry/{{ entry.slug }}">{{ escape(entry.title) }}</a></div>
<div class="date">{{ locale.format_date(entry.published, full_format=True, shorter=True) }}</div>
<div class="title"><a href="/entry/{{ entry['slug'] }}">{{ escape(entry['title']) }}</a></div>
<div class="date">{{ locale.format_date(entry['published'], full_format=True, shorter=True) }}</div>
</li>
{% end %}
</ul>
Expand Down
8 changes: 4 additions & 4 deletions demos/blog/templates/compose.html
Expand Up @@ -2,15 +2,15 @@

{% block body %}
<form action="{{ request.path }}" method="post" class="compose">
<div style="margin-bottom:5px"><input name="title" type="text" class="title" value="{{ escape(entry.title) if entry else "" }}"/></div>
<div style="margin-bottom:5px"><textarea name="markdown" rows="30" cols="40" class="markdown">{{ escape(entry.markdown) if entry else "" }}</textarea></div>
<div style="margin-bottom:5px"><input name="title" type="text" class="title" value="{{ escape(entry['title']) if entry else "" }}"/></div>
<div style="margin-bottom:5px"><textarea name="markdown" rows="30" cols="40" class="markdown">{{ escape(entry['markdown']) if entry else "" }}</textarea></div>
<div>
<div style="float:right"><a href="http://daringfireball.net/projects/markdown/syntax">{{ _("Syntax documentation") }}</a></div>
<input type="submit" value="{{ _("Save changes") if entry else _("Publish post") }}" class="submit"/>
&nbsp;<a href="{{ "/entry/" + entry.slug if entry else "/" }}">{{ _("Cancel") }}</a>
&nbsp;<a href="{{ "/entry/" + entry['slug'] if entry else "/" }}">{{ _("Cancel") }}</a>
</div>
{% if entry %}
<input type="hidden" name="id" value="{{ entry.id }}"/>
<input type="hidden" name="id" value="{{ entry['id'] }}"/>
{% end %}
{{ xsrf_form_html() }}
</form>
Expand Down
14 changes: 7 additions & 7 deletions demos/blog/templates/feed.xml
Expand Up @@ -3,7 +3,7 @@
{% set date_format = "%Y-%m-%dT%H:%M:%SZ" %}
<title>{{ escape(handler.settings["blog_title"]) }}</title>
{% if len(entries) > 0 %}
<updated>{{ max(e.updated for e in entries).strftime(date_format) }}</updated>
<updated>{{ max(e['updated'] for e in entries).strftime(date_format) }}</updated>
{% else %}
<updated>{{ datetime.datetime.utcnow().strftime(date_format) }}</updated>
{% end %}
Expand All @@ -13,13 +13,13 @@
<author><name>{{ escape(handler.settings["blog_title"]) }}</name></author>
{% for entry in entries %}
<entry>
<id>http://{{ request.host }}/entry/{{ entry.slug }}</id>
<title type="text">{{ escape(entry.title) }}</title>
<link href="http://{{ request.host }}/entry/{{ entry.slug }}" rel="alternate" type="text/html"/>
<updated>{{ entry.updated.strftime(date_format) }}</updated>
<published>{{ entry.published.strftime(date_format) }}</published>
<id>http://{{ request.host }}/entry/{{ entry['slug'] }}</id>
<title type="text">{{ escape(entry['title']) }}</title>
<link href="http://{{ request.host }}/entry/{{ entry['slug'] }}" rel="alternate" type="text/html"/>
<updated>{{ entry['updated'].strftime(date_format) }}</updated>
<published>{{ entry['published'].strftime(date_format) }}</published>
<content type="xhtml" xml:base="http://{{ request.host }}/">
<div xmlns="http://www.w3.org/1999/xhtml">{{ entry.html }}</div>
<div xmlns="http://www.w3.org/1999/xhtml">{{ entry['html'] }}</div>
</content>
</entry>
{% end %}
Expand Down
8 changes: 4 additions & 4 deletions demos/blog/templates/modules/entry.html
@@ -1,8 +1,8 @@
<div class="entry">
<h1><a href="/entry/{{ entry.slug }}">{{ escape(entry.title) }}</a></h1>
<div class="date">{{ locale.format_date(entry.published, full_format=True, shorter=True) }}</div>
<div class="body">{{ entry.html }}</div>
<h1><a href="/entry/{{ entry['slug'] }}">{{ escape(entry['title']) }}</a></h1>
<div class="date">{{ locale.format_date(entry['published'], full_format=True, shorter=True) }}</div>
<div class="body">{{ entry['html'] }}</div>
{% if current_user %}
<div class="admin"><a href="/compose?id={{ entry.id }}">{{ _("Edit this post") }}</a></div>
<div class="admin"><a href="/compose?id={{ entry['id'] }}">{{ _("Edit this post") }}</a></div>
{% end %}
</div>

0 comments on commit 8a78662

Please sign in to comment.