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 {% if r != thread.replies[0] and thread.checkPerm(current_user, "DELETE_REPLY") %}
26 <a class="float-right btn btn-secondary btn-sm"
27 href="{{ url_for('threads.delete_reply', id=thread.id, reply=r.id) }}">
28 <i class="fas fa-trash"></i>
32 {{ r.comment | markdown }}
40 {% if thread.locked %}
41 <p class="my-0 py-4 text-center">
42 <i class="fas fa-lock mr-3"></i>
43 {{ _("This thread has been locked by a moderator.") }}
47 {% if current_user.is_authenticated %}
48 <div class="row mt-0 mb-4 comments mx-0">
49 <div class="col-md-1 p-1">
50 <img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
54 <div class="card-header {{ current_user.rank.name }}">
55 {{ current_user.display_name }}
59 {% if not current_user.canCommentRL() %}
60 <div class="card-body">
61 <textarea class="form-control" readonly disabled>{{ _("Please wait before commenting again.") }}</textarea><br />
62 <input class="btn btn-primary" type="submit" disabled value="Comment" />
64 {% elif not thread.checkPerm(current_user, "COMMENT_THREAD") %}
65 <div class="card-body">
66 {% if thread.locked %}
67 <textarea class="form-control" readonly disabled>{{ _("This thread has been locked.") }}</textarea><br />
69 <textarea class="form-control" readonly disabled>{{ _("You don't have permission to post.") }}</textarea><br />
71 <input class="btn btn-primary" type="submit" disabled value="Comment" />
74 <form method="post" action="{{ url_for('threads.view', id=thread.id)}}" class="card-body">
75 <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
76 <textarea class="form-control markdown" required maxlength=500 name="comment"></textarea><br />
77 <input class="btn btn-primary" type="submit" value="Comment" />
86 {% macro render_threadlist(threads, compact=False) -%}
87 {% for t in threads %}
88 <a class="list-group-item list-group-item-action"
89 href="{{ url_for('threads.view', id=t.id) }}">
91 {% if t.private %}🔒 {% endif %}
92 <strong>{{ t.title }}</strong>
93 by {{ t.author.display_name }}
98 {% if not t.review and t.private %}
99 <i class="fas fa-lock" style="color:#ffac33;"></i>
100 {% elif not t.review %}
101 <i class="fas fa-comment-alt" style="color:#666;"></i>
102 {% elif t.review.recommends %}
103 <i class="fas fa-thumbs-up" style="color:#6f6;"></i>
105 <i class="fas fa-thumbs-down" style="color:#f66;"></i>
109 <strong>{{ t.title }}</strong>
110 by {{ t.author.display_name }}
115 {{ _("%(title)s by %(author)s",
116 title="<b>" | safe + t.package.title + "</b>" | safe,
117 author=t.package.author.display_name) }}
121 <div class="col-sm-auto text-muted text-right">
122 {{ t.created_at | datetime }}
128 <p class="list-group-item"><i>No threads found</i></p>