fdfdMerge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
Aevann1 2022-05-28 17:51:31 +00:00
commit 076c799c6a
8 changed files with 14 additions and 80 deletions

View File

@ -274,11 +274,6 @@ ACTIONTYPES = {
"icon": 'fa-user-crown',
"color": 'bg-success'
},
'make_meme_admin': {
"str": 'made {self.target_link} meme admin',
"icon": 'fa-user-crown',
"color": 'bg-success'
},
'monthly': {
"str": 'distributed monthly marseybux',
"icon": 'fa-sack-dollar',
@ -319,11 +314,6 @@ ACTIONTYPES = {
"icon": 'fa-user-crown',
"color": 'bg-danger'
},
'remove_meme_admin': {
"str": 'removed {self.target_link} as meme admin',
"icon": 'fa-user-crown',
"color": 'bg-danger'
},
'revert': {
"str": 'reverted {self.target_link} mod actions',
"icon": 'fa-history',

View File

@ -28,13 +28,13 @@ AJ_REPLACEMENTS = {
' YOUR ': " YOU'RE ",
' TO ': " TOO ",
'anybody': 'anypony',
'everyone': 'everypony',
'everybody': 'everypony',
'Anybody': 'Anypony',
'Everyone': 'Everypony',
'Everybody': 'Everypony',
'ANYBODY': 'ANYPONY',
'EVERYONE': 'EVERYPONY',
'EVERYBODY': 'EVERYPONY',
}

View File

@ -368,46 +368,6 @@ def club_ban(v, username):
return {"message": f"@{username} has been kicked from the {CC_TITLE}. Deserved."}
@app.post("/@<username>/make_meme_admin")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@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.post("/admin/monthly")
@limiter.limit("1/day")
@admin_level_required(3)

View File

@ -169,8 +169,6 @@ def notifications(v):
@auth_desired
def front_all(v, sub=None, subdomain=None):
if v and v.id == 8494: print(request.headers.get('CF-Connecting-IP'))
if not v and not request.path.startswith('/logged_out'):
r = request.full_path
if r == '/?': r = '/'

View File

@ -22,7 +22,7 @@
{% for user in admins %}
<tr>
<td>{{loop.index}}</td>
<td><a style="color:#{{user.namecolor}}" 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 style="color:#{{user.namecolor}}" 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 style="text-align:right;">{{user.truecoins}}</td>
<td style="text-align:right;"><a href="/log?admin={{user.username}}">{{user.modaction_num}}</a></td>
</tr>

View File

@ -181,7 +181,7 @@
{% if SITE_NAME == 'rDrama' %}
<a class="dropdown-item" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
{% endif %}
{% if SITE_NAME != 'Cringetopia' %}
{% if SITE_NAME not in ('Cringetopia', 'WPD') %}
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="{{config('GUMROAD_LINK')}}"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% endif %}
{% if SITE_NAME == 'rDrama' %}
@ -239,7 +239,7 @@
{% if SITE_NAME == 'rDrama' %}
<a class="nav-item nav-link" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
{% endif %}
{% if SITE_NAME != 'Cringetopia' %}
{% if SITE_NAME not in ('Cringetopia', 'WPD') %}
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="{{config('GUMROAD_LINK')}}"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% endif %}
{% if SITE_NAME == 'rDrama' %}<a class="nav-item nav-link" href="/archives"><i class="fas fa-book fa-fw mr-3"></i>Archives</a>{% endif %}

View File

@ -44,7 +44,7 @@
</div>
<div class="footer">
<div class="d-flex">
{% if SITE_NAME != 'Cringetopia' %}
{% if SITE_NAME not in ('Cringetopia', 'WPD') %}
<a class="btn btn-success" role="button" onclick="post_toast(this,'/settings/gumroad')">Claim paypig rewards</a>
{% endif %}
{% if v.email %}
@ -53,7 +53,7 @@
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="Add email">
{% endif %}
</div>
{% if SITE_NAME != 'Cringetopia' %}
{% if SITE_NAME not in ('Cringetopia', 'WPD') %}
<span class="text-small-extra text-muted pl-1">Must be same email as gumroad</span>
{% endif %}
</div>

View File

@ -69,13 +69,9 @@
{% endif %}
{% if u.admin_level > 1 or (u.admin_level == 1 and not(v and v.admin_level > 1)) %}
<span id="profile--mop">
<i class="fas fa-broom text-admin align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
</span>
{% elif u.admin_level == 1 and v and v.admin_level > 1 %}
<span id="profile--mop">
<i class="fas fa-broom align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Meme Admin"></i>
</span>
<span id="profile--mop">
<i class="fas fa-broom text-admin align-middle ml-2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
</span>
{% endif %}
{% if v and v.has_follower(u) %}
<span class="followsyou badge badge-secondary text-small align-middle ml-2" id="profile--follows-you">Follows you</span>
@ -188,9 +184,6 @@
<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 %}
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/revert_actions')">Revert admin actions</a>
{% endif %}
@ -394,13 +387,9 @@
{% endif %}
{% if u.admin_level > 1 or (u.admin_level == 1 and not(v and v.admin_level > 1)) %}
<span id="profile--mop">
<i class="fas fa-broom text-admin align-middle ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
</span>
{% elif u.admin_level == 1 and v and v.admin_level > 1 %}
<span id="profile--mop">
<i class="fas fa-broom align-middle ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Meme Admin"></i>
</span>
<span id="profile--mop">
<i class="fas fa-broom text-admin align-middle ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
</span>
{% endif %}
{% if v and v.has_follower(u) and not v.is_nofollow %}
<span class="followsyou badge badge-secondary text-small align-middle mx-1" id="profile--follows-you">Follows you</span>
@ -502,9 +491,6 @@
<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 %}
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/revert_actions')">Revert admin actions</a>
{% endif %}