diff --git a/files/templates/default.html b/files/templates/default.html index 89b17f365..1f34dd880 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -220,7 +220,7 @@ // Delete Post - function delete_postModal(id) { + function delete_postModal(id,button1,button2) { // Passed data for modal @@ -240,6 +240,9 @@ ) } + document.getElementById(button1).classList.toggle("d-none"); + document.getElementById(button2).classList.toggle("d-none"); + }; // Delete Comment diff --git a/files/templates/submission.html b/files/templates/submission.html index 48390a248..82a3e8ddb 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -109,7 +109,7 @@ - + {% if p.deleted_utc > 0 %} @@ -406,42 +406,37 @@
  • Copy link
  • - {% if v and not (v.admin_level == 6 and v.id == p.author_id) %} - {% if p.id in v.subscribed_idlist() %} -
  • Unsubscribe
  • - {% else %} -
  • Subscribe
  • - {% endif %} + {% if v %} +
  • Subscribe
  • +
  • Unsubscribe
  • {% endif %} - {% if v and p.id in v.saved_idlist() %} -
  • Unsave
  • - {% elif v %} -
  • Save
  • - {% endif %} +
  • Save
  • +
  • Unsave
  • Report
  • {% if v and v.id==p.author_id %} -
  • {% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}
  • - {% if p.deleted_utc > 0 %} -
  • Undelete
  • - {% else %} -
  • Delete
  • - {% endif %} +
  • Pin to profile
  • +
  • Unpin from profile
  • + +
  • Delete
  • +
  • Undelete
  • {% endif %} {% if v and v.admin_level>=3 %} -
  • {% if p.stickied %}Unpin{% else %}Pin{% endif %}
  • +
  • Pin
  • +
  • Unpin
  • {% if v==p.author %} -
  • Distinguish
  • +
  • Distinguish
  • +
  • Undistinguish
  • {% endif %} {% endif %} {% if v %} {% if v.admin_level >=3 %} -
  • Approve
  • -
  • Remove
  • +
  • Remove
  • +
  • Approve
  • {% endif %} {% if v.id == p.author_id or v.admin_level >= 3 %} @@ -453,27 +448,18 @@ {% endif %} {% if not v.id==p.author_id and v.admin_level == 0 %} -
  • Block user
  • -
  • Unblock user
  • +
  • Block user
  • +
  • Unblock user
  • {% endif %} {% if not v.id==p.author_id and v.admin_level == 1 %} -
  • Ban user
  • -
  • Unban user
  • +
  • Ban user
  • +
  • Unban user
  • {% endif %} {% if v.admin_level >=3 and v.id!=p.author_id %} - {% if p.author.is_suspended %} -
  • Unban user
  • - {% else %} -
  • Ban user
  • - {% endif %} +
  • Ban user
  • +
  • Unban user
  • {% endif %} {% endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index c1a471813..9dbf14fdb 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -20,14 +20,14 @@ {% endif %} -
    +
    {% if not postembed %}
    - {% if v and request.path.startswith('/@') and v.admin_level == 0 %} + {% if v and request.path.startswith('/@') and not v.admin_level %} {% if voted==1 %}
    @@ -148,41 +148,39 @@
  • Copy link
  • - {% if v and not (v.admin_level == 6 and v.id == p.author_id) %} -
  • Unsubscribe
  • + {% if v %}
  • Subscribe
  • +
  • Unsubscribe
  • {% endif %} - {% if v and p.id in v.saved_idlist() %} -
  • Unsave
  • - {% elif v %} -
  • Save
  • - {% endif %} +
  • Save
  • +
  • Unsave
  • Report
  • {% if v and v.id==p.author_id %} -
  • {% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}
  • - {% if p.deleted_utc > 0 %} -
  • Undelete
  • - {% else %} -
  • Delete
  • - {% endif %} +
  • Pin to profile
  • +
  • Unpin from profile
  • + +
  • Delete
  • +
  • Undelete
  • {% endif %} {% if v and v.admin_level>=3 %} -
  • {% if p.stickied %}Unpin{% else %}Pin{% endif %}
  • - {% if v==p.author %} -
  • Distinguish
  • - {% endif %} +
  • Pin
  • +
  • Unpin
  • + {% if v==p.author %} +
  • Distinguish
  • +
  • Undistinguish
  • + {% endif %} {% endif %} {% if v %} {% if v.admin_level >=3 %} -
  • Approve
  • -
  • Remove
  • +
  • Remove
  • +
  • Approve
  • {% endif %} @@ -190,25 +188,20 @@
  • API App
  • {% endif %} - {% if not v.id==p.author_id and v.admin_level == 0 %} -
  • Block user
  • -
  • Unblock user
  • + {% if not v.id==p.author_id and not v.admin_level %} +
  • Block user
  • +
  • Unblock user
  • {% endif %} {% if v and (v.id==p.author_id or v.admin_level>=3) %} -
  • Toggle +18
  • +
  • Toggle +18
  • {% endif %} {% if v.admin_level >=3 and v.id!=p.author_id %} - {% if p.author.is_suspended %} -
  • Unban user
  • - {% else %} -
  • Ban user
  • - {% endif %} +
  • Ban user
  • +
  • Unban user
  • {% endif %} {% endif %} @@ -235,7 +228,7 @@ {% endif %} {% if not postembed %} - {% if v and request.path.startswith('/@') and v.admin_level == 0 %} + {% if v and request.path.startswith('/@') and not v.admin_level %}
  • {% if voted==1 %} @@ -299,9 +292,9 @@ {% endif %} - + - {% if p.deleted_utc > 0 %} + {% if p.deleted_utc %} {% else %} @@ -343,7 +336,7 @@ {% endif %} - {% if v and v.id != p.author_id and v.admin_level == 0 %} + {% if v and v.id != p.author_id and not v.admin_level %} {% endif %} + {% if not v.id==p.author_id and v.admin_level == 1 %} +
  • Ban user
  • +
  • Unban user
  • + {% endif %} + {% if v and v.admin_level == 6 and v.id!=p.author_id %} {% if p.author.is_suspended %} diff --git a/restart b/restart index dffca0e74..a49abcda2 100644 --- a/restart +++ b/restart @@ -1,3 +1,3 @@ source /env killall gunicorn -gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 \ No newline at end of file +gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --reload-extra-file ./files/templates/ \ No newline at end of file diff --git a/supervisord.conf b/supervisord.conf index beaf519ed..3125863a8 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -5,7 +5,7 @@ logfile=/tmp/supervisord.log [program:service] directory=/service -command=gunicorn files.__main__:app -k gevent -w 2 --max-requests 10000 --max-requests-jitter 500 --reload --bind 0.0.0.0:80 +command=gunicorn files.__main__:app -k gevent -w 2 --reload -b 0.0.0.0:80 --reload-extra-file ./files/templates/ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr