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