Merge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
Aevann1 2022-05-30 13:07:35 +02:00
commit ddc4fe756e
29 changed files with 187 additions and 116 deletions

View File

@ -99,13 +99,8 @@ def before_request():
if not app.config['SETTINGS']['Bots'] and request.headers.get("Authorization"): abort(503)
g.db = db_session()
if '; wv) ' in ua: g.webview = True
else: g.webview = False
if 'iphone' in ua or 'ipad' in ua or 'ipod' in ua or 'mac os' in ua or ' firefox/' in ua: g.inferior_browser = True
else: g.inferior_browser = False
g.webview = '; wv) ' in ua
g.inferior_browser = 'iphone' in ua or 'ipad' in ua or 'ipod' in ua or 'mac os' in ua or ' firefox/' in ua
@app.teardown_appcontext
def teardown_request(error):
@ -125,4 +120,4 @@ if app.config["SERVER_NAME"] == 'localhost':
elif "load_chat" in argv:
from files.routes.chat import *
else:
from files.routes import *
from files.routes import *

View File

@ -127,6 +127,7 @@ class User(Base):
original_username = deferred(Column(String))
referred_by = Column(Integer, ForeignKey("users.id"))
subs_created = Column(Integer, default=0)
can_gamble = Column(Boolean, default=True)
currently_held_lottery_tickets = Column(Integer, default=0)
total_held_lottery_tickets = Column(Integer, default=0)
total_lottery_winnings = Column(Integer, default=0)

View File

