From 2bbcced032937240ac6fb3f1cfe5136d421b3bea Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 22 May 2018 19:31:07 +0200 Subject: refactor(templates): Move post editing template to Askama --- templates/post.html | 64 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 28 deletions(-) (limited to 'templates/post.html') diff --git a/templates/post.html b/templates/post.html index db6b00959d93..50d23c93a36b 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,4 +1,4 @@ - +#} @@ -17,7 +17,6 @@ Converse: Post - @@ -31,13 +30,14 @@
- {% if mode == "NewThread" %} -
- {% elif mode == "PostReply" %} - - {% elif mode == "EditPost" %} - - {% endif %} - {% if mode == "PostReply" %} - - {% elif mode == "EditPost" %} - - {% endif %} + {% match mode %} + {% when EditingMode::NewThread %} + + {% when EditingMode::PostReply %} + + {% when EditingMode::EditPost %} + + {% endmatch %} + {% match mode %} + {% when EditingMode::PostReply %} + + {% when EditingMode::EditPost %} + + {% else %} + {# no post ID when making a new thread #} + {% endmatch %}
- {%- for alert in alerts %} + {% for alert in alerts %} {{ alert }}  - {% endfor -%} - - {% if mode == "NewThread" %} + {% endfor %} + {% if mode == EditingMode::NewThread %}
- +
{% endif %}
-- cgit 1.4.1