diff --git a/files/classes/user.py b/files/classes/user.py index 861c1e97d9..10f3d2157d 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -81,6 +81,7 @@ class User(Base): nitter = Column(Boolean) mute = Column(Boolean) unmutable = Column(Boolean) + eye = Column(Boolean) frontsize = Column(Integer, default=25) controversial = Column(Boolean, default=False) bio = deferred(Column(String)) diff --git a/files/helpers/const.py b/files/helpers/const.py index 972c23d761..80ff68edf4 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -314,6 +314,14 @@ AWARDS = { "color": "text-orange", "price": 1000 }, + "eye": { + "kind": "eye", + "title": "All-Seeing Eye", + "description": "Gives the recipient the ability to view private profiles.", + "icon": "fas fa-eye", + "color": "text-silver", + "price": 10000 + }, } AWARDS2 = { @@ -405,6 +413,14 @@ AWARDS2 = { "color": "text-success", "price": 10000 }, + "eye": { + "kind": "eye", + "title": "All-Seeing Eye", + "description": "Gives the recipient the ability to view private profiles.", + "icon": "fas fa-eye", + "color": "text-silver", + "price": 10000 + }, "pause": { "kind": "pause", "title": "Pause", diff --git a/files/routes/awards.py b/files/routes/awards.py index d8a8d8d00f..c466f20a04 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -55,7 +55,8 @@ def shop(v): "icon": "fas fa-poop", "color": "text-black-50", "owned": 0, - "price": 500 + "price": 500, + "MB": True }, "fireflies": { "kind": "fireflies", @@ -64,7 +65,8 @@ def shop(v): "icon": "fas fa-sparkles", "color": "text-warning", "owned": 0, - "price": 500 + "price": 500, + "MB": True }, "train": { "kind": "train", @@ -73,7 +75,8 @@ def shop(v): "icon": "fas fa-train", "color": "text-pink", "owned": 0, - "price": 500 + "price": 500, + "MB": True }, "pin": { "kind": "pin", @@ -82,7 +85,8 @@ def shop(v): "icon": "fas fa-thumbtack fa-rotate--45", "color": "text-warning", "owned": 0, - "price": 750 + "price": 750, + "MB": True }, "unpin": { "kind": "unpin", @@ -91,7 +95,8 @@ def shop(v): "icon": "fas fa-thumbtack fa-rotate--45", "color": "text-black", "owned": 0, - "price": 1000 + "price": 1000, + "MB": True }, "flairlock": { "kind": "flairlock", @@ -100,7 +105,8 @@ def shop(v): "icon": "fas fa-lock", "color": "text-black", "owned": 0, - "price": 1250 + "price": 1250, + "MB": True }, "agendaposter": { "kind": "agendaposter", @@ -109,7 +115,8 @@ def shop(v): "icon": "fas fa-snooze", "color": "text-purple", "owned": 0, - "price": 2500 + "price": 2500, + "MB": True }, "marsey": { "kind": "marsey", @@ -118,7 +125,8 @@ def shop(v): "icon": "fas fa-cat", "color": "text-orange", "owned": 0, - "price": 3000 + "price": 3000, + "MB": True }, "ban": { "kind": "ban", @@ -127,7 +135,8 @@ def shop(v): "icon": "fas fa-gavel", "color": "text-danger", "owned": 0, - "price": 3000 + "price": 3000, + "MB": True }, "unban": { "kind": "unban", @@ -136,7 +145,8 @@ def shop(v): "icon": "fas fa-gavel", "color": "text-success", "owned": 0, - "price": 3500 + "price": 3500, + "MB": True }, "grass": { "kind": "grass", @@ -145,7 +155,18 @@ def shop(v): "icon": "fas fa-seedling", "color": "text-success", "owned": 0, - "price": 10000 + "price": 10000, + "MB": True + }, + "eye": { + "kind": "eye", + "title": "All-Seeing Eye", + "description": "Gives the recipient the ability to view private profiles.", + "icon": "fas fa-eye", + "color": "text-silver", + "owned": 0, + "price": 10000, + "MB": True }, "pause": { "kind": "pause", @@ -154,7 +175,8 @@ def shop(v): "icon": "fas fa-volume-mute", "color": "text-danger", "owned": 0, - "price": 20000 + "price": 20000, + "MB": True }, "unpausable": { "kind": "unpausable", @@ -163,7 +185,8 @@ def shop(v): "icon": "fas fa-volume", "color": "text-success", "owned": 0, - "price": 40000 + "price": 40000, + "MB": True }, } @@ -279,6 +302,14 @@ def buy(v, award): "color": "text-success", "price": 10000 }, + "eye": { + "kind": "eye", + "title": "All-Seeing Eye", + "description": "Gives the recipient the ability to view private profiles.", + "icon": "fas fa-eye", + "color": "text-silver", + "price": 10000 + }, "pause": { "kind": "pause", "title": "Pause", @@ -468,6 +499,11 @@ def award_post(pid, v): send_notification(995, f"@{v.username} bought {kind} award!") new_badge = Badge(badge_id=67, user_id=author.id) g.db.add(new_badge) + elif kind == "eye": + author.eye = True + send_notification(995, f"@{v.username} bought {kind} award!") + new_badge = Badge(badge_id=83, user_id=author.id) + g.db.add(new_badge) elif kind == "marsey": author.marseyawarded = time.time() + 86400 @@ -755,6 +791,15 @@ def items(v): "owned": 0, "price": 10000 }, + "eye": { + "kind": "eye", + "title": "All-Seeing Eye", + "description": "Gives the recipient the ability to view private profiles.", + "icon": "fas fa-eye", + "color": "text-silver", + "owned": 0, + "price": 10000 + }, "pause": { "kind": "pause", "title": "Pause", diff --git a/files/routes/users.py b/files/routes/users.py index 942c3bdb5f..fb6a4fb3a8 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -512,7 +512,7 @@ def u_username(username, v=None): g.db.commit() - if u.is_private and (not v or (v.id != u.id and v.admin_level < 3)): + if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): if v and u.id == LLM_ID: if int(time.time()) - v.rent_utc > 600: @@ -523,12 +523,12 @@ def u_username(username, v=None): else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v) - if hasattr(u, 'is_blocking') and u.is_blocking and (not v or v.admin_level < 3): + if hasattr(u, 'is_blocking') and u.is_blocking and (not v or v.admin_level < 2): if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."} else: return render_template("userpage_blocking.html", u=u, v=v) - if hasattr(u, 'is_blocked') and u.is_blocked and (not v or v.admin_level < 3): + if hasattr(u, 'is_blocked') and u.is_blocked and (not v or v.admin_level < 2): if request.headers.get("Authorization"): return {"error": "This person is blocking you."} else: return render_template("userpage_blocked.html", u=u, v=v) @@ -605,7 +605,7 @@ def u_username_comments(username, v=None): v=v) - if u.is_private and (not v or (v.id != u.id and v.admin_level < 3)): + if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): if v and u.id == LLM_ID: if int(time.time()) - v.rent_utc > 600: if request.headers.get("Authorization"): return {"error": "That userpage is private"} @@ -614,13 +614,13 @@ def u_username_comments(username, v=None): if request.headers.get("Authorization"): return {"error": "That userpage is private"} else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v) - if hasattr(u, 'is_blocking') and u.is_blocking and (not v or v.admin_level < 3): + if hasattr(u, 'is_blocking') and u.is_blocking and (not v or v.admin_level < 2): if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."} else: return render_template("userpage_blocking.html", u=u, v=v) - if hasattr(u, 'is_blocked') and u.is_blocked and (not v or v.admin_level < 3): + if hasattr(u, 'is_blocked') and u.is_blocked and (not v or v.admin_level < 2): if request.headers.get("Authorization"): return {"error": "This person is blocking you."} else: return render_template("userpage_blocked.html", u=u, diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 325124362b..536eb901e4 100644 --- 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 b90ef5a025..19bba7e52f 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -23,11 +23,6 @@
{{award.owned}} owned
{% endfor %} - - -
 
-
 
-
diff --git a/files/templates/default.html b/files/templates/default.html index 119ea04f1f..977b29f0e2 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -254,12 +254,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/log.html b/files/templates/log.html index 258ac7f8fe..0f1985c6b5 100644 --- 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 8f0cfcfa8a..0f55671961 100644 --- 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 0411af33b6..726c52fec8 100644 --- 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 a746d43d92..3aad6cc773 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -40,10 +40,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/shop.html b/files/templates/shop.html index ea6ed7cee3..34b21f03ab 100644 --- a/files/templates/shop.html +++ b/files/templates/shop.html @@ -64,7 +64,7 @@ {% set kind = a['kind'] %} Buy - {% if v.procoins and kind not in ["grass","pause","unpausable"] %}Buy with Marseybux{% endif %} + {% if v.procoins and a['MB'] %}Buy with Marseybux{% endif %} {% endfor %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 00e5e03f02..41fb149a17 100644 --- 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 d08215e3f9..d5da208bf2 100644 --- 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/submit.html b/files/templates/submit.html index b840ac6b24..36c0d7f508 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -31,12 +31,12 @@ {% block stylesheets %} {% if v %} - - {% if v.agendaposter %}{% elif v.css %}{% endif %} + + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - - + + {% endif %} {% endblock %}