train award
This commit is contained in:
parent
35c6576196
commit
21e77d2a61
16 changed files with 154 additions and 56 deletions
|
@ -12159,12 +12159,6 @@ a.bg-dark:hover, a.bg-dark:focus, button.bg-dark:hover, button.bg-dark:focus {
|
|||
border-top-right-radius: 0.35rem;
|
||||
}
|
||||
|
||||
#frontpage .posts .card:nth-last-of-type(2), #userpage .posts .card:nth-last-of-type(2), #search .posts .card:nth-last-of-type(2) {
|
||||
border-bottom-left-radius: 0.35rem;
|
||||
border-bottom-right-radius: 0.35rem;
|
||||
border-bottom: 0.1px solid var(--gray-400);
|
||||
}
|
||||
|
||||
#frontpage .posts .card, #userpage .posts .card, #search .posts .card {
|
||||
border-width: 0.1px 0.1px 0 0.1px;
|
||||
border-color: #303030;
|
||||
|
@ -14642,3 +14636,15 @@ blockquote p {
|
|||
padding: 10px !important;
|
||||
border: 2px solid var(--primary) !important;
|
||||
}
|
||||
|
||||
@media (min-width: 576px)
|
||||
{
|
||||
.modal-dialog {
|
||||
max-width: 65% !important;
|
||||
margin: 1.75rem auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
.text-pink {
|
||||
color: #ff66ac !important;
|
||||
}
|
|
@ -10,7 +10,7 @@ if site_name == "Drama":
|
|||
AWARDS = {
|
||||
"ban": {
|
||||
"kind": "ban",
|
||||
"title": "One-Day Ban",
|
||||
"title": "1-Day Ban",
|
||||
"description": "Bans the author for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
|
@ -39,7 +39,15 @@ if site_name == "Drama":
|
|||
"icon": "fas fa-seedling",
|
||||
"color": "text-success",
|
||||
"price": 10000
|
||||
}
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
},
|
||||
}
|
||||
else:
|
||||
AWARDS = {
|
||||
|
@ -58,6 +66,14 @@ else:
|
|||
"icon": "fas fa-sparkles",
|
||||
"color": "text-warning",
|
||||
"price": 500
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ if site_name == "Drama":
|
|||
AWARDS = {
|
||||
"ban": {
|
||||
"kind": "ban",
|
||||
"title": "One-Day Ban",
|
||||
"title": "1-Day Ban",
|
||||
"description": "Bans the author for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
|
@ -56,6 +56,14 @@ if site_name == "Drama":
|
|||
"icon": "fas fa-seedling",
|
||||
"color": "text-success",
|
||||
"price": 10000
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
}
|
||||
}
|
||||
else:
|
||||
|
@ -75,6 +83,14 @@ else:
|
|||
"icon": "fas fa-sparkles",
|
||||
"color": "text-warning",
|
||||
"price": 500
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ def shop(v):
|
|||
AWARDS = {
|
||||
"ban": {
|
||||
"kind": "ban",
|
||||
"title": "One-Day Ban",
|
||||
"title": "1-Day Ban",
|
||||
"description": "Bans the author for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
|
@ -43,6 +43,14 @@ def shop(v):
|
|||
"icon": "fas fa-seedling",
|
||||
"color": "text-success",
|
||||
"price": 10000
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
}
|
||||
}
|
||||
else:
|
||||
|
@ -62,6 +70,14 @@ def shop(v):
|
|||
"icon": "fas fa-sparkles",
|
||||
"color": "text-warning",
|
||||
"price": 500
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,7 +115,7 @@ def buy(v, award):
|
|||
AWARDS = {
|
||||
"ban": {
|
||||
"kind": "ban",
|
||||
"title": "One-Day Ban",
|
||||
"title": "1-Day Ban",
|
||||
"description": "Bans the author for a day.",
|
||||
"icon": "fas fa-gavel",
|
||||
"color": "text-danger",
|
||||
|
@ -128,6 +144,14 @@ def buy(v, award):
|
|||
"icon": "fas fa-seedling",
|
||||
"color": "text-success",
|
||||
"price": 10000
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
}
|
||||
}
|
||||
else:
|
||||
|
@ -147,6 +171,14 @@ def buy(v, award):
|
|||
"icon": "fas fa-sparkles",
|
||||
"color": "text-warning",
|
||||
"price": 500
|
||||
},
|
||||
"train": {
|
||||
"kind": "train",
|
||||
"title": "Train",
|
||||
"description": "Summons a train on the post.",
|
||||
"icon": "fas fa-train",
|
||||
"color": "text-pink",
|
||||
"price": 500
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,13 +207,6 @@ def buy(v, award):
|
|||
return {"message": "Award bought!"}
|
||||
|
||||
|
||||
ALLOW_MULTIPLE = (
|
||||
"ban",
|
||||
"shit",
|
||||
"fireflies",
|
||||
"grass"
|
||||
)
|
||||
|
||||
@app.post("/post/<pid>/awards")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
|
@ -222,9 +247,6 @@ def award_post(pid, v):
|
|||
)
|
||||
).first()
|
||||
|
||||
if existing_award and kind not in ALLOW_MULTIPLE:
|
||||
return {"error": "You can't give that award multiple times to the same post."}, 409
|
||||
|
||||
post_award.submission_id = post.id
|
||||
g.db.add(post_award)
|
||||
|
||||
|
@ -240,7 +262,7 @@ def award_post(pid, v):
|
|||
link = f"[this post]({post.permalink})"
|
||||
|
||||
if not author.is_suspended:
|
||||
author.ban(reason=f"one-day ban award used by @{v.username} on /post/{post.id}", days=1)
|
||||
author.ban(reason=f"1-Day ban award used by @{v.username} on /post/{post.id}", days=1)
|
||||
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
|
||||
|
@ -302,9 +324,6 @@ def award_comment(cid, v):
|
|||
)
|
||||
).first()
|
||||
|
||||
if existing_award and kind not in ALLOW_MULTIPLE:
|
||||
return {"error": "You can't give that award multiple times to the same comment."}, 409
|
||||
|
||||
comment_award.comment_id = c.id
|
||||
g.db.add(comment_award)
|
||||
|
||||
|
@ -321,7 +340,7 @@ def award_comment(cid, v):
|
|||
link = f"[this comment]({c.permalink})"
|
||||
|
||||
if not author.is_suspended:
|
||||
author.ban(reason=f"one-day ban award used by @{v.username} on /comment/{c.id}", days=1)
|
||||
author.ban(reason=f"1-Day ban award used by @{v.username} on /comment/{c.id}", days=1)
|
||||
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
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=80">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=80">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=82">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=82">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=82">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.awards-wrapper a:hover, .picked {
|
||||
.awards-wrapper a:hover, .awards-wrapper .picked {
|
||||
background-color: var(--primary)!important;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@
|
|||
|
||||
@media (min-width: 767.98px) {
|
||||
.award-columns {
|
||||
column-count: 4 !important;
|
||||
column-count: 5 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -250,12 +250,12 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=80">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=80">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=82">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=82">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=82">
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -6,13 +6,6 @@
|
|||
font-size: 13px !important;
|
||||
}
|
||||
|
||||
@media (min-width: 576px)
|
||||
{
|
||||
.modal-dialog {
|
||||
max-width: 65% !important;
|
||||
margin: 1.75rem auto !important;
|
||||
}
|
||||
}
|
||||
.emoji2:focus {
|
||||
border: 1px solid var(--primary) !important;
|
||||
}
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=80">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=80">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=82">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=82">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=82">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=82">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -55,8 +55,8 @@
|
|||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=80">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=80">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=82">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=82">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
|
||||
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
|
||||
</head>
|
||||
|
|
|
@ -40,10 +40,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=82">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=82">
|
||||
{% endif %}
|
||||
|
||||
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=82">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=82">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -13,6 +13,54 @@
|
|||
|
||||
{% block title %}
|
||||
|
||||
{% if p.award_count("train") %}
|
||||
<style>
|
||||
@keyframes train {
|
||||
0% {
|
||||
left: -10%;
|
||||
}
|
||||
100% {
|
||||
left: 110%;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes trainrev {
|
||||
0% {
|
||||
left: 110%;
|
||||
}
|
||||
100% {
|
||||
left: -10%;
|
||||
}
|
||||
}
|
||||
|
||||
.train {
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
z-index: 10;
|
||||
animation: train 5s linear infinite !important;
|
||||
}
|
||||
|
||||
.trainrev {
|
||||
animation: trainrev 5s linear infinite !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<img class="train" style="top:10%" src="/assets/images/emojis/marseytrain.webp">
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("train") > 1 %}
|
||||
<img class="train trainrev mirrored" style="top:35%" src="/assets/images/emojis/marseytrain.webp">
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("train") > 2 %}
|
||||
<img class="train" style="top:60%" src="/assets/images/emojis/marseytrain.webp">
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("train") > 3 %}
|
||||
<img class="train trainrev mirrored" style="top:85%" src="/assets/images/emojis/marseytrain.webp">
|
||||
{% endif %}
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
|
||||
<script src="/assets/js/new_comments_count.js?v=53"></script>
|
||||
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=80">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=80">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=82">
|
||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=82">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=80">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=82">
|
||||
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=82">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue