forked from rDrama/rDrama
fdMerge branch 'frost' of https://github.com/Aevann1/Drama into frost
commit
cf6fca29e5
|
@ -68,7 +68,7 @@ def pusher_thread(interests, c, username):
|
|||
def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
||||
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
||||
|
||||
try: cid = int(cid)
|
||||
except: abort(404)
|
||||
|
|
|
@ -173,7 +173,7 @@ def front_all(v, sub=None, subdomain=None):
|
|||
session["session_id"] = secrets.token_hex(49)
|
||||
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
||||
|
||||
if sub: sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none()
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ def submit_get(v, sub=None):
|
|||
def post_id(pid, anything=None, v=None, sub=None):
|
||||
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
||||
|
||||
try: pid = int(pid)
|
||||
except Exception as e: pass
|
||||
|
|
|
@ -62,7 +62,7 @@ def marsey_list():
|
|||
@auth_desired
|
||||
def sidebar(v):
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
||||
|
||||
return render_template('sidebar.html', v=v)
|
||||
|
||||
|
|
|
@ -220,19 +220,19 @@ def remove_mod(v, sub):
|
|||
|
||||
return redirect(f'/h/{sub}/mods')
|
||||
|
||||
# @app.get("/create_sub")
|
||||
# @is_not_permabanned
|
||||
# def create_sub(v):
|
||||
# if SITE_NAME == 'rDrama' and v.admin_level < 3: abort(403)
|
||||
@app.get("/create_sub")
|
||||
@is_not_permabanned
|
||||
def create_sub(v):
|
||||
if SITE_NAME != 'PCM' and v.admin_level < 3: abort(403)
|
||||
|
||||
# if request.host == 'rdrama.net': cost = 0
|
||||
# else:
|
||||
# num = v.subs_created + 1
|
||||
# for a in v.alts:
|
||||
# num += a.subs_created
|
||||
# cost = num * 100
|
||||
if request.host == 'rdrama.net': cost = 0
|
||||
else:
|
||||
num = v.subs_created + 1
|
||||
for a in v.alts:
|
||||
num += a.subs_created
|
||||
cost = num * 100
|
||||
|
||||
# return render_template("sub/create_sub.html", v=v, cost=cost)
|
||||
return render_template("sub/create_sub.html", v=v, cost=cost)
|
||||
|
||||
|
||||
@app.post("/create_sub")
|
||||
|
|
|
@ -864,7 +864,7 @@ def visitors(v):
|
|||
def u_username(username, v=None):
|
||||
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
||||
|
||||
u = get_user(username, v=v)
|
||||
|
||||
|
@ -953,7 +953,7 @@ def u_username(username, v=None):
|
|||
def u_username_comments(username, v=None):
|
||||
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
||||
|
||||
user = get_user(username, v=v)
|
||||
|
||||
|
@ -1145,7 +1145,7 @@ def remove_follow(username, v):
|
|||
@auth_desired
|
||||
def user_profile_uid(v, id):
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out',''))
|
||||
|
||||
try: id = int(id)
|
||||
except:
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
<div class="mb-4">{{sub.sidebar_html|safe}}</div>
|
||||
{% endif %}
|
||||
{% if v %}
|
||||
<a class="btn btn-primary btn-block mb-3 disabled" href="/create_sub">CREATE HOLE (temporarily disabled for 24 hours)</a>
|
||||
{% if v.mods(sub.name) %}
|
||||
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/settings">HOLE SETTINGS</a>
|
||||
{% endif %}
|
||||
|
@ -22,9 +21,6 @@
|
|||
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/exilees">HOLE EXILEES</a>
|
||||
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/blockers">HOLE BLOCKERS</a>
|
||||
{% else %}
|
||||
<a class="btn btn-primary btn-block mb-3 disabled" href="/create_sub">CREATE HOLE (temporarily disabled for 24 hours)</a>
|
||||
<a class="btn btn-primary btn-block mb-3" href="/holes">BROWSE HOLES</a>
|
||||
|
||||
<div class="mt-4">
|
||||
Rules:<br><br>
|
||||
|
||||
|
|
Loading…
Reference in New Issue