Merge pull request #405 from justcool393/remove-more-dramaisms
Remove more dramaisms
This commit is contained in:
commit
947453869e
10 changed files with 3 additions and 116 deletions
|
@ -189,11 +189,6 @@ ACTIONTYPES = {
|
||||||
"icon": 'fa-robot',
|
"icon": 'fa-robot',
|
||||||
"color": 'bg-danger'
|
"color": 'bg-danger'
|
||||||
},
|
},
|
||||||
'disabled_Fart_mode': {
|
|
||||||
"str": 'disabled fart mode',
|
|
||||||
"icon": 'fa-gas-pump-slash',
|
|
||||||
"color": 'bg-danger'
|
|
||||||
},
|
|
||||||
'disabled_FilterNewPosts': {
|
'disabled_FilterNewPosts': {
|
||||||
"str": 'disabled filter new posts',
|
"str": 'disabled filter new posts',
|
||||||
"icon": 'fa-filter',
|
"icon": 'fa-filter',
|
||||||
|
@ -239,11 +234,6 @@ ACTIONTYPES = {
|
||||||
"icon": 'fa-robot',
|
"icon": 'fa-robot',
|
||||||
"color": 'bg-success'
|
"color": 'bg-success'
|
||||||
},
|
},
|
||||||
'enabled_Fart_mode': {
|
|
||||||
"str": 'enabled fart mode',
|
|
||||||
"icon": 'fa-gas-pump',
|
|
||||||
"color": 'bg-success'
|
|
||||||
},
|
|
||||||
'enabled_FilterNewPosts': {
|
'enabled_FilterNewPosts': {
|
||||||
"str": 'enabled filter new posts',
|
"str": 'enabled filter new posts',
|
||||||
"icon": 'fa-filter',
|
"icon": 'fa-filter',
|
||||||
|
@ -284,11 +274,6 @@ ACTIONTYPES = {
|
||||||
"icon": 'fa-user-crown',
|
"icon": 'fa-user-crown',
|
||||||
"color": 'bg-success'
|
"color": 'bg-success'
|
||||||
},
|
},
|
||||||
'make_meme_admin': {
|
|
||||||
"str": 'made {self.target_link} meme admin',
|
|
||||||
"icon": 'fa-user-crown',
|
|
||||||
"color": 'bg-success'
|
|
||||||
},
|
|
||||||
'monthly': {
|
'monthly': {
|
||||||
"str": 'distributed monthly marseybux',
|
"str": 'distributed monthly marseybux',
|
||||||
"icon": 'fa-sack-dollar',
|
"icon": 'fa-sack-dollar',
|
||||||
|
@ -329,11 +314,6 @@ ACTIONTYPES = {
|
||||||
"icon": 'fa-user-crown',
|
"icon": 'fa-user-crown',
|
||||||
"color": 'bg-danger'
|
"color": 'bg-danger'
|
||||||
},
|
},
|
||||||
'remove_meme_admin': {
|
|
||||||
"str": 'removed {self.target_link} as meme admin',
|
|
||||||
"icon": 'fa-user-crown',
|
|
||||||
"color": 'bg-danger'
|
|
||||||
},
|
|
||||||
'revert': {
|
'revert': {
|
||||||
"str": 'reverted {self.target_link} mod actions',
|
"str": 'reverted {self.target_link} mod actions',
|
||||||
"icon": 'fa-history',
|
"icon": 'fa-history',
|
||||||
|
@ -424,7 +404,6 @@ ACTIONTYPES = {
|
||||||
"icon": 'fa-eye',
|
"icon": 'fa-eye',
|
||||||
"color": 'bg-success'
|
"color": 'bg-success'
|
||||||
},
|
},
|
||||||
|
|
||||||
'fallback': {
|
'fallback': {
|
||||||
"str": 'unfamiliar action type, please report',
|
"str": 'unfamiliar action type, please report',
|
||||||
"icon": 'fa-robot',
|
"icon": 'fa-robot',
|
||||||
|
|
|
@ -105,14 +105,6 @@ AWARDS = {
|
||||||
"icon": "fas fa-user-secret",
|
"icon": "fas fa-user-secret",
|
||||||
"color": "text-green",
|
"color": "text-green",
|
||||||
"price": 300
|
"price": 300
|
||||||
},
|
|
||||||
"beano": {
|
|
||||||
"kind": "beano",
|
|
||||||
"title": "Beano",
|
|
||||||
"description": "Stops you from embarrassing yourself with your flatulence",
|
|
||||||
"icon": "fas fa-gas-pump-slash",
|
|
||||||
"color": "text-green",
|
|
||||||
"price": 1000
|
|
||||||
},
|
},
|
||||||
"pin": {
|
"pin": {
|
||||||
"kind": "pin",
|
"kind": "pin",
|
||||||
|
|
|
@ -326,47 +326,6 @@ def club_ban(v, username):
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": f"@{username} has been kicked from the {CC_TITLE}. Deserved."}
|
return {"message": f"@{username} has been kicked from the {CC_TITLE}. Deserved."}
|
||||||
|
|
||||||
|
|
||||||
@app.post("/@<username>/make_meme_admin")
|
|
||||||
@limiter.exempt
|
|
||||||
@admin_level_required(3)
|
|
||||||
def make_meme_admin(v, username):
|
|
||||||
user = get_user(username)
|
|
||||||
if not user: abort(404)
|
|
||||||
user.admin_level = 1
|
|
||||||
g.db.add(user)
|
|
||||||
|
|
||||||
ma = ModAction(
|
|
||||||
kind="make_meme_admin",
|
|
||||||
user_id=v.id,
|
|
||||||
target_user_id=user.id
|
|
||||||
)
|
|
||||||
g.db.add(ma)
|
|
||||||
|
|
||||||
g.db.commit()
|
|
||||||
return {"message": "User has been made meme admin!"}
|
|
||||||
|
|
||||||
|
|
||||||
@app.post("/@<username>/remove_meme_admin")
|
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
|
||||||
@admin_level_required(3)
|
|
||||||
def remove_meme_admin(v, username):
|
|
||||||
user = get_user(username)
|
|
||||||
if not user: abort(404)
|
|
||||||
user.admin_level = 0
|
|
||||||
g.db.add(user)
|
|
||||||
|
|
||||||
ma = ModAction(
|
|
||||||
kind="remove_meme_admin",
|
|
||||||
user_id=v.id,
|
|
||||||
target_user_id=user.id
|
|
||||||
)
|
|
||||||
g.db.add(ma)
|
|
||||||
|
|
||||||
g.db.commit()
|
|
||||||
return {"message": "Meme admin removed!"}
|
|
||||||
|
|
||||||
|
|
||||||
@app.get("/admin/shadowbanned")
|
@app.get("/admin/shadowbanned")
|
||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
|
@ -216,12 +216,6 @@ def award_post(pid, v):
|
||||||
g.db.add(badge)
|
g.db.add(badge)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
||||||
elif kind == "beano":
|
|
||||||
if not author.has_badge(128):
|
|
||||||
badge = Badge(user_id=author.id, badge_id=128)
|
|
||||||
g.db.add(badge)
|
|
||||||
g.db.flush()
|
|
||||||
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
|
||||||
|
|
||||||
if author.received_award_count: author.received_award_count += 1
|
if author.received_award_count: author.received_award_count += 1
|
||||||
else: author.received_award_count = 1
|
else: author.received_award_count = 1
|
||||||
|
@ -328,12 +322,6 @@ def award_comment(cid, v):
|
||||||
g.db.add(badge)
|
g.db.add(badge)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
||||||
elif kind == "beano":
|
|
||||||
if not author.has_badge(128):
|
|
||||||
badge = Badge(user_id=author.id, badge_id=128)
|
|
||||||
g.db.add(badge)
|
|
||||||
g.db.flush()
|
|
||||||
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
|
||||||
|
|
||||||
if author.received_award_count: author.received_award_count += 1
|
if author.received_award_count: author.received_award_count += 1
|
||||||
else: author.received_award_count = 1
|
else: author.received_award_count = 1
|
||||||
|
|
|
@ -262,7 +262,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
||||||
else:
|
else:
|
||||||
if post.is_banned and not (v and (v.admin_level > 1 or post.author_id == v.id)): template = "submission_banned.html"
|
if post.is_banned and not (v and (v.admin_level > 1 or post.author_id == v.id)): template = "submission_banned.html"
|
||||||
else: template = "submission.html"
|
else: template = "submission.html"
|
||||||
return render_template(template, v=v, p=post, ids=list(ids), sort=sort, render_replies=True, offset=offset, sub=post.subr, fart=app.config['SETTINGS']['Fart mode'])
|
return render_template(template, v=v, p=post, ids=list(ids), sort=sort, render_replies=True, offset=offset, sub=post.subr)
|
||||||
|
|
||||||
@app.get("/viewmore/<pid>/<sort>/<offset>")
|
@app.get("/viewmore/<pid>/<sort>/<offset>")
|
||||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||||
|
|
|
@ -29,12 +29,6 @@ def logged_out(old = ""):
|
||||||
|
|
||||||
return redirect(redirect_url)
|
return redirect(redirect_url)
|
||||||
|
|
||||||
@app.get("/marseys")
|
|
||||||
@auth_required
|
|
||||||
def marseys(v):
|
|
||||||
marseys = g.db.query(Marsey).order_by(Marsey.count.desc())
|
|
||||||
return render_template("marseys.html", v=v, marseys=marseys)
|
|
||||||
|
|
||||||
@app.get("/marsey_list")
|
@app.get("/marsey_list")
|
||||||
@cache.memoize(timeout=600, make_name=make_name)
|
@cache.memoize(timeout=600, make_name=make_name)
|
||||||
def marsey_list():
|
def marsey_list():
|
||||||
|
@ -198,7 +192,6 @@ def cached_chart(kind, site):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/patrons")
|
@app.get("/patrons")
|
||||||
@app.get("/paypigs")
|
|
||||||
@admin_level_required(3)
|
@admin_level_required(3)
|
||||||
def patrons(v):
|
def patrons(v):
|
||||||
users = g.db.query(User).filter(User.patron > 0).order_by(User.patron.desc(), User.id).all()
|
users = g.db.query(User).filter(User.patron > 0).order_by(User.patron.desc(), User.id).all()
|
||||||
|
@ -206,7 +199,6 @@ def patrons(v):
|
||||||
return render_template("patrons.html", v=v, users=users)
|
return render_template("patrons.html", v=v, users=users)
|
||||||
|
|
||||||
@app.get("/admins")
|
@app.get("/admins")
|
||||||
@app.get("/badmins")
|
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def admins(v):
|
def admins(v):
|
||||||
if v and v.admin_level > 2:
|
if v and v.admin_level > 2:
|
||||||
|
|
|
@ -73,11 +73,6 @@
|
||||||
<label class="custom-control-label" for="bots">Bots</label>
|
<label class="custom-control-label" for="bots">Bots</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="custom-control custom-switch">
|
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="Fart mode" {% if site_settings['Fart mode'] %}checked{% endif %} onchange="post_toast(this,'/admin/site_settings/Fart mode');">
|
|
||||||
<label class="custom-control-label" for="Fart mode">Fart mode</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="FilterNewPosts" {% if site_settings['FilterNewPosts'] %}checked{% endif %} onchange="post_toast(this,'/admin/site_settings/FilterNewPosts');">
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="FilterNewPosts" {% if site_settings['FilterNewPosts'] %}checked{% endif %} onchange="post_toast(this,'/admin/site_settings/FilterNewPosts');">
|
||||||
<label class="custom-control-label" for="FilterNewPosts">Filter New Posts</label>
|
<label class="custom-control-label" for="FilterNewPosts">Filter New Posts</label>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
{% for user in admins %}
|
{% for user in admins %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{loop.index}}</td>
|
<td>{{loop.index}}</td>
|
||||||
<td><a href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}}"{% endif %}>{{user.username}}</span></a>{% if user.admin_level == 1 and v and v.admin_level > 1 %}<i class="fas fa-broom align-middle ml-2 color-white" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Meme Admin"></i>{% endif %}</td>
|
<td><a href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}}"{% endif %}>{{user.username}}</span></a></td>
|
||||||
<td class="text-right"><a href="/log?admin={{user.username}}">{{user.modaction_num}}</a></td>
|
<td class="text-right"><a href="/log?admin={{user.username}}">{{user.modaction_num}}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -67,10 +67,6 @@
|
||||||
<span>
|
<span>
|
||||||
<i class="fas fa-broom text-admin align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
|
<i class="fas fa-broom text-admin align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
|
||||||
</span>
|
</span>
|
||||||
{% elif u.admin_level == 1 and v and v.admin_level > 1 %}
|
|
||||||
<span>
|
|
||||||
<i class="fas fa-broom align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Meme Admin"></i>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if v and v.has_follower(u) %}
|
{% if v and v.has_follower(u) %}
|
||||||
<span class="followsyou badge badge-secondary text-small align-middle ml-2">Follows you</span>
|
<span class="followsyou badge badge-secondary text-small align-middle ml-2">Follows you</span>
|
||||||
|
@ -167,12 +163,7 @@
|
||||||
|
|
||||||
{% if v and v.admin_level > 2 %}
|
{% if v and v.admin_level > 2 %}
|
||||||
<a id="admin" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a>
|
<a id="admin" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a>
|
||||||
|
|
||||||
<a id="unadmin" class="{% if u.admin_level < 2 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/remove_admin','admin','unadmin')">Remove admin</a>
|
<a id="unadmin" class="{% if u.admin_level < 2 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/remove_admin','admin','unadmin')">Remove admin</a>
|
||||||
|
|
||||||
<a id="memeadmin" class="{% if u.admin_level == 1%}d-none{% endif %} btn btn-primary" role="button" onclick="post_toast2(this,'/@{{u.username}}/make_meme_admin','memeadmin','unmemeadmin')">Make meme admin</a>
|
|
||||||
<a id="unmemeadmin" class="{% if u.admin_level != 1 %}d-none{% endif %} btn btn-primary" role="button" onclick="post_toast2(this,'/@{{u.username}}/remove_meme_admin','memeadmin','unmemeadmin')">Remove meme admin</a>
|
|
||||||
|
|
||||||
{% if u.admin_level > 1 %}
|
{% if u.admin_level > 1 %}
|
||||||
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/revert_actions')">Revert admin actions</a>
|
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/revert_actions')">Revert admin actions</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -350,10 +341,6 @@
|
||||||
<span>
|
<span>
|
||||||
<i class="fas fa-broom text-admin align-middle ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
|
<i class="fas fa-broom text-admin align-middle ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
|
||||||
</span>
|
</span>
|
||||||
{% elif u.admin_level == 1 and v and v.admin_level > 1 %}
|
|
||||||
<span>
|
|
||||||
<i class="fas fa-broom align-middle ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Meme Admin"></i>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if v and v.has_follower(u) and not v.is_nofollow %}
|
{% if v and v.has_follower(u) and not v.is_nofollow %}
|
||||||
<span class="followsyou badge badge-secondary text-small align-middle mx-1">Follows you</span>
|
<span class="followsyou badge badge-secondary text-small align-middle mx-1">Follows you</span>
|
||||||
|
@ -441,12 +428,7 @@
|
||||||
|
|
||||||
{% if v and v.admin_level > 2 %}
|
{% if v and v.admin_level > 2 %}
|
||||||
<a id="admin2" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a>
|
<a id="admin2" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a>
|
||||||
|
|
||||||
<a id="unadmin2" class="{% if u.admin_level < 2 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/remove_admin','admin2','unadmin2')">Remove admin</a>
|
<a id="unadmin2" class="{% if u.admin_level < 2 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2(this,'/@{{u.username}}/remove_admin','admin2','unadmin2')">Remove admin</a>
|
||||||
|
|
||||||
<a id="memeadmin2" class="{% if u.admin_level == 1%}d-none{% endif %} btn btn-primary" role="button" onclick="post_toast2(this,'/@{{u.username}}/make_meme_admin','memeadmin2','unmemeadmin2')">Make meme admin</a>
|
|
||||||
<a id="unmemeadmin2" class="{% if u.admin_level != 1 %}d-none{% endif %} btn btn-primary" role="button" onclick="post_toast2(this,'/@{{u.username}}/remove_meme_admin','memeadmin2','unmemeadmin2')">Remove meme admin</a>
|
|
||||||
|
|
||||||
{% if u.admin_level > 1 %}
|
{% if u.admin_level > 1 %}
|
||||||
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/revert_actions')">Revert admin actions</a>
|
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/revert_actions')">Revert admin actions</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"Bots": true, "Fart mode": false, "Read-only mode": false, "Signups": true, "FilterNewPosts": false, "FilterCommentsMinComments": 0, "FilterCommentsMinKarma": 0, "FilterCommentsMinAgeDays": 0}
|
{"Bots": true, "Read-only mode": false, "Signups": true, "FilterNewPosts": false, "FilterCommentsMinComments": 0, "FilterCommentsMinKarma": 0, "FilterCommentsMinAgeDays": 0}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue