Commits

David Chambers  committed 007ce3d

Simplified template logic.

  • Participants
  • Parent commits a9dae24

Comments (0)

Files changed (1)

 from mango.main import *
 from mango.templatetags import mango_extras
 
-document_template = Template('''{% load mango_extras %}{% ifequal meta None %}date: 29 September 2010
+document_template = Template('''{% load mango_extras %}{% if meta == None %}date: 29 September 2010
 time: 1:30am
 tags: Markdown, Django, Mango
 {% else %}{% for k, v in meta %}{{ k }}: {{ v }}
-{% endfor %}{% endifequal %}
-{% ifequal title None %}
+{% endfor %}{% endif %}
+{% if title == None %}
 Introducing Mango
 =================
 {% else %}
 {{ title|h1 }}
-{% endifequal %}
-{% ifequal body None %}Mango attempts to make blogging fun again.{% else %}{{ body }}{% endifequal %}
+{% endif %}
+{% firstof body 'Mango attempts to make blogging fun again.' %}
 ''')
 
 def create_document(filename='test.text', context=None):