bcv
This commit is contained in:
parent
2341214dc9
commit
5bf1ff5daa
5 changed files with 24 additions and 9 deletions
|
@ -224,7 +224,7 @@ else:
|
|||
CARP_ID = 0
|
||||
JOAN_ID = 0
|
||||
MOOSE_ID = 0
|
||||
AEVANN_ID = 0
|
||||
AEVANN_ID = 10
|
||||
HOMO_ID = 0
|
||||
Q_ID = 0
|
||||
LAWLZ_ID = 0
|
||||
|
|
|
@ -62,12 +62,18 @@ def remove_mod(v, sub):
|
|||
try: uid = int(uid)
|
||||
except: abort(400)
|
||||
|
||||
mod = g.db.query(Mod).filter_by(user_id=uid, sub=sub).one_or_none()
|
||||
user = g.db.query(User).filter_by(id=uid).one_or_none()
|
||||
|
||||
if not user: abort(404)
|
||||
|
||||
mod = g.db.query(Mod).filter_by(user_id=user.id, sub=sub).one_or_none()
|
||||
if not mod: abort(400)
|
||||
|
||||
if not (v.id == user.id or v.mod_date(sub.name) and v.mod_date(sub.name) < mod.created_utc): abort(403)
|
||||
|
||||
g.db.delete(mod)
|
||||
|
||||
send_repeatable_notification(uid, f"You have been removed as a mod from /s/{sub}")
|
||||
send_repeatable_notification(user.id, f"You have been removed as a mod from /s/{sub}")
|
||||
|
||||
g.db.commit()
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
</form>
|
||||
|
||||
<pre></pre>
|
||||
{% if SITE != 'Drama' or v.id == AEVANN_ID %}
|
||||
{% if SITE_NAME != 'Drama' or v.id == AEVANN_ID %}
|
||||
<div><a class="btn btn-danger" role="button" onclick="post_toast('/admin/monthly')">Grant Monthly Marseybux</a></div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -147,7 +147,11 @@
|
|||
<button class="dropdown-item copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fad fa-user-friends fa-fw text-left mr-3"></i>Invite friends</button>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<a class="dropdown-item" href="/assets/{{config('SITE_NAME')}}_v1.7.apk?a=2"><i class="fab fa-android fa-fw text-left mr-3"></i>Android app</a>
|
||||
{% if SITE_NAME == 'Drama' %}
|
||||
<a class="dropdown-item" href="https://play.google.com/store/apps/details?id=com.rdrama"><i class="fab fa-android fa-fw text-left mr-3"></i>Android app</a>
|
||||
{% else %}
|
||||
<a class="dropdown-item" href="/assets/{{config('SITE_NAME')}}_v1.7.apk?a=2"><i class="fab fa-android fa-fw text-left mr-3"></i>Android app</a>
|
||||
{% endif %}
|
||||
|
||||
<a class="dropdown-item" href="/changelog"><i class="fas fa-clipboard fa-fw text-left mr-3"></i>Changelog</a>
|
||||
|
||||
|
@ -208,7 +212,12 @@
|
|||
<a class="nav-link copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fas fa-user-friends fa-fw text-left mr-3"></i>Invite friends</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<a class="nav-item nav-link" href="/assets/{{config('SITE_NAME')}}_v1.7.apk?a=2"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
|
||||
|
||||
{% if SITE_NAME == 'Drama' %}
|
||||
<a class="nav-item nav-link" href="https://play.google.com/store/apps/details?id=com.rdrama"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
|
||||
{% else %}
|
||||
<a class="nav-item nav-link" href="/assets/{{config('SITE_NAME')}}_v1.7.apk?a=2"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
|
||||
{% endif %}
|
||||
|
||||
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/Drama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>
|
||||
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
<td><a style="color:#{{user.namecolor}}; font-weight:bold;" href="/@{{user.username}}"><img alt="@{{user.username}}'s profile picture" 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 style="font-weight: bold">{{mod.created_datetime}}</td>
|
||||
<td>
|
||||
{% if v.mod_date(sub.name) and v.mod_date(sub.name) < mod.created_utc %}
|
||||
{% if v.id == user.id or v.mod_date(sub.name) and v.mod_date(sub.name) < mod.created_utc %}
|
||||
<form action="/s/{{sub.name}}/remove_mod" method="post">
|
||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}" >
|
||||
<input autocomplete="off" type="hidden" name="uid" value="{{user.id}}">
|
||||
<input class="btn btn-primary" style="margin-top:-5px" autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="Remove Mod">
|
||||
<input class="btn btn-primary" style="margin-top:-5px" autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="{% if v.id == user.id %}Resign{% else %}Remove Mod{% endif %}">
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
@ -34,7 +34,7 @@
|
|||
|
||||
</table>
|
||||
|
||||
{% if v.mods(sub) %}
|
||||
{% if v.mods(sub.name) %}
|
||||
<form action="/s/{{sub.name}}/add_mod" method="post">
|
||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}" >
|
||||
<input class="form-control" style="display:inline;width:25%" autocomplete="off" type="text" name="user" class="form-control" placeholder="Enter username..">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue