master
Aevann1 2022-05-10 09:20:49 +02:00
parent b7a2527be9
commit 9bd8fcbd1c
19 changed files with 79 additions and 67 deletions

View File

@ -614,6 +614,14 @@ AWARDS = {
"color": "text-gold",
"price": 50000
},
"checkmark": {
"kind": "checkmark",
"title": "Checkmark",
"description": "Gives the recipient a checkmark.",
"icon": "fas fa-badge-check",
"color": "checkmark",
"price": 100000
},
}
if SITE_NAME == 'PCM':

View File

@ -1098,42 +1098,6 @@ def unshadowban(user_id, v):
g.db.commit()
return {"message": "User unshadowbanned!"}
@app.post("/admin/verify/<user_id>")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(3)
def verify(user_id, v):
user = g.db.query(User).filter_by(id=user_id).one_or_none()
user.verified = "Verified"
g.db.add(user)
ma = ModAction(
kind="check",
user_id=v.id,
target_user_id=user.id,
)
g.db.add(ma)
g.db.commit()
return {"message": "User verfied!"}
@app.post("/admin/unverify/<user_id>")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(3)
def unverify(user_id, v):
user = g.db.query(User).filter_by(id=user_id).one_or_none()
user.verified = None
g.db.add(user)
ma = ModAction(
kind="uncheck",
user_id=v.id,
target_user_id=user.id,
)
g.db.add(ma)
g.db.commit()
return {"message": "User unverified!"}
@app.post("/admin/title_change/<user_id>")
@limiter.limit("1/second;30/minute;200/hour;1000/day")

View File

@ -347,6 +347,8 @@ def award_post(pid, v):
g.db.add(badge)
g.db.flush()
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
elif kind == "checkmark":
author.verified = "Verified"
if author.received_award_count: author.received_award_count += 1
else: author.received_award_count = 1
@ -586,6 +588,8 @@ def award_comment(cid, v):
g.db.add(badge)
g.db.flush()
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
elif kind == "checkmark":
author.verified = "Verified"
if author.received_award_count: author.received_award_count += 1
else: author.received_award_count = 1

View File

@ -1355,6 +1355,10 @@ def submit_post(v, sub=None):
if body.startswith('!slots'):
check_for_slots_command(body, snappy, c)
if body.startswith(':#marseypin:'):
post.stickied = "Snappy"
post.stickied_utc = int(time.time()) + 3600
g.db.flush()
c.top_comment_id = c.id

View File

@ -394,8 +394,6 @@ def gumroad(v):
v.procoins += procoins
send_repeatable_notification(v.id, f"You have received {procoins} Marseybux! You can use them to buy awards in the [shop](/shop).")
if v.patron > 1 and v.verified == None: v.verified = "Verified"
g.db.add(v)
if not v.has_badge(20+tier):
@ -892,6 +890,27 @@ def settings_title_change(v):
return redirect("/settings/profile")
@app.post("/settings/checkmark_text")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{request.host}-{session.get("lo_user")}')
@auth_required
def settings_checkmark_text(v):
if not v.verified: abort(403)
new_name=request.values.get("title").strip()[:100].replace("𒐪","")
if not new_name: abort(400)
if new_name == v.verified: return render_template("settings_profile.html", v=v, error="You didn't change anything")
v.verified = new_name
g.db.add(v)
g.db.commit()
return redirect("/settings/profile")
@app.get("/settings")
@auth_required
def settings(v):

View File

@ -15,7 +15,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.agendaposter %}
<style>
@ -40,7 +40,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
{% endif %}

View File

@ -18,6 +18,11 @@
<div class="text-muted"><span id="{{award.kind}}-owned">{{award.owned}}</span> owned</div>
</a>
{% endfor %}
<a class="card disabled d-md-none" style="border:none">
<i class="fas fa-volume-mute" style="opacity:0"></i>
<div class="pt-2" style="font-weight: bold; font-size: 14px; color:#E1E1E1">&nbsp;</div>
<div class="text-muted">&nbsp;</div>
</a>
</div>
<label id="notelabel" for="note" class="pt-4">Note (optional):</label>
<input autocomplete="off" id="kind" name="kind" value="" hidden>

View File

@ -14,7 +14,7 @@
<title>Chat</title>
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.css %}
<link rel="stylesheet" href="/@{{v.username}}/css">

View File

@ -7,7 +7,7 @@
<script src="/assets/js/bootstrap.js?v=245"></script>
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.agendaposter %}
<style>
@ -32,7 +32,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
{% endif %}

View File

@ -6,7 +6,7 @@
{% block content %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.agendaposter %}
<style>
@ -31,7 +31,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
{% endif %}

View File

@ -18,7 +18,7 @@
{% endblock %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
</head>

View File

@ -14,7 +14,7 @@
<title>2-Step Login - {{SITE_NAME}}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
</head>

View File

@ -34,7 +34,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% if v.agendaposter %}
<style>

View File

@ -39,11 +39,11 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
{% endif %}
</head>

View File

@ -514,7 +514,7 @@
<div class="body d-lg-flex border-bottom">
<label class="text-black w-lg-25">Bluecheck Color</label>
<label class="text-black w-lg-25">Checkmark Color</label>
<div class="d-flex">
@ -548,6 +548,24 @@
</div>
</div>
<div class="body d-lg-flex border-bottom">
<label class="text-black w-lg-25">Checkmark Hover Text</label>
<div class="w-lg-100">
<form action="/settings/checkmark_text" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input minlength=1 maxlength=100 autocomplete="off" id="checkmark_text" type="text" name="title" class="form-control" placeholder='Enter text here' value="{{v.verified}}">
<div class="d-flex mt-2">
<small>Limit of 100 characters</small>
<input autocomplete="off" class="btn btn-primary ml-auto" id="titleSave" type="submit" value="Change Text">
</div>
</form>
</div>
</div>
{% endif %}

View File

@ -31,7 +31,7 @@
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
</head>

View File

@ -32,7 +32,7 @@
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
</head>

View File

@ -26,7 +26,7 @@
{% block stylesheets %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=49">
{% if v.agendaposter %}
<style>
@ -51,7 +51,7 @@
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=258">
<link rel="stylesheet" href="/assets/css/main.css?v=259">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=49">
{% endif %}
{% endblock %}

View File

@ -294,11 +294,6 @@
<pre></pre>
{% if v.admin_level > 2 %}
<a id="verify" class="{% if u.verified %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast2(this,'/admin/verify/{{u.id}}','verify','unverify')">Verify</a>
<a id="unverify" class="{% if not u.verified %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast2(this,'/admin/unverify/{{u.id}}','verify','unverify')">Unverify</a>
{% endif %}
<pre></pre>
<form action="/admin/unnuke_user" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
@ -608,11 +603,6 @@
<pre></pre>
{% if v.admin_level > 2 %}
<a id="verify2" class="{% if u.verified %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast2(this,'/admin/verify/{{u.id}}','verify2','unverify2')">Verify</a>
<a id="unverify2" class="{% if not u.verified %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast2(this,'/admin/unverify/{{u.id}}','verify2','unverify2')">Unverify</a>
{% endif %}
<pre></pre>
<form action="/admin/unnuke_user" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">