@ -51,6 +51,9 @@ def format_all(player_hand, dealer_hand, deck, status, wager, kind, is_insured=0
def check_for_blackjack_commands(in_text, from_user, from_comment):
if not from_user.can_gamble:
return
for command_word in (coins_command_word, marseybux_command_word):
currency_prop = "coins" if command_word == coins_command_word else "procoins"
currency_value = getattr(from_user, currency_prop, 0)

View File

@ -49,7 +49,9 @@ def end_lottery_session():
active_lottery.is_active = False
manager = g.db.query(User).get(LOTTERY_MANAGER_ACCOUNT_ID)
manager.coins -= active_lottery.prize
if manager:
manager.coins -= active_lottery.prize
g.db.commit()
@ -88,7 +90,9 @@ def purchase_lottery_ticket(v):
grant_lottery_proceeds_to_manager(net_ticket_value)
beneficiary = g.db.query(User).get(LOTTERY_ROYALTY_ACCOUNT_ID)
beneficiary.coins += LOTTERY_ROYALTY_RATE
if beneficiary:
beneficiary.coins += LOTTERY_ROYALTY_RATE
g.db.commit()
@ -96,7 +100,9 @@ def purchase_lottery_ticket(v):
def grant_lottery_proceeds_to_manager(amount):
manager = g.db.query(User).get(LOTTERY_MANAGER_ACCOUNT_ID)
manager.coins += amount
if manager:
manager.coins += amount
def grant_lottery_tickets_to_user(v, amount):
active_lottery = get_active_lottery()

View File

@ -247,7 +247,7 @@ def sanitize(sanitized, alert=False, comment=False, edit=False):
for rd in ["://reddit.com", "://new.reddit.com", "://www.reddit.com", "://redd.it", "://libredd.it", "://teddit.net"]:
sanitized = sanitized.replace(rd, "://old.reddit.com")
sanitized = sanitized.replace("nitter.net", "twitter.com").replace("old.reddit.com/gallery", "reddit.com/gallery").replace("https://youtu.be/", "https://youtube.com/watch?v=").replace("https://music.youtube.com/watch?v=", "https://youtube.com/watch?v=").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/watch?v=").replace("https://mobile.twitter", "https://twitter").replace("https://m.facebook", "https://facebook").replace("m.wikipedia.org", "wikipedia.org").replace("https://m.youtube", "https://youtube").replace("https://www.youtube", "https://youtube").replace("https://www.twitter", "https://twitter").replace("https://www.instagram", "https://instagram").replace("https://www.tiktok", "https://tiktok")
sanitized = sanitize_url(sanitized)
sanitized = sanitized.replace('&','&')
@ -377,7 +377,8 @@ def filter_emojis_only(title, edit=False, graceful=False):
if len(title) > 1500 and not graceful: abort(400)
else: return title
def normalize_url(url):
def sanitize_url(url):
# NB: Used in this file to sanitize all URLs in bulk text.
url = url.replace("nitter.net", "twitter.com") \
.replace("old.reddit.com/gallery", "reddit.com/gallery") \
.replace("https://youtu.be/", "https://youtube.com/watch?v=") \
@ -392,6 +393,11 @@ def normalize_url(url):
.replace("https://www.instagram", "https://instagram") \
.replace("https://www.tiktok", "https://tiktok")
return url
def normalize_url(url):
url = sanitize_url(url)
if "/i.imgur.com/" in url:
url = url.replace(".png", ".webp").replace(".jpg", ".webp").replace(".jpeg", ".webp")
elif "/media.giphy.com/" in url or "/c.tenor.com/" in url:

View File

@ -19,6 +19,9 @@ def shuffle(stuff):
return stuff
def check_for_slots_command(in_text, from_user, from_comment):
if not from_user.can_gamble:
return
in_text = in_text.lower()
if command_word in in_text:
for word in in_text.split():

View File

@ -10,6 +10,11 @@ standard_max = 100
lotterizer_rate = 33
def check_for_treasure(in_text, from_comment):
user = from_comment.author
if not user.can_gamble:
return
if '!slots' not in in_text and '!blackjack' not in in_text and '!wordle' not in in_text:
seed = randint(1, 1000)
is_special = seed == 1000
@ -21,14 +26,11 @@ def check_for_treasure(in_text, from_comment):
elif is_standard:
amount = randint(standard_min, standard_max)
if randint(1, 100) > 90:
user = from_comment.author
if amount > user.coins: amount = user.coins
amount = -amount
if amount != 0:
user = from_comment.author
if amount > 0:
active_lottery = get_active_lottery()
lottery_tickets_seed = randint(1, 100)

View File

@ -144,6 +144,7 @@ def lottery_required(f):
v = get_logged_in_user()
if not LOTTERY_ENABLED: abort(404)
if v and not v.can_gamble: abort(403)
return make_response(f(v=v))

View File

@ -33,23 +33,29 @@ def feeds_user(sort='hot', t='all'):
with tag("title", type="text"):
text(f"{sort} posts from {domain}")
doc.stag("link", href=SITE_FULL + request.full_path)
doc.stag("link", href=SITE_FULL)
with tag("id"):
text(SITE_FULL + request.full_path)
with tag("updated"):
text(datetime.now().isoformat()+"Z")
doc.stag("link", rel="self", type="application/atom+xml", href=SITE_FULL + request.full_path)
doc.stag("link", rel="alternate", type="text/html", href=SITE_FULL)
for post in posts:
with tag("entry", ("xml:base", SITE_FULL + request.full_path)):
with tag("title", type="text"):
with tag("title", type="html"):
text(post.realtitle(None))
with tag("id"):
text(post.fullname)
text(post.permalink)
if (post.edited_utc):
with tag("updated"):
text(datetime.utcfromtimestamp(post.edited_utc).isoformat())
text(datetime.utcfromtimestamp(post.edited_utc).isoformat()+"Z")
else:
text(datetime.utcfromtimestamp(post.created_utc).isoformat()+"Z")
with tag("published"):
text(datetime.utcfromtimestamp(post.created_utc).isoformat())
text(datetime.utcfromtimestamp(post.created_utc).isoformat()+"Z")
with tag("author"):
with tag("name"):
@ -65,6 +71,6 @@ def feeds_user(sort='hot', t='all'):
if len(post.body_html):
with tag("content", type="html"):
doc.cdata(f'''<img alt="{post.realtitle(None)}" loading="lazy" src={image_url}><br>{post.realbody(None)}''')
doc.cdata(f'''<img alt="{post.realtitle(None)}" loading="lazy" src="{image_url}"><br>{post.realbody(None)}''')
return Response( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+ doc.getvalue(), mimetype="application/xml")
return Response( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+ doc.getvalue(), mimetype="application/xml")

View File

@ -24,7 +24,7 @@ def lottery_start(v):
@app.post("/lottery/buy")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@limiter.limit("3/second;100/minute;500/hour;1000/day")
@auth_required
@lottery_required
def lottery_buy(v):
@ -38,7 +38,7 @@ def lottery_buy(v):
@app.get("/lottery/active")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@limiter.limit("3/second;100/minute;500/hour;1000/day")
@auth_required
@lottery_required
def lottery_active(v):

View File

@ -83,6 +83,10 @@ def settings_profile_post(v):
updated = True
v.newtabexternal = request.values.get("newtabexternal") == 'true'
elif request.values.get("can_gamble", v.can_gamble) != v.can_gamble:
updated = True
v.can_gamble = request.values.get("can_gamble") == 'true'
elif request.values.get("nitter", v.nitter) != v.nitter:
updated = True
v.nitter = request.values.get("nitter") == 'true'

View File

@ -19,7 +19,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="{{asset('css/main.css')}}">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
<link rel="stylesheet" href="{{asset('css/' + v.theme + '.css')}}">
{% if v.agendaposter %}
<style>
html {

View File

@ -16,7 +16,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="{{asset('css/main.css')}}">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
<link rel="stylesheet" href="{{asset('css/' + v.theme + '.css')}}">
{% if v.css %}
<link rel="stylesheet" href="/@{{v.username}}/css">
{% endif %}

View File

@ -14,7 +14,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="{{asset('css/main.css')}}">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=58">
<link rel="stylesheet" href="{{asset('css/' + v.theme + '.css')}}">
<link rel="stylesheet" href="/assets/css/awards.css?v=7">
{% if v.agendaposter %}
<style>

View File

@ -1,5 +1,5 @@
<nav class="shadow shadow-md fixed-top">
<nav class=" shadow-md fixed-top">
<style>
body {padding-top: 85.88px !important}
@media (max-width: 767.98px) {
@ -10,7 +10,7 @@
</style>
<div class="srd">
{% if SITE == 'rdrama.net' %}
{% if SITE_NAME == 'rDrama' %}
{% include "journoid_banner.html" %}
{%- else -%}
<img src="/e/marseylowpoly.webp" height=18 width=28>
@ -44,9 +44,11 @@
}
{% endif %}
</style>
<a href="/" class="flex-grow-1">
<div id="logo-container" class="flex-grow-1 logo-container">
<a href="/">
<img class="ml-1" id="logo" alt="logo" src="/assets/images/{{SITE_NAME}}/logo.webp?v=1013" width=70>
</a>
</div>
{% endif %}
<div class="flex-grow-1 d-fl d-none d-md-block {% if not v %}pad{% endif %}">
@ -72,20 +74,7 @@
{% endif %}
{% endif %}
{% if not err %}
<a class="mobile-nav-icon d-md-none" href="/random_user"><i class="fas fa-music align-middle text-gray-500 black"></i></a>
<a class="mobile-nav-icon d-md-none" href="/random_post"><i class="fas fa-random align-middle text-gray-500 black"></i></a>
{% if v and LOTTERY_ENABLED %}
<a
href="#"
class="mobile-nav-icon d-md-none"
title="Lottershe"
data-bs-toggle="modal"
data-bs-dismiss="modal"
data-bs-target="#lotteryModal">
<i class="fas fa-ticket align-middle text-gray-500"></i>
</a>
{% endif %}
{% if not err %}
{% if v and v.admin_level > 1 %}
<a class="mobile-nav-icon d-md-none" href="/admin"><i class="fas fa-crown align-middle text-gray-500 black"></i></a>
{% endif %}
@ -95,6 +84,20 @@
{% else %}
<a class="mobile-nav-icon d-md-none" href="/login"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
{% endif %}
{% if v and v.can_gamble and LOTTERY_ENABLED %}
<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="Lottershe">
<a
href="#"
class="mobile-nav-icon d-md-none"
data-bs-toggle="modal"
data-bs-dismiss="modal"
data-bs-target="#lotteryModal">
<i class="fas fa-ticket align-middle text-gray-500"></i>
</a>
</span>
{% endif %}
<button class="navbar-toggler" role="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive"
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon {% if v and v.notifications_count %}position-relative{% endif %}"><i class="fal fa-bars text-gray-500 black"></i>
@ -104,52 +107,22 @@
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto d-none d-md-flex">
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/random_user/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random user"><i class="fas fa-music"></i></a>
</li>
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/random_post/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random post"><i class="fas fa-random"></i></a>
</li>
{% if v and LOTTERY_ENABLED %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a
href="#"
class="nav-link"
title="Lottershe"
data-bs-toggle="modal"
data-bs-dismiss="modal"
data-bs-target="#lotteryModal">
<i class="fas fa-ticket"></i>
</a>
</li>
{% endif %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/chat/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Chat"><i class="fas fa-messages"></i></a>
</li>
{% if v and v.admin_level > 1 %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/admin/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin tools"><i class="fas fa-crown{% if v.has_report_queue %} text-success{% endif %}"></i></a>
</li>
{% endif %}
{% if v %}
{% if v %}
{% if v.notifications_count %}
<li class="nav-item d-flex align-items-center text-center justify-content-center mx-1">
<a class="nav-link position-relative" href="/notifications{% if v.do_posts %}?posts=true{% elif v.do_reddit %}?reddit=true{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Notifications"><i class="fas fa-bell text-danger" {% if v.do_posts %}style="color:blue!important"{% elif v.do_reddit %}style="color:#805ad5!important"{% endif %}></i><span class="notif-count ml-1" style="padding-left: 4.5px;{% if v.do_posts %}background:blue{% elif v.do_reddit %}background:#805ad5{% endif %}">{{v.notifications_count}}</span></a>
</li>
{% else %}
<li class="nav-item d-flex align-items-center text-center justify-content-center mx-1">
<a class="nav-link" href="/notifications" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Notifications"><i class="fas fa-bell"></i></a>
</li>
{% endif %}
{% if v.admin_level > 1 %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/admin/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin tools"><i class="fas fa-crown{% if v.has_report_queue %} text-success{% endif %}"></i></a>
</li>
{% endif %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
@ -157,13 +130,31 @@
</li>
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/comments" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Comments"><i class="fas fa-comment-dots"></i></a>
<a class="nav-link" href="/chat/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Chat"><i class="fas fa-messages"></i></a>
</li>
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/leaderboard" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users"><i class="fas fa-trophy"></i></a>
<a class="nav-link" href="/leaderboard" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Leaderboard"><i class="fas fa-trophy"></i></a>
</li>
{% if v.can_gamble and LOTTERY_ENABLED %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<span
data-bs-toggle="tooltip"
data-bs-placement="bottom"
title="Lottershe">
<a
href="#"
class="nav-link"
data-bs-toggle="modal"
data-bs-dismiss="modal"
data-bs-target="#lotteryModal">
<i class="fas fa-ticket"></i>
</a>
</span>
</li>
{% endif %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/shop" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Shop"><i class="fas fa-store"></i></a>
</li>
@ -183,7 +174,7 @@
</div>
</div>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-lg-left border-0 shadow fade px-0">
<div class="dropdown-menu dropdown-menu-right dropdown-menu-lg-left shadow fade px-0">
<div class="px-2">
<a class="dropdown-item" href="{{v.url}}"><i class="fas fa-user-circle fa-fw mr-3"></i>My
profile</a>
@ -220,7 +211,7 @@
</div>
</div>
</li>
{% else %}
{% else %}
<li class="nav-item d-flex align-items-center justify-content-center mx-1">
<a class="btn btn-primary" href="/contact">Contact us</a>
</li>
@ -314,8 +305,5 @@
* {
animation: unset !important;
}
.active-anim.arrow-up::before{
animation: bounce-top-inset 0s 1 0s;
}
</style>
{%- endif %}

View File

@ -83,7 +83,7 @@
{% endif %}
{{t | capitalize}}
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 31px, 0px);">
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
{% if t != "hour" %}<a class="dropdown-item" href="?sort={{sort}}&t=hour&ccmode={{ccmode}}"><i class="fas fa-clock mr-2 "></i>Hour</a>{% endif %}
{% if t != "day" %}<a class="dropdown-item" href="?sort={{sort}}&t=day&ccmode={{ccmode}}"><i class="fas fa-calendar-day mr-2 "></i>Day</a>{% endif %}
{% if t != "week" %}<a class="dropdown-item" href="?sort={{sort}}&t=week&ccmode={{ccmode}}"><i class="fas fa-calendar-week mr-2 "></i>Week</a>{% endif %}
@ -105,7 +105,7 @@
{% if sort=="comments" %}<i class="fas fa-comments mr-2 "></i>{% endif %}
{{sort | capitalize}}
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton2" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 31px, 0px);">
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton2" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
{% if sort != "hot" %}<a class="dropdown-item" href="?sort=hot&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-fire mr-2 "></i>Hot</a>{% endif %}
{% if sort != "bump" %}<a class="dropdown-item" href="?sort=bump&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-up mr-2 "></i>Bump</a>{% endif %}
{% if sort != "top" %}<a class="dropdown-item" href="?sort=top&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-alt-circle-up mr-2 "></i>Top</a>{% endif %}
@ -162,7 +162,7 @@
<div class="row no-gutters {% if listing %}mt-md-3{% elif not listing %}my-md-3{% endif %}">
<div class="col-12">
<div class="col-12 {% if request.path=='/catalog' %}catalog{% endif %}">
<div class="posts" id="posts">
@ -236,4 +236,4 @@
</style>
{% endif %}
{% endblock %}
{% endblock %}

View File

@ -7,7 +7,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="{{asset('css/main.css')}}">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
<link rel="stylesheet" href="{{asset('css/' + v.theme + '.css')}}">
{% if v.agendaposter %}
<style>
html {

View File

@ -29,15 +29,16 @@
{% if v.admin_level > 2 %}
<div
class="lottery-modal--stat"
style="position: relative; padding-top: 1rem"
style="position: relative; padding-top: 1rem; overflow: hidden;"
>
<i
class="fas fa-broom"
style="
position: absolute;
top: -8px;
right: -8px;
font-size: 20px;
bottom: -4px;
right: -4px;
font-size: 50px;
color: var(--gray-600);
"
>
</i>
@ -139,7 +140,7 @@
margin: 0 auto;
left: 0;
right: 0;
width: 275px;
width: unset;
z-index: 1000;
"
role="alert"
@ -165,7 +166,7 @@
margin: 0 auto;
left: 0;
right: 0;
width: 275px;
width: unset;
z-index: 1000;
"
role="alert"

View File

@ -35,7 +35,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="{{asset('css/main.css')}}">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
<link rel="stylesheet" href="{{asset('css/' + v.theme + '.css')}}">
{% if v.agendaposter %}
<style>
html {

View File

@ -40,7 +40,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="{{asset('css/main.css')}}">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
<link rel="stylesheet" href="{{asset('css/' + v.theme + '.css')}}">
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="{{asset('css/main.css')}}">

View File

@ -145,6 +145,22 @@
</div>
<h2 class="h5">Gambling</h2>
<div class="settings-section rounded">
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="can_gamble">Can Gamble</label>
</div>
<div class="body w-lg-100">
<div class="custom-control custom-switch">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="can_gamble" name="can_gamble"{% if v.can_gamble %} checked{% endif %} onchange="post_toast(this,'/settings/profile?can_gamble='+document.getElementById('can_gamble').checked);">
<label class="custom-control-label" for="can_gamble"></label>
</div>
<span class="text-small-extra text-muted">Disable to prevent use of blackjack, slots, treasure chests, and the lottery.</span>
</div>
</div>
</div>
<h2 class="h5">Twitter Links</h2>

View File

@ -8,6 +8,12 @@
<img class="mb-4" alt="sidebar image" role="button" data-bs-toggle="modal" data-bs-target="#expandImageModal" onclick="expandDesktopImage('{{image}}')" loading="lazy" src="{{image}}" width=100%>
<p class="text-center text-md mb-4">
<a class="sidebar-link" href="/random_user/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random User"><i class="fas fa-music"></i></a>
<a class="sidebar-link" href="/random_post/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
<a class="sidebar-link" href="/comments" data-bs-toggle="tooltip" data-bs-placement="top" title="All Comments"><i class="fas fa-comment-dots"></i></a>
</p>
{% if sub %}
{% if sub.sidebar_html %}
<div class="mb-4">{{sub.sidebar_html|safe}}</div>

View File

@ -1,5 +1,11 @@
<div class="col sidebar text-left d-none d-lg-block pt-3 bg-white" style="max-width:300px">
<p class="text-center text-md mb-4">
<a class="sidebar-link" href="/random_user/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random User"><i class="fas fa-music"></i></a>
<a class="sidebar-link" href="/random_post/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
<a class="sidebar-link" href="/comments" data-bs-toggle="tooltip" data-bs-placement="top" title="All Comments"><i class="fas fa-comment-dots"></i></a>
</p>
{% if sub %}
{% if sub.sidebar_html %}
<div class="mb-4">{{sub.sidebar_html|safe}}</div>

View File

@ -8,6 +8,12 @@
<img class="mb-4" alt="sidebar image" role="button" data-bs-toggle="modal" data-bs-target="#expandImageModal" onclick="expandDesktopImage('{{image}}')" loading="lazy" src="{{image}}" width=100%>
<p class="text-center text-md mb-4">
<a class="sidebar-link" href="/random_user/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random User"><i class="fas fa-music"></i></a>
<a class="sidebar-link" href="/random_post/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
<a class="sidebar-link" href="/comments" data-bs-toggle="tooltip" data-bs-placement="top" title="All Comments"><i class="fas fa-comment-dots"></i></a>
</p>
{% if sub %}
{% if sub.sidebar_html %}
<div class="mb-4">{{sub.sidebar_html|safe}}</div>

View File

@ -36,22 +36,27 @@ set VISITORS_HERE_FLAVOR = [
<img class="mb-4" alt="sidebar image" role="button" data-bs-toggle="modal" data-bs-target="#expandImageModal" onclick="expandDesktopImage('{{image}}')" loading="lazy" src="{{image}}" width=100%>
{% endif %}
<div class="text-center text-lg font-weight-bold">
<p class="mt-1 ml-2 mb-4 text-center">
<img src="/e/marseylowpoly.webp" height=18 width=28>
<span>PEOPLE HERE NOW</span>
</div>
<p class="mt-1 ml-2 mb-4 text-center text-lg">
<span id="sidebar--counter--total">{{ g.loggedin_counter + g.loggedout_counter }}</span>
<span id="sidebar--counter--flavor">{{ VISITORS_HERE_FLAVOR|random|safe }}</span>
<span id="sidebar--counter-loggedin">({{ g.loggedin_counter }} logged in)</span>
<span id="sidebar--counter--loggedin">({{ g.loggedin_counter }} logged in)</span>
{% if v and v.admin_level >= 2 -%}
<span id="sidebar--counter--admin" style="text-align: center; display: block; font-size: 1rem;">
<span id="sidebar--counter--admin">
<a href="/admin/loggedin">Logged In</a> | <a href="/admin/loggedout">Logged Out</a>
</span>
{%- endif %}
</p>
<p class="text-center text-md mb-4">
<a class="sidebar-link" href="/marseys" data-bs-toggle="tooltip" data-bs-placement="top" title="Marseys"><i class="fas fa-cat"></i></a>
<a class="sidebar-link" href="/badges" data-bs-toggle="tooltip" data-bs-placement="top" title="Badges"><i class="fas fa-hexagon"></i></a>
<a class="sidebar-link" href="/log" data-bs-toggle="tooltip" data-bs-placement="top" title="Moderation Log"><i class="fas fa-scroll-old"></i></a>
<a class="sidebar-link" href="/random_user/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random User"><i class="fas fa-music"></i></a>
<a class="sidebar-link" href="/random_post/" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
<a class="sidebar-link" href="/comments" data-bs-toggle="tooltip" data-bs-placement="top" title="All Comments"><i class="fas fa-comment-dots"></i></a>
</p>
{% if sub %}
{% if sub.sidebar_html %}
<div class="mb-4">{{sub.sidebar_html|safe}}</div>

View File

@ -652,7 +652,7 @@
{% set cc='COUNTRY CLUB' %}
{% endif %}
<div class="row mb-3" style="background-color:var(--gray-600)">
<div class="row mb-3">
<div id="post-root" class="col-12">

View File

@ -28,7 +28,7 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="{{asset('css/main.css')}}">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=49">
<link rel="stylesheet" href="{{asset('css/' + v.theme + '.css')}}">
{% if v.agendaposter %}
<style>
html {

View File

@ -1,9 +1,24 @@
{%-
set CACHE_VER = {
'css/main.css': 284,
'js/award_modal.js': 251,
'js/bootstrap.js': 257,
'js/header.js': 268,
'css/main.css': 289,
'css/4chan.css': 59,
'css/classic.css': 59,
'css/classic_dark.css': 59,
'css/coffee.css': 59,
'css/dark.css': 59,
'css/dramblr.css': 59,
'css/light.css': 59,
'css/midnight.css': 59,
'css/reddit.css': 59,
'css/transparent.css': 59,
'css/tron.css': 59,
'css/win98.css': 59,
'js/award_modal.js': 253,
'js/bootstrap.js': 258,
'js/header.js': 269,
'images/badges/': 1017,
}
-%}

View File

@ -667,7 +667,8 @@ CREATE TABLE public.users (
animations boolean DEFAULT true NOT NULL,
currently_held_lottery_tickets integer DEFAULT 0 NOT NULL,
total_held_lottery_tickets integer DEFAULT 0 NOT NULL,
total_lottery_winnings integer DEFAULT 0 NOT NULL
total_lottery_winnings integer DEFAULT 0 NOT NULL,
can_gamble boolean DEFAULT true NOT NULL
);