]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/macros/threads.html
Improve comment CSS
[cheatdb.git] / app / templates / macros / threads.html
1 {% macro render_thread(thread, current_user) -%}
2         <ul class="comments">
3                 {% for r in thread.replies %}
4                         <li>
5                                 <a class="author {{ r.author.rank.name }}"
6                                         href="{{ url_for('user_profile_page', username=r.author.username) }}">{{ r.author.display_name }}</a>
7                                 <div class="msg">
8                                         {{ r.comment }}
9                                 </div>
10                         </li>
11                 {% endfor %}
12         </ul>
13
14         {% if current_user.is_authenticated %}
15                 <form method="post" action="{{ url_for('thread_page', id=thread.id)}}" class="comment_form">
16                         <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
17                         <textarea required maxlength=500 name="comment"></textarea><br />
18                         <input type="submit" value="Comment" />
19                 </form>
20         {% endif %}
21 {% endmacro %}
22
23 {% macro render_threadlist(threads) -%}
24         <ul>
25                 {% for t in threads %}
26                         <li><a href="{{ url_for('thread_page', id=t.id) }}">{{ t.title }}</a> by {{ t.author.display_name }}</li>
27                 {% endfor %}
28         </ul>
29 {% endmacro %}