From d0cfd8a8c125f9974a434ffdda0baf2e95af06f7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 6 Sep 2022 06:16:41 +0200 Subject: [PATCH] change house femboy award --- files/assets/css/main.css | 11 +++++----- files/classes/user.py | 1 + files/helpers/const.py | 28 ++++++++++++++++--------- files/routes/awards.py | 25 ++++++++++++---------- files/templates/comments.html | 2 +- files/templates/submission.html | 4 ++-- files/templates/submission_listing.html | 4 ++-- files/templates/util/assetcache.html | 2 +- 8 files changed, 45 insertions(+), 32 deletions(-) diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 99e5a9dd3..406ff57d1 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -6060,6 +6060,7 @@ g { .fa-star-of-david:before{content:"\f69a"} .fa-kiss-wink-heart:before{content:"\f598"} .fa-hat-cowboy:before{content:"\f8c0"} +.fa-cloud-rainbow:before{content:"\f73e"} .pronouns { font-size: 9px; @@ -6183,11 +6184,11 @@ g { } .rainbow-text { - background-image: linear-gradient(to left, violet, indigo, blue, green, yellow, orange, red); - color: transparent; - background-clip: text; - -webkit-background-clip: text; - font-weight: 700; + background-image: repeating-linear-gradient(to left, violet, rgb(178, 94, 238), lightblue, green, yellow, orange, #ff7f7f 50%) !important; + color: transparent !important; + background-clip: text !important; + -webkit-background-clip: text !important; + font-weight: 700 !important; } .btn-rainbow { diff --git a/files/classes/user.py b/files/classes/user.py index a729d73e6..ff445b94b 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -139,6 +139,7 @@ class User(Base): earlylife = Column(Integer) owoify = Column(Integer) marsify = Column(Integer, default=0) + rainbow = Column(Integer) badges = relationship("Badge", order_by="Badge.created_utc", back_populates="user") subscriptions = relationship("Subscription", back_populates="user") diff --git a/files/helpers/const.py b/files/helpers/const.py index 3b3170a21..9f76a3e38 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -440,6 +440,14 @@ AWARDS = { "color": "text-gray", "price": 200 }, + "marsify": { + "kind": "marsify", + "title": "Marsify", + "description": "Marsifies the recipient's comments for 6 hours.", + "icon": "fas fa-cat", + "color": "text-white", + "price": 400 + }, "shit": { "kind": "shit", "title": "Shit", @@ -724,12 +732,12 @@ if SITE_NAME != 'rDrama': "color": "text-purple", "price": 400 }, - "marsify": { - "kind": "marsify", - "title": "Marsify", - "description": "Marsifies the recipient's comments for 6 hours.", - "icon": "fas fa-cat", - "color": "text-white", + "rainbow": { + "kind": "rainbow", + "title": "Rainbow", + "description": "Makes the recipient's comments and posts in rainbow text for 24 hours.", + "icon": "fas fa-cloud-rainbow", + "color": "text-pink", "price": 400 }, } @@ -783,10 +791,10 @@ HOUSE_AWARDS = { }, "Femboy": { "kind": "Femboy", - "title": "Marsify", - "description": "Marsifies the recipient's comments for 6 hours.", - "icon": "fas fa-cat", - "color": "text-white", + "title": "Rainbow", + "description": "Makes the recipient's comments and posts in rainbow text for 24 hours.", + "icon": "fas fa-cloud-rainbow", + "color": "text-pink", "price": 400 }, "Vampire": { diff --git a/files/routes/awards.py b/files/routes/awards.py index 1432ab15d..51a7f1884 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -167,7 +167,7 @@ def award_thing(v, thing_type, id): if kind == "benefactor" and author.id == v.id: return {"error": "You can't use this award on yourself."}, 400 - if (kind.startswith('Femboy') or kind == 'marsify') and author.marsify == 1: + if kind == 'marsify' and author.marsify == 1: return {"error": "User is already permenantly marsified!"}, 403 if v.id != author.id: @@ -344,6 +344,16 @@ def award_thing(v, thing_type, id): elif kind == "checkmark": author.verified = "Verified" badge_grant(user=author, badge_id=150) + elif kind == 'marsify': + if author.marsify: author.marsify += 21600 + else: author.marsify = int(time.time()) + 21600 + + if thing_type == 'comment' and not author.deflector: + body = thing.body + if author.owoify: body = owoify(body) + body = marsify(body) + thing.body_html = sanitize(body, limit_pings=5, marsified=True) + g.db.add(thing) elif "Vampire" in kind and kind == v.house: if author.bite: author.bite += 86400 else: author.bite = int(time.time()) + 86400 @@ -362,16 +372,9 @@ def award_thing(v, thing_type, id): if author.marsify: body = marsify(body) thing.body_html = sanitize(body, limit_pings=5, marsified=True) g.db.add(thing) - elif ("Femboy" in kind and kind == v.house) or kind == 'marsify': - if author.marsify: author.marsify += 21600 - else: author.marsify = int(time.time()) + 21600 - - if thing_type == 'comment' and not author.deflector: - body = thing.body - if author.owoify: body = owoify(body) - body = marsify(body) - thing.body_html = sanitize(body, limit_pings=5, marsified=True) - g.db.add(thing) + elif ("Femboy" in kind and kind == v.house): + if author.rainbow: author.rainbow += 86400 + else: author.rainbow = int(time.time()) + 86400 if author.received_award_count: author.received_award_count += 1 else: author.received_award_count = 1 diff --git a/files/templates/comments.html b/files/templates/comments.html index 2cf895869..28dac027e 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -255,7 +255,7 @@ {% endif %} -
+
{{c.realbody(v) | safe}}
{% if c.parent_submission %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 5413a195f..678c42146 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -709,14 +709,14 @@
{% endif %} {% if p.realurl(v) and not v_forbid_deleted %} -

+

{% if p.club %}{{CC}}{% endif %} {% if p.category %}{{help.submission_category_tag(p.category.name, p.category.color_text, p.category.color_bg)}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} {{p.realtitle(v) | safe}}

{% else %} -

+

{% if p.club %}{{CC}}{% endif %} {% if p.category %}{{help.submission_category_tag(p.category.name, p.category.color_text, p.category.color_bg)}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index bce842ddc..1e5fbd7cb 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -194,7 +194,7 @@

- + {% if p.club %}{{CC}}{% endif %} {% if p.category %}{{help.submission_category_tag(p.category.name, p.category.color_text, p.category.color_bg)}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} @@ -318,7 +318,7 @@ {% if (not p.club or v and (v.paid_dues or v.id == p.author_id)) and not v_forbid_deleted %} {% if p.realbody(v, True) %} -
+
{{p.realbody(v, True) | safe}}
{% endif %} diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index c59c318ab..7e37831a4 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -1,6 +1,6 @@ {%- set CACHE_VER = { - 'css/main.css': 4004, + 'css/main.css': 4005, 'css/catalog.css': 4000, 'css/4chan.css': 4000, 'css/classic.css': 4000,