post.html
HTML document, ASCII text
1<dl> 2<dt> 3<article class="card"> 4<section class="card-main"> 5{% if post.parent and not level %} 6<a href="{{ parent.parent.number }}"> 7<x-hbox class="box-center"> 8<iconify-icon icon="mdi:arrow-left"></iconify-icon> 9{{ post.parent.subject }} 10</x-hbox> 11</a> 12{% endif %} 13{% if level %} 14<h2><a href="{{ post.number }}">{{ post.subject }}</a></h2> 15{% else %} 16<h2>{{ post.subject }}</h2> 17{% endif %} 18<p><a href="/{{ post.owner.username }}">{{ post.owner.username }}</a> • {{ post.date | strftime("%A, %e %B %Y, %H:%M:%S") }}</p> 19<p> 20{{ post.message }} 21</p> 22{% if logged_in_user %} 23<x-buttonbox class="box-center"> 24<button onclick="vote({{ post.number }}, 1);" class="button-flat big-button" id="{{ post.number }}-voteup"><iconify-icon icon="mdi:arrow-up"></iconify-icon></button> 25<span style="font-size: 1.5em;" id="{{ post.number }}-vote">{{ post.voteSum }}</span> 26<button onclick="vote({{ post.number }}, -1);" class="button-flat big-button" id="{{ post.number }}-votedown"><iconify-icon icon="mdi:arrow-down"></iconify-icon></button> 27<script>vote({{ post.number }}, 0);</script> 28</x-buttonbox> 29{% endif %} 30</section> 31</article> 32</dt> 33{% if logged_in_user %} 34<dd> 35<details> 36<summary>Reply</summary> 37 38<form method="POST" action="{{ post.number }}/reply"> 39<x-vbox> 40<x-vbox class="nopad"> 41<label for="{{ post.number }}-subject">Subject</label> 42<input id="{{ post.number }}-subject" name="subject" value="Re: {{ post.subject }}" required> 43</x-vbox> 44<textarea name="message" style="box-sizing: border-box;" rows="8" required></textarea> 45<x-buttonbox> 46<button type="submit">Submit</button> 47</x-buttonbox> 48</x-vbox> 49</form> 50</details> 51</dd> 52{% endif %} 53{% set level = level + 1 %} 54{% if level <= max_post_nesting %} 55{% if post.children %} 56{% for post in Post.query.filter_by(parent=post).order_by(Post.date) %} 57<dd>{% include "post.html" %}</dd> 58{% endfor %} 59{% endif %} 60{% elif post.children %} 61<dd> 62<a href="{{ post.number }}">Comments hidden; click to go deeper.</a> 63</dd> 64{% endif %} 65</dl> 66