show duration on ban icon tooltip
parent
d59a80245d
commit
ffd0d9ed31
|
@ -51,7 +51,7 @@ class Comment(Base):
|
||||||
edited_utc = Column(Integer, default=0)
|
edited_utc = Column(Integer, default=0)
|
||||||
is_banned = Column(Boolean, default=False)
|
is_banned = Column(Boolean, default=False)
|
||||||
ghost = Column(Boolean, default=False)
|
ghost = Column(Boolean, default=False)
|
||||||
bannedfor = Column(Boolean)
|
bannedfor = Column(String)
|
||||||
distinguish_level = Column(Integer, default=0)
|
distinguish_level = Column(Integer, default=0)
|
||||||
deleted_utc = Column(Integer, default=0)
|
deleted_utc = Column(Integer, default=0)
|
||||||
is_approved = Column(Integer, ForeignKey("users.id"))
|
is_approved = Column(Integer, ForeignKey("users.id"))
|
||||||
|
|
|
@ -40,7 +40,7 @@ class Submission(Base):
|
||||||
created_utc = Column(Integer)
|
created_utc = Column(Integer)
|
||||||
thumburl = Column(String)
|
thumburl = Column(String)
|
||||||
is_banned = Column(Boolean, default=False)
|
is_banned = Column(Boolean, default=False)
|
||||||
bannedfor = Column(Boolean)
|
bannedfor = Column(String)
|
||||||
ghost = Column(Boolean, default=False)
|
ghost = Column(Boolean, default=False)
|
||||||
views = Column(Integer, default=0)
|
views = Column(Integer, default=0)
|
||||||
deleted_utc = Column(Integer, default=0)
|
deleted_utc = Column(Integer, default=0)
|
||||||
|
|
|
@ -1110,19 +1110,15 @@ def ban_user(user_id, v):
|
||||||
|
|
||||||
if 'reason' in request.values:
|
if 'reason' in request.values:
|
||||||
if request.values["reason"].startswith("/post/"):
|
if request.values["reason"].startswith("/post/"):
|
||||||
try:
|
post = int(request.values["reason"].split("/post/")[1].split(None, 1)[0])
|
||||||
post = int(request.values["reason"].split("/post/")[1].split(None, 1)[0])
|
post = get_post(post)
|
||||||
post = get_post(post)
|
post.bannedfor = duration
|
||||||
post.bannedfor = True
|
g.db.add(post)
|
||||||
g.db.add(post)
|
|
||||||
except: pass
|
|
||||||
elif request.values["reason"].startswith("/comment/"):
|
elif request.values["reason"].startswith("/comment/"):
|
||||||
try:
|
comment = int(request.values["reason"].split("/comment/")[1].split(None, 1)[0])
|
||||||
comment = int(request.values["reason"].split("/comment/")[1].split(None, 1)[0])
|
comment = get_comment(comment)
|
||||||
comment = get_comment(comment)
|
comment.bannedfor = duration
|
||||||
comment.bannedfor = True
|
g.db.add(comment)
|
||||||
g.db.add(comment)
|
|
||||||
except: pass
|
|
||||||
|
|
||||||
notify_mod_action(v.id, f"@{v.username} has banned @{user.username} ({note})")
|
notify_mod_action(v.id, f"@{v.username} has banned @{user.username} ({note})")
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
<script src="/assets/js/ban_modal.js?v=241"></script>
|
<script src="/assets/js/ban_modal.js?v=242"></script>
|
||||||
|
|
||||||
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">
|
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if c.bannedfor %}
|
{% if c.bannedfor %}
|
||||||
<a role="button"><i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this comment{% if c.author.banned_by %} by @{{c.author.banned_by.username}}{% endif %}"></i></a>
|
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this comment{% if c.author.banned_by %} by @{{c.author.banned_by.username}}{% endif %} for {{c.bannedfor}}"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if c.active_flags(v) %}<a class="btn btn-primary" style="padding:1px 5px; font-size:10px"role="button" onclick="document.getElementById('flaggers-{{c.id}}').classList.toggle('d-none')">{{c.active_flags(v)}} Report{{ help.plural(c.active_flags(v)) }}</a>{% endif %}
|
{% if c.active_flags(v) %}<a class="btn btn-primary" style="padding:1px 5px; font-size:10px"role="button" onclick="document.getElementById('flaggers-{{c.id}}').classList.toggle('d-none')">{{c.active_flags(v)}} Report{{ help.plural(c.active_flags(v)) }}</a>{% endif %}
|
||||||
{% if c.over_18 %}<span class="badge badge-danger text-small-extra mr-1">+18</span>{% endif %}
|
{% if c.over_18 %}<span class="badge badge-danger text-small-extra mr-1">+18</span>{% endif %}
|
||||||
|
|
|
@ -713,7 +713,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.bannedfor %}
|
{% if p.bannedfor %}
|
||||||
<a role="button"><i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this post{% if p.author.banned_by %} by @{{p.author.banned_by.username}}{% endif %}"></i></a>
|
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this post{% if p.author.banned_by %} by @{{p.author.banned_by.username}}{% endif %} for {{p.bannedfor}}"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for a in p.awards|reverse %}
|
{% for a in p.awards|reverse %}
|
||||||
|
|
|
@ -156,7 +156,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.bannedfor %}
|
{% if p.bannedfor %}
|
||||||
<a role="button"><i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this post{% if p.author.banned_by %} by @{{p.author.banned_by.username}}{% endif %}"></i></a>
|
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this post{% if p.author.banned_by %} by @{{p.author.banned_by.username}}{% endif %} for {{p.bannedfor}}"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for a in p.awards|reverse %}
|
{% for a in p.awards|reverse %}
|
||||||
|
|
|
@ -84,7 +84,7 @@ CREATE TABLE public.submissions (
|
||||||
private boolean DEFAULT false NOT NULL,
|
private boolean DEFAULT false NOT NULL,
|
||||||
views integer DEFAULT 0 NOT NULL,
|
views integer DEFAULT 0 NOT NULL,
|
||||||
is_bot boolean DEFAULT false NOT NULL,
|
is_bot boolean DEFAULT false NOT NULL,
|
||||||
bannedfor boolean,
|
bannedfor character varying(11),
|
||||||
comment_count integer DEFAULT 0 NOT NULL,
|
comment_count integer DEFAULT 0 NOT NULL,
|
||||||
club boolean DEFAULT false NOT NULL,
|
club boolean DEFAULT false NOT NULL,
|
||||||
stickied character varying(40),
|
stickied character varying(40),
|
||||||
|
@ -273,7 +273,7 @@ CREATE TABLE public.comments (
|
||||||
is_bot boolean DEFAULT false NOT NULL,
|
is_bot boolean DEFAULT false NOT NULL,
|
||||||
app_id integer,
|
app_id integer,
|
||||||
sentto integer,
|
sentto integer,
|
||||||
bannedfor boolean,
|
bannedfor character varying(11),
|
||||||
stickied character varying(40),
|
stickied character varying(40),
|
||||||
body character varying(10000),
|
body character varying(10000),
|
||||||
body_html character varying(40000),
|
body_html character varying(40000),
|
||||||
|
|
Loading…
Reference in New Issue