fsd
This commit is contained in:
parent
33c28f2a67
commit
936b9f06a2
6 changed files with 66 additions and 11 deletions
|
@ -14,7 +14,15 @@ if site_name == "Drama":
|
|||
"description": "Bans the author for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
"price": 5000
|
||||
"price": 3000
|
||||
},
|
||||
"unban": {
|
||||
"kind": "unban",
|
||||
"title": "1-Day Unban",
|
||||
"description": "Removes 1 day from the ban duration of the recipient.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-success",
|
||||
"price": 3500
|
||||
},
|
||||
"shit": {
|
||||
"kind": "shit",
|
||||
|
|
|
@ -31,7 +31,15 @@ if site_name == "Drama":
|
|||
"description": "Bans the author for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
"price": 5000
|
||||
"price": 3000
|
||||
},
|
||||
"unban": {
|
||||
"kind": "unban",
|
||||
"title": "1-Day Unban",
|
||||
"description": "Removes 1 day from the ban duration of the recipient.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-success",
|
||||
"price": 3500
|
||||
},
|
||||
"shit": {
|
||||
"kind": "shit",
|
||||
|
|
|
@ -19,7 +19,15 @@ def shop(v):
|
|||
"description": "Bans the author for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
"price": 5000
|
||||
"price": 3000
|
||||
},
|
||||
"unban": {
|
||||
"kind": "unban",
|
||||
"title": "1-Day Unban",
|
||||
"description": "Removes 1 day from the ban duration of the recipient.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-success",
|
||||
"price": 3500
|
||||
},
|
||||
"shit": {
|
||||
"kind": "shit",
|
||||
|
@ -136,7 +144,15 @@ def buy(v, award):
|
|||
"description": "Bans the author for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
"price": 5000
|
||||
"price": 3000
|
||||
},
|
||||
"unban": {
|
||||
"kind": "unban",
|
||||
"title": "1-Day Unban",
|
||||
"description": "Removes 1 day from the ban duration of the recipient.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-success",
|
||||
"price": 3500
|
||||
},
|
||||
"shit": {
|
||||
"kind": "shit",
|
||||
|
@ -296,13 +312,23 @@ def award_post(pid, v):
|
|||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
||||
elif author.unban_utc > 0:
|
||||
author.unban_utc += 24*60*60
|
||||
g.db.add(author)
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for yet another day for {link}. Seriously man?")
|
||||
elif kind == "unban":
|
||||
author = post.author
|
||||
if not author.is_suspended or not author.unban_utc or time.time() > author.unban_utc: abort(403)
|
||||
|
||||
if author.unban_utc - time.time() > 86400:
|
||||
author.unban_utc -= 86400
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your ban duration has been reduced by 1 day!")
|
||||
else:
|
||||
author.unban_utc = 0
|
||||
author.is_banned = 0
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"You have been unbanned!")
|
||||
|
||||
elif kind == "grass":
|
||||
author = post.author
|
||||
author.is_banned = AUTOJANNY_ACCOUNT
|
||||
author.ban_reason = f"grass award used by @{v.username} on /post/{post.id}"
|
||||
g.db.add(author)
|
||||
link = f"[this post]({post.permalink})"
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
|
||||
elif kind == "pin":
|
||||
|
@ -376,13 +402,22 @@ def award_comment(cid, v):
|
|||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
|
||||
elif author.unban_utc > 0:
|
||||
author.unban_utc += 24*60*60
|
||||
g.db.add(author)
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for yet another day for {link}. Seriously man?")
|
||||
elif kind == "unban":
|
||||
author = c.author
|
||||
if not author.is_suspended or not author.unban_utc or time.time() > author.unban_utc: abort(403)
|
||||
|
||||
if author.unban_utc - time.time() > 86400:
|
||||
author.unban_utc -= 86400
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your ban duration has been reduced by 1 day!")
|
||||
else:
|
||||
author.unban_utc = 0
|
||||
author.is_banned = 0
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"You have been unbanned!")
|
||||
elif kind == "grass":
|
||||
author = c.author
|
||||
author.is_banned = AUTOJANNY_ACCOUNT
|
||||
author.ban_reason = f"grass award used by @{v.username} on /comment/{c.id}"
|
||||
g.db.add(author)
|
||||
link = f"[this comment]({c.permalink})"
|
||||
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
@media (min-width: 767.98px) {
|
||||
.award-columns {
|
||||
column-count: 6 !important;
|
||||
column-count: 7 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -97,6 +97,10 @@
|
|||
<a class="nav-link" href="/leaderboard" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Users"><i class="fas fa-trophy"></i></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
||||
<a class="nav-link" href="/settings/shop" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Shop"><i class="fas fa-store"></i></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item d-flex align-items-center justify-content-center text-center">
|
||||
<div class="dropdown">
|
||||
<a class="nav-link bg-transparent py-0 pr-0" href="{{v.url}}" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown"
|
||||
|
|
|
@ -58,8 +58,8 @@
|
|||
<button type="button" class="col px-0 mr-3 btn btn-dead m-0" style="background: None !important; border: None;">
|
||||
<a href="{{v.url}}" class="text-decoration-none" role="button">
|
||||
<div class="text-center {% if request.path==v.url %}text-primary{% else %}text-muted{% endif %}">
|
||||
<i class="fas fa-user-circle text-lg"></i>
|
||||
<div class="text-small">Profile</div>
|
||||
<i class="fas fa-store text-lg"></i>
|
||||
<div class="text-small">Shop</div>
|
||||
</div>
|
||||
</a>
|
||||
</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue