By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 post.html

View raw Download
text/html • 5.01 kiB
HTML document, ASCII text
        
            
1
<dl>
2
<dt>
3
<article class="card">
4
<section class="card-main">
5
<p class="post-details"><a href="/{{ post.owner.username }}" class="post-author">{{ post.owner.username }}</a> &bull; {{ post.date | strftime("%A, %e %B %Y, %H:%M:%S") }}</p>
6
{% if level %}
7
<h2><a href="{{ post.number }}">{{ post.subject }}</a> <span class="post-number">#{{ post.number }}</span></h2>
8
{% else %}
9
<dialog id="add-label">
10
<article class="card">
11
<section class="card-main">
12
<form method="dialog" id="close-add-label"></form>
13
<form method="POST" action="{{ post.number }}/label">
14
<x-vbox>
15
<label>
16
{% trans %}Label to add:{% endtrans %}
17
<select name="label">
18
{% for label in repo_data.labels %}
19
<option value="{{ label }}">{{ label }}</option>
20
{% endfor %}
21
</select>
22
</label>
23
<x-buttonbox>
24
<button type="submit">{% trans %}Add label{% endtrans %}</button>
25
<button type="submit" form="close-add-label">{% trans %}Cancel{% endtrans %}</button>
26
</x-buttonbox>
27
</x-vbox>
28
</form>
29
</section>
30
</article>
31
</dialog>
32
<h2>{{ post.subject }} <span class="post-number">#{{ post.number }}</span></h2>
33
<x-hbox class="post-labels">
34
{% for label in post.labels %}
35
<a href="/label/{{ label }}">{{ label }}</a>
36
{% endfor %}
37
<button id="add-label-button" class="button-flat" onclick="document.getElementById('add-label').showModal();">
38
<iconify-icon icon="mdi:plus"></iconify-icon>
39
</button>
40
</x-hbox>
41
{% endif %}
42
<p>
43
{{ post.html | safe }}
44
</p>
45
{% if logged_in_user %}
46
<x-buttonbox>
47
<x-buttonbox class="box-center segmented">
48
<button onclick="vote({{ post.number }}, 1);" class="vote-button big-button" id="{{ post.number }}-voteup"><iconify-icon icon="mdi:arrow-up"></iconify-icon></button>
49
<span style="font-size: 1.5em;" class="vote-score" id="{{ post.number }}-vote">{{ post.voteSum }}</span>
50
<button onclick="vote({{ post.number }}, -1);" class="vote-button big-button" id="{{ post.number }}-votedown"><iconify-icon icon="mdi:arrow-down"></iconify-icon></button>
51
<script>vote({{ post.number }}, 0);</script>
52
</x-buttonbox>
53
{% if post.owner_name == logged_in_user %}
54
<a class="button" href="{{ post.number }}/edit">{% trans %}Edit{% endtrans %}</a>
55
{% endif %}
56
</x-buttonbox>
57
{% endif %}
58
</section>
59
</article>
60
</dt>
61
{% if logged_in_user %}
62
<dd>
63
<details class="reply-area">
64
<summary>{% trans %}Reply{% endtrans %}</summary>
65
66
<form method="POST" action="{{ post.number }}/reply">
67
<x-vbox>
68
<x-vbox class="nopad">
69
<label for="{{ post.number }}-subject">{% trans %}Subject{% endtrans %}</label>
70
<input id="{{ post.number }}-subject" name="subject" value="Re: {{ post.subject }}" required>
71
</x-vbox>
72
<textarea name="message" style="box-sizing: border-box;" rows="8" required></textarea>
73
<x-buttonbox>
74
<button type="submit">{% trans %}Submit{% endtrans %}</button>
75
</x-buttonbox>
76
</x-vbox>
77
</form>
78
</details>
79
</dd>
80
{% endif %}
81
{% set level = level + 1 %}
82
{% if level <= max_post_nesting %}
83
{% if post.children %}
84
{% for post in Post.query.filter_by(parent=post).order_by(Post.date) %}
85
<dd>{% include "post.html" %}</dd>
86
{% endfor %}
87
{% endif %}
88
{% elif post.children %}
89
<dd>
90
<a href="{{ post.number }}">{% trans %}Comments hidden; click to go deeper.{% endtrans %}</a>
91
</dd>
92
{% endif %}
93
</dl>
94