remotes/1693045480750635534/spooky-22
Aevann1 2022-03-09 04:04:37 +02:00
parent b9092b20d4
commit b35bab0672
26 changed files with 124 additions and 126 deletions

View File

@ -209,7 +209,7 @@ class Submission(Base):
@lazy
def shortlink(self):
link = f"/post/{self.id}"
if self.sub: link = f"/s/{self.sub}{link}"
if self.sub: link = f"/h/{self.sub}{link}"
if self.club: return link + '/-'

View File

@ -483,7 +483,8 @@ class User(Base):
return self.profileurl
if SITE_NAME == 'Drama':
self.profileurl = '/e/' + random.choice(marseys_const) + '.webp'
g.db.add(self)
try: g.db.add(self)
except: pass
g.db.commit()
return self.profileurl
return f"{SITE_FULL}/static/assets/images/default-profile-pic.webp?v=1008"

View File

@ -73,7 +73,7 @@ def notif_comment2(p):
if existing: return existing[0]
else:
text = f"@{p.author.username} has mentioned you: [{p.title}](/post/{p.id})"
if p.sub: text += f" in <a href='/s/{p.sub}'>/s/{p.sub}"
if p.sub: text += f" in <a href='/h/{p.sub}'>/h/{p.sub}"
text_html = sanitize(text, alert=True)
return create_comment(text_html)

View File

@ -62,10 +62,10 @@ def pusher_thread(interests, c):
@app.get("/post/<pid>/<anything>/<cid>")
@app.get("/logged_out/comment/<cid>")
@app.get("/logged_out/post/<pid>/<anything>/<cid>")
@app.get("/s/<sub>/comment/<cid>")
@app.get("/s/<sub>/post/<pid>/<anything>/<cid>")
@app.get("/logged_out/s/<sub>/comment/<cid>")
@app.get("/logged_out/s/<sub>/post/<pid>/<anything>/<cid>")
@app.get("/h/<sub>/comment/<cid>")
@app.get("/h/<sub>/post/<pid>/<anything>/<cid>")
@app.get("/logged_out/h/<sub>/comment/<cid>")
@app.get("/logged_out/h/<sub>/post/<pid>/<anything>/<cid>")
@auth_desired
def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
@ -185,7 +185,7 @@ def api_comment(v):
parent_post = get_post(parent_submission, v=v)
sub = parent_post.sub
if sub and v.exiled_from(sub): return {"error": f"You're exiled from /s/{sub}"}, 403
if sub and v.exiled_from(sub): return {"error": f"You're exiled from /h/{sub}"}, 403
if parent_post.club and not (v and (v.paid_dues or v.id == parent_post.author_id)): abort(403)

View File

@ -133,14 +133,14 @@ def notifications(v):
@app.get("/")
@app.get("/logged_out")
@app.get("/s/<sub>")
@app.get("/logged_out/s/<sub>")
@app.get("/h/<sub>")
@app.get("/logged_out/h/<sub>")
@limiter.limit("3/second;30/minute;1000/hour;5000/day")
@auth_desired
def front_all(v, sub=None, subdomain=None):
if sub: sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
if request.path.startswith('/s/') and not sub: abort(404)
if request.path.startswith('/h/') and not sub: abort(404)
if g.webview and not session.get("session_id"):
session.permanent = True

View File

@ -80,7 +80,7 @@ def publish(pid, v):
if v.followers:
text = f"@{v.username} has made a new post: [{post.title}]({post.shortlink})"
if post.sub: text += f" in <a href='/s/{post.sub}'>/s/{post.sub}"
if post.sub: text += f" in <a href='/h/{post.sub}'>/h/{post.sub}"
cid = notif_comment(text, autojanny=True)
for follow in v.followers:
@ -101,12 +101,12 @@ def publish(pid, v):
return {"message": "Post published!"}
@app.get("/submit")
@app.get("/s/<sub>/submit")
@app.get("/h/<sub>/submit")
@auth_required
def submit_get(v, sub=None):
if sub: sub = g.db.query(Sub.name).filter_by(name=sub.strip().lower()).one_or_none()
if request.path.startswith('/s/') and not sub: abort(404)
if request.path.startswith('/h/') and not sub: abort(404)
SUBS = [x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()]
@ -116,10 +116,10 @@ def submit_get(v, sub=None):
@app.get("/post/<pid>/<anything>")
@app.get("/logged_out/post/<pid>")
@app.get("/logged_out/post/<pid>/<anything>")
@app.get("/s/<sub>/post/<pid>")
@app.get("/s/<sub>/post/<pid>/<anything>")
@app.get("/logged_out/s/<sub>/post/<pid>")
@app.get("/logged_out/s/<sub>/post/<pid>/<anything>")
@app.get("/h/<sub>/post/<pid>")
@app.get("/h/<sub>/post/<pid>/<anything>")
@app.get("/logged_out/h/<sub>/post/<pid>")
@app.get("/logged_out/h/<sub>/post/<pid>/<anything>")
@auth_desired
def post_id(pid, anything=None, v=None, sub=None):
if not v and not request.path.startswith('/logged_out') and not request.headers.get("Authorization"):
@ -783,7 +783,7 @@ def thumbnail_thread(pid):
@app.post("/submit")
@app.post("/s/<sub>/submit")
@app.post("/h/<sub>/submit")
@limiter.limit("1/second;6/minute;200/hour;1000/day")
@auth_required
def submit_post(v, sub=None):
@ -802,14 +802,14 @@ def submit_post(v, sub=None):
sub = request.values.get("sub")
if sub: sub = sub.replace('/s/','').replace('s/','')
if sub: sub = sub.replace('/h/','').replace('s/','')
if sub and sub != 'none':
sname = sub.strip().lower()
sub = g.db.query(Sub.name).filter_by(name=sname).one_or_none()
if not sub: return error(f"/s/{sname} not found!")
if not sub: return error(f"/h/{sname} not found!")
sub = sub[0]
if v.exiled_from(sub): return error(f"You're exiled from /s/{sub}")
if v.exiled_from(sub): return error(f"You're exiled from /h/{sub}")
else: sub = None
if v.is_suspended: return error("You can't perform this action while banned.")
@ -1141,7 +1141,7 @@ def submit_post(v, sub=None):
if request.values.get('followers') and v.followers:
text = f"@{v.username} has made a new post: [{post.title}]({post.shortlink})"
if post.sub: text += f" in <a href='/s/{post.sub}'>/s/{post.sub}"
if post.sub: text += f" in <a href='/h/{post.sub}'>/h/{post.sub}"
cid = notif_comment(text, autojanny=True)
for follow in v.followers:

View File

@ -6,7 +6,7 @@ from .front import frontlist
@app.post("/s/<sub>/subscribe")
@app.post("/h/<sub>/subscribe")
@auth_required
def subscribe_sub(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -24,7 +24,7 @@ def subscribe_sub(v, sub):
return {"message": "Subscribed to sub!"}
@app.post("/s/<sub>/unsubscribe")
@app.post("/h/<sub>/unsubscribe")
@auth_required
def unsubscribe_sub(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -41,7 +41,7 @@ def unsubscribe_sub(v, sub):
return {"message": "Unsubscribed from sub!"}
@app.get("/s/<sub>/subscribers")
@app.get("/h/<sub>/subscribers")
@auth_required
def subscribers(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -74,7 +74,7 @@ def exile_post(v, pid):
exile = Exile(user_id=u.id, sub=sub, exiler_id=v.id)
g.db.add(exile)
send_notification(u.id, f"@{v.username} has exiled you from /s/{sub} for [{p.title}]({p.shortlink})")
send_notification(u.id, f"@{v.username} has exiled you from /h/{sub} for [{p.title}]({p.shortlink})")
g.db.commit()
@ -102,14 +102,14 @@ def exile_comment(v, cid):
exile = Exile(user_id=u.id, sub=sub, exiler_id=v.id)
g.db.add(exile)
send_notification(u.id, f"@{v.username} has exiled you from /s/{sub} for [{c.permalink}]({c.shortlink})")
send_notification(u.id, f"@{v.username} has exiled you from /h/{sub} for [{c.permalink}]({c.shortlink})")
g.db.commit()
return {"message": "User exiled successfully!"}
@app.post("/s/<sub>/unexile/<uid>")
@app.post("/h/<sub>/unexile/<uid>")
@is_not_permabanned
def unexile(v, sub, uid):
u = get_account(uid)
@ -120,13 +120,13 @@ def unexile(v, sub, uid):
exile = g.db.query(Exile).filter_by(user_id=u.id, sub=sub).one_or_none()
g.db.delete(exile)
send_notification(u.id, f"@{v.username} has revoked your exile from /s/{sub}")
send_notification(u.id, f"@{v.username} has revoked your exile from /h/{sub}")
g.db.commit()
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"message": "User unexiled successfully!"}
return redirect(f'/s/{sub}/exilees')
return redirect(f'/h/{sub}/exilees')
@ -134,7 +134,7 @@ def unexile(v, sub, uid):
@app.post("/s/<sub>/block")
@app.post("/h/<sub>/block")
@auth_required
def block_sub(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -154,7 +154,7 @@ def block_sub(v, sub):
return {"message": "Sub blocked successfully!"}
@app.post("/s/<sub>/unblock")
@app.post("/h/<sub>/unblock")
@auth_required
def unblock_sub(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -170,7 +170,7 @@ def unblock_sub(v, sub):
return {"message": "Sub unblocked successfully!"}
@app.get("/s/<sub>/mods")
@app.get("/h/<sub>/mods")
@auth_required
def mods(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -181,7 +181,7 @@ def mods(v, sub):
return render_template("sub/mods.html", v=v, sub=sub, users=users)
@app.get("/s/<sub>/exilees")
@app.get("/h/<sub>/exilees")
@auth_required
def exilees(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -192,7 +192,7 @@ def exilees(v, sub):
return render_template("sub/exilees.html", v=v, sub=sub, users=users)
@app.get("/s/<sub>/blockers")
@app.get("/h/<sub>/blockers")
@auth_required
def blockers(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -204,7 +204,7 @@ def blockers(v, sub):
@app.post("/s/<sub>/add_mod")
@app.post("/h/<sub>/add_mod")
@limiter.limit("1/second;5/day")
@is_not_permabanned
def add_mod(v, sub):
@ -227,14 +227,14 @@ def add_mod(v, sub):
g.db.add(mod)
if v.id != user.id:
send_repeatable_notification(user.id, f"@{v.username} has added you as a mod to /s/{sub}")
send_repeatable_notification(user.id, f"@{v.username} has added you as a mod to /h/{sub}")
g.db.commit()
return redirect(f'/s/{sub}/mods')
return redirect(f'/h/{sub}/mods')
@app.post("/s/<sub>/remove_mod")
@app.post("/h/<sub>/remove_mod")
@is_not_permabanned
def remove_mod(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -262,11 +262,11 @@ def remove_mod(v, sub):
g.db.delete(mod)
if v.id != user.id:
send_repeatable_notification(user.id, f"@{v.username} has removed you as a mod from /s/{sub}")
send_repeatable_notification(user.id, f"@{v.username} has removed you as a mod from /h/{sub}")
g.db.commit()
return redirect(f'/s/{sub}/mods')
return redirect(f'/h/{sub}/mods')
@app.get("/create_sub")
@is_not_permabanned
@ -319,7 +319,7 @@ def create_sub2(v):
g.db.add(mod)
g.db.commit()
return redirect(f'/s/{sub.name}')
return redirect(f'/h/{sub.name}')
@app.post("/kick/<pid>")
@is_not_permabanned
@ -341,7 +341,7 @@ def kick(v, pid):
return {"message": "Post kicked successfully!"}
@app.get('/s/<sub>/settings')
@app.get('/h/<sub>/settings')
@is_not_permabanned
def sub_settings(v, sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
@ -352,7 +352,7 @@ def sub_settings(v, sub):
return render_template('sub/settings.html', v=v, sidebar=sub.sidebar, sub=sub)
@app.post('/s/<sub>/sidebar')
@app.post('/h/<sub>/sidebar')
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@is_not_permabanned
def post_sub_sidebar(v, sub):
@ -369,10 +369,10 @@ def post_sub_sidebar(v, sub):
g.db.commit()
return redirect(f'/s/{sub.name}/settings')
return redirect(f'/h/{sub.name}/settings')
@app.post('/s/<sub>/css')
@app.post('/h/<sub>/css')
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@is_not_permabanned
def post_sub_css(v, sub):
@ -386,10 +386,10 @@ def post_sub_css(v, sub):
g.db.commit()
return redirect(f'/s/{sub.name}/settings')
return redirect(f'/h/{sub.name}/settings')
@app.get("/s/<sub>/css")
@app.get("/h/<sub>/css")
def get_sub_css(sub):
sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
if not sub: abort(404)
@ -398,7 +398,7 @@ def get_sub_css(sub):
return resp
@app.post("/s/<sub>/banner")
@app.post("/h/<sub>/banner")
@limiter.limit("1/second;10/day")
@is_not_permabanned
def sub_banner(v, sub):
@ -427,9 +427,9 @@ def sub_banner(v, sub):
g.db.add(sub)
g.db.commit()
return redirect(f'/s/{sub.name}/settings')
return redirect(f'/h/{sub.name}/settings')
@app.post("/s/<sub>/sidebar_image")
@app.post("/h/<sub>/sidebar_image")
@limiter.limit("1/second;10/day")
@is_not_permabanned
def sub_sidebar(v, sub):
@ -457,7 +457,7 @@ def sub_sidebar(v, sub):
g.db.add(sub)
g.db.commit()
return redirect(f'/s/{sub.name}/settings')
return redirect(f'/h/{sub.name}/settings')
@app.get("/sub_toggle/<mode>")
@ -477,7 +477,7 @@ def sub_toggle(mode, v):
return redirect('/')
@app.get("/subs")
@app.get("/holes")
@auth_desired
def subs(v):
subs = g.db.query(Sub, func.count(Submission.sub)).outerjoin(Submission, Sub.name == Submission.sub).group_by(Sub.name).order_by(func.count(Submission.sub).desc()).all()

View File

@ -136,7 +136,7 @@
{% endif %}
{% if c.post.sub %}
<span class="ml-1"> in <a href="/s/{{c.post.sub}}" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>/s/{{c.post.sub}}</a></span>
<span class="ml-1"> in <a href="/h/{{c.post.sub}}" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>/h/{{c.post.sub}}</a></span>
{% endif %}
{% elif c.author_id==NOTIFICATIONS_ID or c.author_id==AUTOJANNY_ID %}
<span class="font-weight-bold">Notification</span>
@ -177,7 +177,7 @@
{% if c.post %}
{% set sub = c.post.sub %}
{% if sub and c.author.exiled_from(sub) %}
<a role="button"><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from /s/{{sub}}"></i></a>
<a role="button"><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from /h/{{sub}}"></i></a>
{% endif %}
{% endif %}
@ -498,7 +498,7 @@
{% set sub = c.post.sub %}
{% if sub and v.mods(sub) and not c.author.mods(sub) %}
<button id="exile-{{c.id}}" class="d-none {% if not c.author.exiled_from(sub) %}d-md-block{% endif %} dropdown-item list-inline-item text-danger" onclick="post_toast2(this,'/exile/comment/{{c.id}}','exile-{{c.id}}','unexile-{{c.id}}')"><i class="fas fa-campfire text-danger fa-fw"></i>Exile user</button>
<button id="unexile-{{c.id}}" class="d-none {% if c.author.exiled_from(sub) %}d-md-block{% endif %} dropdown-item list-inline-item text-success" onclick="post_toast2(this,'/s/{{sub}}/unexile/{{c.author_id}}','exile-{{c.id}}','unexile-{{c.id}}')"><i class="fas fa-campfire text-success fa-fw"></i>Unexile user</button>
<button id="unexile-{{c.id}}" class="d-none {% if c.author.exiled_from(sub) %}d-md-block{% endif %} dropdown-item list-inline-item text-success" onclick="post_toast2(this,'/h/{{sub}}/unexile/{{c.author_id}}','exile-{{c.id}}','unexile-{{c.id}}')"><i class="fas fa-campfire text-success fa-fw"></i>Unexile user</button>
{% endif %}
{% endif %}
@ -674,7 +674,7 @@
{% set sub = c.post.sub %}
{% if sub and v.mods(sub) and not c.author.mods(sub) %}
<a data-bs-dismiss="modal" id="exile2-{{c.id}}" class="{% if c.author.exiled_from(sub) %}d-none{% endif %} list-group-item text-danger" onclick="post_toast2(this,'/exile/comment/{{c.id}}','exile2-{{c.id}}','unexile2-{{c.id}}')"><i class="fas fa-campfire text-danger mr-2"></i>Exile user</a>
<a data-bs-dismiss="modal" id="unexile2-{{c.id}}" class="{% if not c.author.exiled_from(sub) %}d-none{% endif %} list-group-item text-success" onclick="post_toast2(this,'/s/{{sub}}/unexile/{{c.author_id}}','exile2-{{c.id}}','unexile2-{{c.id}}')"><i class="fas fa-campfire text-success mr-2"></i>Unexile user</a>
<a data-bs-dismiss="modal" id="unexile2-{{c.id}}" class="{% if not c.author.exiled_from(sub) %}d-none{% endif %} list-group-item text-success" onclick="post_toast2(this,'/h/{{sub}}/unexile/{{c.author_id}}','exile2-{{c.id}}','unexile2-{{c.id}}')"><i class="fas fa-campfire text-success mr-2"></i>Unexile user</a>
{% endif %}
{% endif %}
{% endif %}

View File

@ -33,14 +33,11 @@
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=175">
{% if SITE_NAME == 'Drama' and not request.path.startswith('/s/') %}
<link rel="stylesheet" href="/static/assets/css/ukraine.css?v=2">
{% endif %}
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=27">
{% endif %}
{% if sub and sub.css and not request.path.endswith('settings') %}
<link rel="stylesheet" href="/s/{{sub.name}}/css" type="text/css">
<link rel="stylesheet" href="/h/{{sub.name}}/css" type="text/css">
{% endif %}
{% if v and v.themecolor == '30409f' %}
@ -233,7 +230,7 @@
{% if v %}
{% if sub %}
<img alt="/s/{{sub.name}} banner" role="button" data-bs-toggle="modal" data-bs-target="#expandImageModal" onclick="expandDesktopImage('{{sub.banner_url}}')" loading="lazy" src="{{sub.banner_url}}" width=100% style="object-fit:cover;max-height:25vw">
<img alt="/h/{{sub.name}} banner" role="button" data-bs-toggle="modal" data-bs-target="#expandImageModal" onclick="expandDesktopImage('{{sub.banner_url}}')" loading="lazy" src="{{sub.banner_url}}" width=100% style="object-fit:cover;max-height:25vw">
{% elif SITE_NAME == 'Drama' %}
{% set path = "assets/images/" + SITE_NAME + "/banners" %}
{% set image = "/static/" + path + "/" + listdir('files/' + path)|random() + '?v=22' %}

View File

@ -42,7 +42,7 @@
{% if SITE_NAME == 'Drama' %}
<img alt="logo" src="/static/assets/images/{{SITE_NAME}}/logo.webp?v=1010" height=20 width=77>
{% elif sub %}
<a href="/s/{{sub.name}}" class="font-weight-bold ml-2 mt-2">/s/{{sub.name}}</a>
<a href="/h/{{sub.name}}" class="font-weight-bold ml-2 mt-2">/h/{{sub.name}}</a>
{% endif %}
</a>
</div>
@ -72,7 +72,7 @@
{% endif %}
{% if v %}
<a class="mobile-nav-icon d-md-none" href="{% if sub %}/s/{{sub.name}}{% endif %}/submit"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
<a class="mobile-nav-icon d-md-none" href="{% if sub %}/h/{{sub.name}}{% endif %}/submit"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
{% 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 %}
@ -112,7 +112,7 @@
{% endif %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="{% if sub %}/s/{{sub.name}}{% endif %}/submit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Create post"><i class="fas fa-feather-alt"></i></a>
<a class="nav-link" href="{% if sub %}/h/{{sub.name}}{% endif %}/submit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Create post"><i class="fas fa-feather-alt"></i></a>
</li>
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">

View File

@ -64,20 +64,20 @@
<button class="btn btn-secondary dropdown-toggle text-small-m ddd" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-user-group mr-2 text-small-m"></i>
{% if v.subs == 1 %}
Include subscribed subs
Include subscribed holes
{% elif v.subs == 2 %}
Include all subs
Include all holes
{% elif v.subs == 3 %}
View subscribed subs only
View subscribed holes only
{% elif v.subs == 4 %}
View subs only
View holes only
{% endif %}
</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);">
{% if v.subs != 1 %}<a class="dropdown-item text-small-m" href="/sub_toggle/1"><i class="fas fa-user-group mr-2 text-small-m"></i>Include subscribed subs</a>{% endif %}
{% if v.subs != 2 %}<a class="dropdown-item text-small-m" href="/sub_toggle/2"><i class="fas fa-user-group mr-2 text-small-m"></i>Include all subs</a>{% endif %}
{% if v.subs != 3 %}<a class="dropdown-item text-small-m" href="/sub_toggle/3"><i class="fas fa-user-group mr-2 text-small-m"></i>View subscribed subs only</a>{% endif %}
{% if v.subs != 4 %}<a class="dropdown-item text-small-m" href="/sub_toggle/4"><i class="fas fa-user-group mr-2 text-small-m"></i>View subs only</a>{% endif %}
{% if v.subs != 1 %}<a class="dropdown-item text-small-m" href="/sub_toggle/1"><i class="fas fa-user-group mr-2 text-small-m"></i>Include subscribed holes</a>{% endif %}
{% if v.subs != 2 %}<a class="dropdown-item text-small-m" href="/sub_toggle/2"><i class="fas fa-user-group mr-2 text-small-m"></i>Include all holes</a>{% endif %}
{% if v.subs != 3 %}<a class="dropdown-item text-small-m" href="/sub_toggle/3"><i class="fas fa-user-group mr-2 text-small-m"></i>View subscribed holes only</a>{% endif %}
{% if v.subs != 4 %}<a class="dropdown-item text-small-m" href="/sub_toggle/4"><i class="fas fa-user-group mr-2 text-small-m"></i>View holes only</a>{% endif %}
</div>
</div>
{% endif %}
@ -149,7 +149,7 @@
</div>
<div class="card-body">
{% if v %}
<a href="{% if sub %}/s/{{sub.name}}{% endif %}/submit">
<a href="{% if sub %}/h/{{sub.name}}{% endif %}/submit">
<input autocomplete="off" type="text" class="form-control"
aria-label="Username"
aria-describedby="basic-addon1">

View File

@ -83,7 +83,7 @@
{% if not p.author.mods(p.sub) %}
<a id="exile-{{p.id}}" class="{% if p.author.exiled_from(p.sub) %}d-none{% endif %} dropdown-item list-inline-item text-danger" role="button" onclick="post_toast2(this,'/exile/post/{{p.id}}','exile-{{p.id}}','unexile-{{p.id}}')"><i class="fas fa-campfire text-danger"></i>Exile user</a>
<a id="unexile-{{p.id}}" class="{% if not p.author.exiled_from(p.sub) %}d-none{% endif %} dropdown-item list-inline-item text-success" role="button" onclick="post_toast2(this,'/s/{{sub}}/unexile/{{p.author_id}}','exile-{{p.id}}','unexile-{{p.id}}')"><i class="fas fa-campfire text-success"></i>Unexile user</a>
<a id="unexile-{{p.id}}" class="{% if not p.author.exiled_from(p.sub) %}d-none{% endif %} dropdown-item list-inline-item text-success" role="button" onclick="post_toast2(this,'/h/{{sub}}/unexile/{{p.author_id}}','exile-{{p.id}}','unexile-{{p.id}}')"><i class="fas fa-campfire text-success"></i>Unexile user</a>
{% endif %}
{% endif %}

View File

@ -55,6 +55,6 @@
{% if not p.author.mods(p.sub) %}
<button data-bs-dismiss="modal" id="exile2" class="{% if p.author.exiled_from(p.sub) %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" onclick="post_toast2(this,'/exile/post/{{p.id}}','exile2','unexile2')"><i class="fas fa-campfire mr-3 text-danger"></i>Exile user</button>
<button data-bs-dismiss="modal" id="unexile2" class="{% if not p.author.exiled_from(p.sub) %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-success" onclick="post_toast2(this,'/s/{{sub}}/unexile/{{p.author_id}}','exile2','unexile2')"><i class="fas fa-campfire mr-3 text-success"></i>Unexile user</button>
<button data-bs-dismiss="modal" id="unexile2" class="{% if not p.author.exiled_from(p.sub) %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-success" onclick="post_toast2(this,'/h/{{sub}}/unexile/{{p.author_id}}','exile2','unexile2')"><i class="fas fa-campfire mr-3 text-success"></i>Unexile user</button>
{% endif %}
{% endif %}

View File

@ -14,26 +14,26 @@
<div class="mb-4">{{sub.sidebar_html|safe}}</div>
{% endif %}
{% if v %}
<a class="btn btn-primary btn-block {% if v.subscribed_to(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/s/{{sub.name}}/subscribe','subscribe-sub','unsubscribe-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">SUBSCRIBE</a>
<a class="btn btn-primary btn-block {% if not v.subscribed_to(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/s/{{sub.name}}/unsubscribe','subscribe-sub','unsubscribe-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">UNSUBSCRIBE</a>
<a class="btn btn-primary btn-block {% if v.subscribed_to(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/subscribe','subscribe-sub','unsubscribe-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">SUBSCRIBE</a>
<a class="btn btn-primary btn-block {% if not v.subscribed_to(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unsubscribe','subscribe-sub','unsubscribe-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">UNSUBSCRIBE</a>
<a class="btn btn-primary btn-block {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/s/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">BLOCK SUB</a>
<a class="btn btn-primary btn-block {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/s/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">UNBLOCK SUB</a>
<a class="btn btn-primary btn-block {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">BLOCK HOLE</a>
<a class="btn btn-primary btn-block {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">UNBLOCK HOLE</a>
{% if v.id in (AEVANN_ID,CARP_ID) %}
<a class="btn btn-primary btn-block" href="/create_sub">CREATE SUB</a>
<a class="btn btn-primary btn-block" href="/create_sub">CREATE HOLE</a>
{% endif %}
{% if v.mods(sub.name) %}
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/settings">SUB SETTINGS</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/settings">SUB SETTINGS</a>
{% endif %}
{% endif %}
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/mods">MODS</a>
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/subscribers">SUBSCRIBERS</a>
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/exilees">EXILEES</a>
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/blockers">BLOCKERS</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/mods">MODS</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/subscribers">SUBSCRIBERS</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/exilees">EXILEES</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/blockers">BLOCKERS</a>
{% else %}
{% if v and v.id in (AEVANN_ID,CARP_ID) %}
<a class="btn btn-primary btn-block" href="/create_sub">CREATE SUB</a>
<a class="btn btn-primary btn-block" href="/create_sub">CREATE HOLE</a>
{% endif %}
<a class="btn btn-primary btn-block" href="/post/16583">EMOJI MEGATHREAD</a>
<a class="btn btn-primary btn-block" href="/post/18459">BUGS/SUGGESTIONS MEGATHREAD</a>

View File

@ -5,18 +5,18 @@
<div class="mb-4">{{sub.sidebar_html|safe}}</div>
{% endif %}
{% if v and v.mods(sub.name) %}
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/settings">SUB SETTINGS</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/settings">SUB SETTINGS</a>
{% endif %}
{% if v %}
<a class="btn btn-primary btn-block {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/s/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">BLOCK SUB</a>
<a class="btn btn-primary btn-block {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/s/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">UNBLOCK SUB</a>
<a class="btn btn-primary btn-block {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')">BLOCK HOLE</a>
<a class="btn btn-primary btn-block {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')">UNBLOCK HOLE</a>
{% endif %}
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/mods">MODS</a>
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/exilees">EXILEES</a>
<a class="btn btn-primary btn-block" href="/s/{{sub.name}}/blockers">BLOCKERS</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/mods">MODS</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/exilees">EXILEES</a>
<a class="btn btn-primary btn-block" href="/h/{{sub.name}}/blockers">BLOCKERS</a>
{% endif %}
<a class="btn btn-primary btn-block" href="/create_sub">CREATE SUB</a>
<a class="btn btn-primary btn-block" href="/create_sub">CREATE HOLE</a>
<a class="btn btn-primary btn-block mt-5" href="https://ip2.network">STREAM LIST</a>
<a class="btn btn-primary btn-block" href="/post/4103">BUGS/SUGGESTIONS MEGATHREAD</a>
<a class="btn btn-primary btn-block" href="/post/9694" >OFFICIAL CONSPIRACY THEORY THREAD</a>

View File

@ -4,7 +4,7 @@
</pre>
<h5>Users blocking /s/{{sub.name}}</h5>
<h5>Users blocking /h/{{sub.name}}</h5>
<pre></pre>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">

View File

@ -1,7 +1,7 @@
{% extends "submit.html" %}
{% block title %}
<title>Create a Sub</title>
<title>Create a hole</title>
{% endblock %}
{% block form %}
@ -19,9 +19,9 @@
<div class="col col-md-6 p-3 py-md-0">
<h1 class="d-none d-md-block">Create a sub</h1>
<h1 class="d-none d-md-block">Create a hole</h1>
<h2 class="h3 d-md-none">Create a sub</h2>
<h2 class="h3 d-md-none">Create a hole</h2>
<div class="body">
@ -44,7 +44,7 @@
</p>
{% endif %}
<button class="btn btn-primary ml-auto" id="create_button" {% if cost > v.coins %}disabled{% endif %}>Create Sub</button>
<button class="btn btn-primary ml-auto" id="create_button" {% if cost > v.coins %}disabled{% endif %}>Create Hole</button>
</div>

View File

@ -4,7 +4,7 @@
</pre>
<h5>Users exiled from /s/{{sub.name}}</h5>
<h5>Users exiled from /h/{{sub.name}}</h5>
<pre></pre>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
@ -23,7 +23,7 @@
<td><a style="color:#{{exiler.namecolor}}" href="/@{{exiler.username}}"><img loading="lazy" src="{{exiler.profile_url}}" class="pp20"><span {% if exiler.patron %}class="patron" style="background-color:#{{exiler.namecolor}}"{% endif %}>{{exiler.username}}</span></a></td>
<td>
{% if v.mods(sub.name) %}
<form action="/s/{{sub.name}}/unexile/{{user.id}}" method="post">
<form action="/h/{{sub.name}}/unexile/{{user.id}}" method="post">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<input class="btn btn-primary" style="margin-top:-5px" autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="Unexile">
</form>

View File

@ -4,7 +4,7 @@
</pre>
<h5>/s/{{sub.name}} Mods</h5>
<h5>/h/{{sub.name}} Mods</h5>
<pre></pre>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
@ -22,7 +22,7 @@
<td>{{mod.created_datetime}}</td>
<td>
{% if v.id == user.id or v.mod_date(sub.name) and v.mod_date(sub.name) < mod.created_utc %}
<form action="/s/{{sub.name}}/remove_mod" method="post">
<form action="/h/{{sub.name}}/remove_mod" method="post">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<input autocomplete="off" type="hidden" name="uid" value="{{user.id}}">
<input class="btn btn-primary" style="margin-top:-5px" autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="{% if v.id == user.id %}Resign{% else %}Remove Mod{% endif %}">
@ -35,7 +35,7 @@
</table>
{% if v.mods(sub.name) %}
<form action="/s/{{sub.name}}/add_mod" method="post">
<form action="/h/{{sub.name}}/add_mod" method="post">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<input class="form-control" style="display:inline;width:250px" autocomplete="off" type="text" name="user" class="form-control" placeholder="Enter username..">
<input class="btn btn-primary" style="margin-top:-5px" autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="Add Mod">

View File

@ -31,7 +31,7 @@
<div class="d-flex">
<div>
<form action="/s/{{sub.name}}/sidebar_image" method="post" enctype="multipart/form-data">
<form action="/h/{{sub.name}}/sidebar_image" method="post" enctype="multipart/form-data">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<label class="btn btn-secondary text-capitalize mr-2 mb-0">
Update<input autocomplete="off" type="file" accept="image/*" {% if request.headers.get('cf-ipcountry')=="T1" %}disabled{% endif %} hidden name="sidebar" onchange="form.submit()">
@ -59,7 +59,7 @@
<div class="d-flex">
<div class="title w-lg-75 text-md-center">
<img loading="lazy" alt="/s/{[sub.name]} banner" src="{{sub.banner_url}}" class="banner-pic-135">
<img loading="lazy" alt="/h/{[sub.name]} banner" src="{{sub.banner_url}}" class="banner-pic-135">
</div>
<div class="body w-lg-100 my-auto">
@ -67,7 +67,7 @@
<div class="d-flex">
<div>
<form action="/s/{{sub.name}}/banner" method="post" enctype="multipart/form-data">
<form action="/h/{{sub.name}}/banner" method="post" enctype="multipart/form-data">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<label class="btn btn-secondary text-capitalize mr-2 mb-0">
Update<input autocomplete="off" type="file" {% if request.headers.get('cf-ipcountry')=="T1" %}disabled{% endif %} accept="image/*" hidden name="banner" onchange="form.submit()">
@ -97,7 +97,7 @@
</div>
<div class="body d-lg-flex">
<div class="w-lg-100">
<form id="sidebar" action="/s/{{sub.name}}/sidebar" method="post">
<form id="sidebar" action="/h/{{sub.name}}/sidebar" method="post">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<textarea autocomplete="off" maxlength="500" class="form-control rounded" id="bio-text" aria-label="With textarea" placeholder="Enter sidebar here..." rows="10" name="sidebar" form="sidebar">{% if sub.sidebar %}{{sub.sidebar}}{% endif %}</textarea>
@ -122,7 +122,7 @@
</div>
<div class="body d-lg-flex">
<div class="w-lg-100">
<form id="css" action="/s/{{sub.name}}/css" method="post">
<form id="css" action="/h/{{sub.name}}/css" method="post">
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<textarea autocomplete="off" maxlength="4000" class="form-control rounded" id="bio-text" aria-label="With textarea" placeholder="Enter css here..." rows="10" name="css" form="css">{% if sub.css %}{{sub.css}}{% endif %}</textarea>

View File

@ -6,7 +6,7 @@
</pre>
<h5>List of subs</h5>
<h5>List of holes</h5>
<pre></pre>
<div class="overflow-x-auto">
<table id="sortable_table" class="table table-striped mb-5">
@ -23,10 +23,10 @@
{% for sub, count in subs %}
<tr>
<td>{{loop.index}}</td>
<td><a href="/s/{{sub.name}}">{{sub.name}}</a></td>
<td><a href="/s/{{sub.name}}">{{count}}</a></td>
<td><a href="/s/{{sub.name}}/subscribers">{{sub.subscription_num}}</a></td>
<td><a href="/s/{{sub.name}}/blockers">{{sub.block_num}}</a></td>
<td><a href="/h/{{sub.name}}">{{sub.name}}</a></td>
<td><a href="/h/{{sub.name}}">{{count}}</a></td>
<td><a href="/h/{{sub.name}}/subscribers">{{sub.subscription_num}}</a></td>
<td><a href="/h/{{sub.name}}/blockers">{{sub.block_num}}</a></td>
</tr>
{% endfor %}
</table>

View File

@ -4,7 +4,7 @@
</pre>
<h5>Users subscribed to /s/{{sub.name}}</h5>
<h5>Users subscribed to /h/{{sub.name}}</h5>
<pre></pre>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">

View File

@ -590,11 +590,11 @@
<div class="post-meta text-left mb-2">
{% if p.sub %}
<a href='/s/{{p.sub}}'>/s/{{p.sub}}</a>&nbsp;&nbsp;
<a href='/h/{{p.sub}}'>/h/{{p.sub}}</a>&nbsp;&nbsp;
{% endif %}
{% if p.sub and p.author.exiled_from(p.sub) %}
<a role="button"><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from /s/{{p.sub}}"></i></a>
<a role="button"><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from /h/{{p.sub}}"></i></a>
{% endif %}
{% if p.bannedfor %}

View File

@ -147,11 +147,11 @@
<div class="post-meta text-left x-scroll mb-md-2">
{% if p.sub %}
<a href='/s/{{p.sub}}'>/s/{{p.sub}}</a>&nbsp;&nbsp;
<a href='/h/{{p.sub}}'>/h/{{p.sub}}</a>&nbsp;&nbsp;
{% endif %}
{% if p.sub and p.author.exiled_from(p.sub) %}
<a role="button"><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from /s/{{p.sub}}"></i></a>
<a role="button"><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from /h/{{p.sub}}"></i></a>
{% endif %}
{% if p.bannedfor %}
@ -391,7 +391,7 @@
</span>
<h2 class="h5">You haven't {% if "saved" in request.full_path %}saved{% else %}made{% endif %} a post yet</h2>
<p class="text-muted mb-md-5">Your {% if "saved" in request.full_path %}saved posts{% else %}posting history{% endif %} will show here.</p>
{% if "saved" not in request.full_path %}<a href="{% if sub %}/s/{{sub.name}}{% endif %}/submit" class="btn btn-primary">Create a post</a>{% endif %}
{% if "saved" not in request.full_path %}<a href="{% if sub %}/h/{{sub.name}}{% endif %}/submit" class="btn btn-primary">Create a post</a>{% endif %}
</div>
</div>
</div>

View File

@ -63,7 +63,7 @@
<div class="submit-grid-view">
<form id="submitform" action="{% if sub %}/s/{{sub.name}}{% endif %}/submit" method="post" enctype="multipart/form-data" style="grid-column: 2">
<form id="submitform" action="{% if sub %}/h/{{sub.name}}{% endif %}/submit" method="post" enctype="multipart/form-data" style="grid-column: 2">
<div class="container">
@ -79,7 +79,7 @@
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<label class='mt-4' for="title">Sub</label>
<label class='mt-4' for="title">Hole</label>
<div class="input-group mb2">
<input list="subs" autocomplete="off" id='sub' class="form-control" form="submitform" name="sub" oninput="savetext()" {% if sub %}value="{{sub.name}}"{% endif %} placeholder="Optional">
@ -90,7 +90,7 @@
</datalist>
</div>
<div class="mt-1" style="font-size: min(3.5vw,14px)"><span style="color:#ffcccb ">WARNING</span>: Selecting a sub considerably reduces the number of people who will see your post. Don't select a sub unless that's what you want.</div>
<div class="mt-1" style="font-size: min(3.5vw,14px)"><span style="color:#ffcccb ">WARNING</span>: Selecting a hole considerably reduces the number of people who will see your post. Don't select a hole unless that's what you want.</div>
<label class='mt-4' for="title">Post Title</label>

View File

@ -159,7 +159,7 @@
<p class="text-uppercase my-0 pb-1" style="font-weight: bold; font-size: 12px;">Moderator of</p>
{% for a in u.moderated_subs %}
<span class="d-inline-block mx-1">
<a href="{{SITE_FULL}}/s/{{a['sub']}}">/s/{{a['sub']}}</a>
<a href="{{SITE_FULL}}/h/{{a['sub']}}">/h/{{a['sub']}}</a>
</span>
{% endfor %}
</div>
@ -454,7 +454,7 @@
<p class="text-uppercase my-0 pb-1" style="font-weight: bold; font-size: 12px;">Moderator of</p>
{% for a in u.moderated_subs %}
<span class="d-inline-block mx-1">
<a href="{{SITE_FULL}}/s/{{a['sub']}}">/s/{{a['sub']}}</a>
<a href="{{SITE_FULL}}/h/{{a['sub']}}">/h/{{a['sub']}}</a>
</span>
{% endfor %}
</div>