remotes/1693045480750635534/spooky-22
Aevann1 2022-02-15 01:14:59 +02:00
parent 10fab387b1
commit e8057ca010
3 changed files with 34 additions and 32 deletions

View File

@ -81,13 +81,13 @@ def stats():
"total posts": g.db.query(Submission.id).count(),
"posting users": g.db.query(Submission.author_id).distinct().count(),
"listed posts": g.db.query(Submission.id).filter_by(is_banned=False).filter(Submission.deleted_utc == 0).count(),
"removed posts": g.db.query(Submission.id).filter_by(is_banned=True).count(),
"deleted posts": g.db.query(Submission.id).filter(Submission.deleted_utc > 0).count(),
"removed posts (by admins)": g.db.query(Submission.id).filter_by(is_banned=True).count(),
"deleted posts (by author)": g.db.query(Submission.id).filter(Submission.deleted_utc > 0).count(),
"posts last 24h": g.db.query(Submission.id).filter(Submission.created_utc > day).count(),
"total comments": g.db.query(Comment.id).filter(Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count(),
"commenting users": g.db.query(Comment.author_id).distinct().count(),
"removed comments": g.db.query(Comment.id).filter_by(is_banned=True).count(),
"deleted comments": g.db.query(Comment.id).filter(Comment.deleted_utc > 0).count(),
"removed comments (by admins)": g.db.query(Comment.id).filter_by(is_banned=True).count(),
"deleted comments (by author)": g.db.query(Comment.id).filter(Comment.deleted_utc > 0).count(),
"comments last_24h": g.db.query(Comment.id).filter(Comment.created_utc > day, Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count(),
"post votes": g.db.query(Vote.id).count(),
"post voting users": g.db.query(Vote.user_id).distinct().count(),

View File

@ -693,11 +693,9 @@
<a id="undistinguish2-{{c.id}}" class="list-group-item {% if not c.distinguish_level %}d-none{% endif %} text-info" role="button" onclick="post_toast2(this,'/distinguish_comment/{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}')" data-bs-dismiss="modal"><i class="fas fa-id-badge text-info"></i>Undistinguish</a>
{% endif %}
{% if c.deleted_utc %}
<a role="button" onclick="post_toast(this,'/undelete/comment/{{c.id}}')" data-bs-dismiss="modal" class="list-group-item"><i class="fas fa-trash-alt"></i>Undelete</a>
{% else %}
<a role="button" data-bs-toggle="modal" data-bs-target="#deleteCommentModal" onclick="delete_commentModal('{{c.id}}')" class="list-group-item"><i class="fas fa-trash-alt"></i>Delete</a>
{% endif %}
<button id="undelete-{{c.id}}" class="{% if not c.deleted_utc %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-success" role="button" onclick="post_toast2(this,'/undelete_comment/{{c.id}}', 'delete-{{c.id}}', 'undelete-{{c.id}}');document.getElementById('comment-{{c.id}}').classList.remove('deleted')" data-bs-dismiss="modal"><i class="far fa-trash-alt text-center mr-3"></i>Undelete</button>
<button id="delete-{{c.id}}" class="{% if c.deleted_utc %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#deleteCommentModal" onclick="delete_commentModal('{{c.id}}')"><i class="far fa-trash-alt mr-3"></i>Delete</button>
<a id="mark2-{{c.id}}" class="{% if c.over_18 %}d-none{% endif %} list-group-item text-danger" role="button" onclick="post_toast2(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger"></i>Mark +18</a>
<a id="unmark2-{{c.id}}" class="{% if not c.over_18 %}d-none{% endif %} list-group-item text-danger" role="button" onclick="post_toast2(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger"></i>Unmark +18</a>
@ -812,30 +810,34 @@
{% include "ban_modal.html" %}
{% endif %}
<div class="modal fade" id="deleteCommentModal" tabindex="-1" role="dialog" aria-labelledby="deleteCommentModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete comment?</h5>
<button class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><i class="far fa-times"></i></span>
</button>
</div>
<div class="modal-body text-center">
<div class="modal fade" id="deleteCommentModal" tabindex="-1" role="dialog" aria-labelledby="deleteCommentModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header d-none d-md-flex">
<h5 class="modal-title">Delete comment?</h5>
<button class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><i class="far fa-times"></i></span>
</button>
</div>
<div class="modal-body text-center">
<div class="py-4">
<i class="fad fa-trash-alt text-muted" style="font-size: 3.5rem;"></i>
</div>
<p>Your comment will be removed everywhere on {{SITE_NAME}}. This action can be undone.</p>
</div>
<div class="modal-footer">
<button class="btn btn-link text-muted" data-bs-dismiss="modal">Cancel</button>
<button id="deleteCommentButton" class="btn btn-danger">Delete comment</button>
</div>
<div class="py-4">
<i class="fad fa-trash-alt text-muted d-none d-md-block" style="font-size: 3.5rem;"></i>
</div>
<div class="h4 d-md-none">Delete comment?</div>
<p class="d-none d-md-block">Your comment will be deleted everywhere on {{SITE_NAME}}.</p>
<p class="text-muted d-md-none">Your comment will be deleted everywhere on {{SITE_NAME}}.</p>
<button id="deleteCommentButton" class="btn btn-danger btn-block mt-5" data-bs-dismiss="modal">Delete comment</button>
<button class="btn btn-secondary btn-block" data-bs-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="reportCommentModal" tabindex="-1" role="dialog" aria-labelledby="reportCommentModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
@ -964,7 +966,7 @@
{% if v %}
<script src="/static/assets/js/marked.js?a=242"></script>
<script src="/static/assets/js/comments_v.js?a=247"></script>
<script src="/static/assets/js/comments_v.js?a=248"></script>
{% endif %}
<script src="/static/assets/js/clipboard.js?a=250"></script>

View File

@ -17,9 +17,9 @@
<div class="h4 d-md-none">Delete post?</div>
<p class="d-none d-md-block">Your post will be removed everywhere on {{SITE_NAME}}. This action can be undone.</p>
<p class="d-none d-md-block">Your post will be deleted everywhere on {{SITE_NAME}}.</p>
<p class="text-muted d-md-none">Your post will be removed everywhere on {{SITE_NAME}}. This action can be undone.</p>
<p class="text-muted d-md-none">Your post will be deleted everywhere on {{SITE_NAME}}.</p>
<button id="deletePostButton" class="btn btn-danger btn-block mt-5" data-bs-dismiss="modal">Delete post</button>