fsd
This commit is contained in:
parent
0ef9448211
commit
1832300dfd
6 changed files with 3 additions and 41 deletions
|
@ -60,18 +60,10 @@ def pusher_thread(interests, c):
|
||||||
|
|
||||||
@app.get("/comment/<cid>")
|
@app.get("/comment/<cid>")
|
||||||
@app.get("/post/<pid>/<anything>/<cid>")
|
@app.get("/post/<pid>/<anything>/<cid>")
|
||||||
@app.get("/logged_out/comment/<cid>")
|
|
||||||
@app.get("/logged_out/post/<pid>/<anything>/<cid>")
|
|
||||||
@app.get("/h/<sub>/comment/<cid>")
|
@app.get("/h/<sub>/comment/<cid>")
|
||||||
@app.get("/h/<sub>/post/<pid>/<anything>/<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
|
@auth_desired
|
||||||
def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
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
|
|
||||||
|
|
||||||
try: cid = int(cid)
|
try: cid = int(cid)
|
||||||
except: abort(404)
|
except: abort(404)
|
||||||
|
|
|
@ -114,18 +114,10 @@ def submit_get(v, sub=None):
|
||||||
|
|
||||||
@app.get("/post/<pid>")
|
@app.get("/post/<pid>")
|
||||||
@app.get("/post/<pid>/<anything>")
|
@app.get("/post/<pid>/<anything>")
|
||||||
@app.get("/logged_out/post/<pid>")
|
|
||||||
@app.get("/logged_out/post/<pid>/<anything>")
|
|
||||||
@app.get("/h/<sub>/post/<pid>")
|
@app.get("/h/<sub>/post/<pid>")
|
||||||
@app.get("/h/<sub>/post/<pid>/<anything>")
|
@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
|
@auth_desired
|
||||||
def post_id(pid, anything=None, v=None, sub=None):
|
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"):
|
|
||||||
return redirect(f"/logged_out{request.full_path}")
|
|
||||||
|
|
||||||
if v and request.path.startswith('/logged_out'): v = None
|
|
||||||
|
|
||||||
try: pid = int(pid)
|
try: pid = int(pid)
|
||||||
except Exception as e: pass
|
except Exception as e: pass
|
||||||
|
|
|
@ -38,23 +38,13 @@ def marsey_list():
|
||||||
return str(marseys).replace("'",'"')
|
return str(marseys).replace("'",'"')
|
||||||
|
|
||||||
@app.get("/terms")
|
@app.get("/terms")
|
||||||
@app.get("/logged_out/terms")
|
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def terms(v):
|
def terms(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
|
|
||||||
|
|
||||||
return render_template("terms.html", v=v)
|
return render_template("terms.html", v=v)
|
||||||
|
|
||||||
@app.get('/sidebar')
|
@app.get('/sidebar')
|
||||||
@app.get('/logged_out/sidebar')
|
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def sidebar(v):
|
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
|
|
||||||
|
|
||||||
return render_template('sidebar.html', v=v)
|
return render_template('sidebar.html', v=v)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -796,16 +796,10 @@ def visitors(v):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/@<username>")
|
@app.get("/@<username>")
|
||||||
@app.get("/logged_out/@<username>")
|
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def u_username(username, v=None):
|
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
|
|
||||||
|
|
||||||
|
|
||||||
u = get_user(username, v=v)
|
u = get_user(username, v=v)
|
||||||
|
|
||||||
|
|
||||||
|
@ -888,15 +882,9 @@ def u_username(username, v=None):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/@<username>/comments")
|
@app.get("/@<username>/comments")
|
||||||
@app.get("/logged_out/@<username>/comments")
|
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def u_username_comments(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
|
|
||||||
|
|
||||||
user = get_user(username, v=v)
|
user = get_user(username, v=v)
|
||||||
|
|
||||||
if username != user.username: return redirect(f'/@{user.username}/comments')
|
if username != user.username: return redirect(f'/@{user.username}/comments')
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
{% if g.webview %} <div class="custom-control custom-checkbox mt-4">
|
{% if g.webview %} <div class="custom-control custom-checkbox mt-4">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="termsCheck" required>
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="termsCheck" required>
|
||||||
<label class="custom-control-label terms" for="termsCheck">I accept the <a
|
<label class="custom-control-label terms" for="termsCheck">I accept the <a
|
||||||
href="/logged_out/terms" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>terms of use</a></label>
|
href="/terms" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>terms of use</a></label>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="text-center text-muted text-small mt-5 mb-3">
|
<div class="text-center text-muted text-small mt-5 mb-3">
|
||||||
|
|
|
@ -112,9 +112,9 @@
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="termsCheck" required>
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="termsCheck" required>
|
||||||
<label class="custom-control-label terms" for="termsCheck">I accept the <a
|
<label class="custom-control-label terms" for="termsCheck">I accept the <a
|
||||||
{% if g.webview %}
|
{% if g.webview %}
|
||||||
href="/logged_out/terms">terms of use
|
href="/terms">terms of use
|
||||||
{% else %}
|
{% else %}
|
||||||
href="/logged_out/sidebar">rules
|
href="/sidebar">rules
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a></label>
|
</a></label>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue