Commits

David Chambers  committed 5c6acb2

Added `type` to context dictionary passed to `post.dhtml`. Possible values are `page` and `post`. `post.dhtml` now displays metadata for posts only.

  • Participants
  • Parent commits ef2cef5

Comments (0)

Files changed (2)

File templates/post.dhtml

 						<h1>{{ meta.title }}</h1>
 					{% if meta.datetime %}
 						<time datetime="{{ meta.datetime|datetime }}">{{ meta.datetime|display_date }}</time>
-					{% endif %}
+					{% endif %}{% ifequal type 'post' %}
 						<dl>
 							<dt>Short URL</dt>
 							<dd><a href="{{ short_url }}">{{ short_url }}</a></dd>
 							<dt>Markdown</dt>
 							<dd><a href="{{ markdown_url }}">{{ markdown_url }}</a></dd>
 						</dl>
+					{% endifequal %}
 					</header>
 					{{ html|safe }}
 					{% if meta.tags %}
 
 		context['thread'] = thread
 		context['num_visible_posts'] = num_visible_posts
+		context['type'] = 'post' if 'datetime' in context['meta'] else 'page'
 
 		return render_to_string('post.dhtml', dict(context, **context_defaults(request)))