1 {% macro render_thread(thread, current_user) -%}
3 <ul class="comments mt-4 mb-0">
4 {% for r in thread.replies %}
5 <li class="row my-2 mx-0">
6 <div class="col-md-1 p-1">
7 <a href="{{ url_for('users.profile', username=r.author.username) }}">
8 <img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ r.author.getProfilePicURL() }}">
11 <div class="col pr-0">
13 <div class="card-header">
14 <a class="author {{ r.author.rank.name }}"
15 href="{{ url_for('users.profile', username=r.author.username) }}">
16 {{ r.author.display_name }}
18 <a name="reply-{{ r.id }}" class="text-muted float-right"
19 href="{{ url_for('threads.view', id=thread.id) }}#reply-{{ r.id }}">
20 {{ r.created_at | datetime }}
24 <div class="card-body">
25 {{ r.comment | markdown }}
33 {% if thread.locked %}
34 <p class="my-0 py-4 text-center">
35 <i class="fas fa-lock mr-3"></i>
36 {{ _("This thread has been locked by a moderator.") }}
40 {% if current_user.is_authenticated %}
41 <div class="row mt-0 mb-4 comments mx-0">
42 <div class="col-md-1 p-1">
43 <img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
47 <div class="card-header {{ current_user.rank.name }}">
48 {{ current_user.display_name }}
52 {% if not current_user.canCommentRL() %}
53 <div class="card-body">
54 <textarea class="form-control" readonly disabled>{{ _("Please wait before commenting again.") }}</textarea><br />
55 <input class="btn btn-primary" type="submit" disabled value="Comment" />
57 {% elif not thread.checkPerm(current_user, "COMMENT_THREAD") %}
58 <div class="card-body">
59 {% if thread.locked %}
60 <textarea class="form-control" readonly disabled>{{ _("This thread has been locked.") }}</textarea><br />
62 <textarea class="form-control" readonly disabled>{{ _("You don't have permission to post.") }}</textarea><br />
64 <input class="btn btn-primary" type="submit" disabled value="Comment" />
67 <form method="post" action="{{ url_for('threads.view', id=thread.id)}}" class="card-body">
68 <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
69 <textarea class="form-control markdown" required maxlength=500 name="comment"></textarea><br />
70 <input class="btn btn-primary" type="submit" value="Comment" />
79 {% macro render_threadlist(threads, compact=False) -%}
80 {% for t in threads %}
81 <a class="list-group-item list-group-item-action"
82 href="{{ url_for('threads.view', id=t.id) }}">
84 {% if t.private %}🔒 {% endif %}
85 <strong>{{ t.title }}</strong>
86 by {{ t.author.display_name }}
91 {% if not t.review and t.private %}
92 <i class="fas fa-lock" style="color:#ffac33;"></i>
93 {% elif not t.review %}
94 <i class="fas fa-comment-alt" style="color:#666;"></i>
95 {% elif t.review.recommends %}
96 <i class="fas fa-thumbs-up" style="color:#6f6;"></i>
98 <i class="fas fa-thumbs-down" style="color:#f66;"></i>
102 <strong>{{ t.title }}</strong>
103 by {{ t.author.display_name }}
108 {{ _("%(title)s by %(author)s",
109 title="<b>" | safe + t.package.title + "</b>" | safe,
110 author=t.package.author.display_name) }}
114 <div class="col-sm-auto text-muted text-right">
115 {{ t.created_at | datetime }}
121 <p class="list-group-item"><i>No threads found</i></p>