diff options
| author | rubenwardy <rw@rubenwardy.com> | 2020-07-11 01:34:51 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2020-07-11 01:42:47 +0100 |
| commit | bf927c50f00bd15c7bc1765b7d5fb0c6a6abeb86 (patch) | |
| tree | ff27c709826ce17002e1d670938b5a6142608695 /app/templates/macros/threads.html | |
| parent | 5f7be4b4337358e35c9eda4b261260a08a958b4a (diff) | |
| download | cheatdb-bf927c50f00bd15c7bc1765b7d5fb0c6a6abeb86.tar.xz | |
Add the ability to lock threads
Diffstat (limited to 'app/templates/macros/threads.html')
| -rw-r--r-- | app/templates/macros/threads.html | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/app/templates/macros/threads.html b/app/templates/macros/threads.html index 4732af2..f9f298a 100644 --- a/app/templates/macros/threads.html +++ b/app/templates/macros/threads.html @@ -8,7 +8,7 @@ <img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ r.author.getProfilePicURL() }}"> </a> </div> - <div class="col"> + <div class="col pr-0"> <div class="card"> <div class="card-header"> <a class="author {{ r.author.rank.name }}" @@ -30,6 +30,13 @@ {% endfor %} </ul> +{% if thread.locked %} + <p class="my-0 py-4 text-center"> + <i class="fas fa-lock mr-3"></i> + {{ _("This thread has been locked by a moderator.") }} + </p> +{% endif %} + {% if current_user.is_authenticated %} <div class="row mt-0 mb-4 comments mx-0"> <div class="col-md-1 p-1"> @@ -42,17 +49,26 @@ <a name="reply"></a> </div> - {% if current_user.canCommentRL() %} + {% if not current_user.canCommentRL() %} + <div class="card-body"> + <textarea class="form-control" readonly disabled>{{ _("Please wait before commenting again.") }}</textarea><br /> + <input class="btn btn-primary" type="submit" disabled value="Comment" /> + </div> + {% elif not thread.checkPerm(current_user, "COMMENT_THREAD") %} + <div class="card-body"> + {% if thread.locked %} + <textarea class="form-control" readonly disabled>{{ _("This thread has been locked.") }}</textarea><br /> + {% else %} + <textarea class="form-control" readonly disabled>{{ _("You don't have permission to post.") }}</textarea><br /> + {% endif %} + <input class="btn btn-primary" type="submit" disabled value="Comment" /> + </div> + {% else %} <form method="post" action="{{ url_for('threads.view', id=thread.id)}}" class="card-body"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <textarea class="form-control markdown" required maxlength=500 name="comment"></textarea><br /> <input class="btn btn-primary" type="submit" value="Comment" /> </form> - {% else %} - <div class="card-body"> - <textarea class="form-control" readonly disabled>Please wait before commenting again.</textarea><br /> - <input class="btn btn-primary" type="submit" disabled value="Comment" /> - </div> {% endif %} </div> </div> |
