diff --git a/files/classes/award.py b/files/classes/award.py index 580a9c8b0..9c7910793 100755 --- a/files/classes/award.py +++ b/files/classes/award.py @@ -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 } } diff --git a/files/classes/user.py b/files/classes/user.py index ed1dbd6e8..8f24727f7 100755 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -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 } } diff --git a/files/routes/awards.py b/files/routes/awards.py index 0aca31849..bca9994e3 100755 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -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//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 diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 410016c17..55ecc40e7 100755 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,11 +15,11 @@ {% if v %} - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index d317d8c93..4c5e9f0e7 100755 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -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; } } \ No newline at end of file diff --git a/files/templates/default.html b/files/templates/default.html index b6c9a8f3c..11632cb9f 100755 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -250,12 +250,12 @@ {% if v %} - - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index a31b000d9..9472ab467 100755 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -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; } diff --git a/files/templates/log.html b/files/templates/log.html index 6259fd192..7fd62d4f3 100755 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -17,11 +17,11 @@ {% if v %} - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 1e363c6c0..041faf28f 100755 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -12,7 +12,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index bdbe688e7..56d369ad3 100755 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -55,8 +55,8 @@ - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index c327d5ac0..f37782ad0 100755 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -40,10 +40,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index a09fe6856..63405bcf7 100755 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -36,7 +36,7 @@ - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index d5fc3f6af..a2c2cd1ea 100755 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ - + diff --git a/files/templates/submission.html b/files/templates/submission.html index 21971edeb..86019dfb9 100755 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -13,6 +13,54 @@ {% block title %} +{% if p.award_count("train") %} + + + +{% endif %} + +{% if p.award_count("train") > 1 %} + +{% endif %} + +{% if p.award_count("train") > 2 %} + +{% endif %} + +{% if p.award_count("train") > 3 %} + +{% endif %} + + diff --git a/files/templates/submit.html b/files/templates/submit.html index 244ba3417..b9a6e39b7 100755 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -25,12 +25,12 @@ {% block stylesheets %} {% if v %} - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - - + + {% endif %} {% endblock %}