diff --git a/files/routes/front.py b/files/routes/front.py index c4129d780..b8192b058 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -122,21 +122,13 @@ def notifications(v): @app.get("/") @app.get("/logged_out") -@app.get("/logged_out/mobile") @auth_desired def front_all(v): session.permanent = True if not session.get("session_id"): session["session_id"] = secrets.token_hex(49) - if not v and not request.headers.get("Authorization"): - if request.path.startswith('/logged_out/mobile'): - if g.system == "desktop": return redirect(request.full_path.replace('/mobile','')) - elif request.path.startswith('/logged_out'): - if g.system == "mobile": return redirect(request.full_path.replace('/logged_out','/logged_out/mobile')) - else: - if g.system == "desktop": return redirect(f"/logged_out{request.full_path}") - else: return redirect(f"/logged_out/mobile{request.full_path}") + if not v and request.path == "/" and not request.headers.get("Authorization"): return redirect(f"/logged_out{request.full_path}") if v and v.is_banned and not v.unban_utc: return render_template('errors/500.html', error=True, v=v), 500 diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index f49f467e1..ea4da07f2 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -1,5 +1,684 @@ -{% if g.system == 'mobile' %} - {% include "submission_listing_mobile.html" %} +{% if v %} + {% include "award_modal.html" %} +{% endif %} + +{% if request.host == 'pcmemes.net' %} + {% set cc='SPLASH MOUNTAIN' %} {% else %} - {% include "submission_listing_desktop.html" %} -{% endif %} \ No newline at end of file + {% set cc='COUNTRY CLUB' %} +{% endif %} + +{% if not v or v.highlightcomments %} + +{% endif %} + + + + + +{% for p in listing %} + + + +{% set ups=p.upvotes %} +{% set downs=p.downvotes %} +{% set score=ups-downs %} + +{% if v %} + {% set voted= p.voted %} +{% else %} + {% set voted=-2 %} +{% endif %} + +{% if p.active_flags %} +
+ Reported by: +

+		
+	
+{% endif %} + +
+ +
+ + {% if not postembed %} +
+ {% if v and request.path.startswith('/@') and not v.admin_level %} + + {% if voted==1 %} +
+ {% endif %} + + {{score}} + + {% if voted==-1 %} +
+ {% endif %} + + {% elif v %} + +
+ + {{score}} + +
+ + {% else %} + +
+ + {{score}} + +
+ + {% endif %} + +
+ {% endif %} + +
+ +
+ {% if p.club and not (v and (v.paid_dues or v.id == p.author_id)) %} + post thumnail + {% elif not p.url %} + + post thumnail + + {% elif p.is_image %} + + post thumnail + + {% elif (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm'))) or (p.embed_url and "youtu" in p.domain) or (p.url and "streamable.com/e/" in p.url) %} + + post thumnail + + {% else %} + + post thumnail + + {% endif %} +
+ + +
+ + +
+ + + +
+ {% if p.club %}{{cc}}{% endif %} + {% if p.flair %}{{p.flair | safe}}{% endif %} + {{p.realtitle(v) | safe}} +
+ +
+ +
+
+
+ + + +{% if v %} + +{% endif %} + +{% if v and v.admin_level > 1 %} + +{% endif %} + + + + + + +
+ +{% if not p.club or v and (v.paid_dues or v.id == p.author_id) %} + {% if p.realbody(v) %} +
+ {{p.realbody(v) | safe}} + + {% if p.author.sig_html and (p.author_id == 1904 or not (v and v.sigs_disabled)) %} +
+ {{p.author.sig_html | safe}} + {% endif %} +
+ {% endif %} + + {% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %} +
+ + Unable to load image + +
+ {% elif p.is_video %} +
+ +
+ {% elif p.embed_url and p.domain in ['youtu.be','youtube.com'] and p.embed_url.startswith(' + {{p.embed_url | safe}} + + {% endif %} +{% endif %} + +{% else %} + +{% if request.path.endswith('/admin/queue') %} + +
+
+
+
This queue is empty. (That's a good thing.)
+
+
+
+ + +{% elif u %} +{% if v and v.id == u.id %} +
+
+
+ + + + +

You haven't {% if "saved" in request.full_path %}saved{% else %}made{% endif %} a post yet

+

Your {% if "saved" in request.full_path %}saved posts{% else %}posting history{% endif %} will show here.

+ {% if "saved" not in request.full_path %}Create a post{% endif %} +
+
+
+ + +{% else %} +
+
+
+ + + + +

@{{u.username}} hasn't made a post yet

+

Their posting history will show here.

+
+			
+
+
+
+{% endif %} + +{% else %} +
+
+
+ + + + +

There are no posts here.

+
+
+
+ + +{% endif %} + +{% endfor %} + +{% if v %} + {% include "delete_post_modal.html" %} + {% include "report_post_modal.html" %} + {% if v.admin_level > 1 %} + {% include "ban_modal.html" %} + {% endif %} +{% endif %} +{% include "expanded_image_modal.html" %} + + + + + + \ No newline at end of file diff --git a/files/templates/submission_listing_desktop.html b/files/templates/submission_listing_desktop.html deleted file mode 100644 index c2e0813b6..000000000 --- a/files/templates/submission_listing_desktop.html +++ /dev/null @@ -1,490 +0,0 @@ - -{% if v %} -{% include "award_modal.html" %} -{% endif %} - -{% if request.host == 'pcmemes.net' %} -{% set cc='SPLASH MOUNTAIN' %} -{% else %} -{% set cc='COUNTRY CLUB' %} -{% endif %} - -{% if not v or v.highlightcomments %} - -{% endif %} - - - - - -{% for p in listing %} - - - -{% set ups=p.upvotes %} -{% set downs=p.downvotes %} -{% set score=ups-downs %} - -{% if v %} -{% set voted= p.voted %} -{% else %} -{% set voted=-2 %} -{% endif %} - -{% if p.active_flags %} -
- Reported by: -

-    
-
-{% endif %} - -
- -
- - {% if not postembed %} -
- {% if v and request.path.startswith('/@') and not v.admin_level %} - - {% if voted==1 %} -
- {% endif %} - - {{score}} - - {% if voted==-1 %} -
- {% endif %} - - {% elif v %} - -
- - {{score}} - -
- - {% else %} - -
- - {{score}} - -
- - {% endif %} - -
- {% endif %} - -
- -
- {% if p.club and not (v and (v.paid_dues or v.id == p.author_id)) %} - post thumnail - {% elif not p.url %} - - post thumnail - - {% elif p.is_image %} - - post thumnail - - {% elif (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm'))) or (p.embed_url and "youtu" in p.domain) or (p.url and "streamable.com/e/" in p.url) %} - - post thumnail - - {% else %} - - post thumnail - - {% endif %} -
- - -
- - -
- - - -
- {% if p.club %}{{cc}}{% endif %} - {% if p.flair %}{{p.flair | safe}}{% endif %} - {{p.realtitle(v) | safe}} -
- -
- -
-
-
- -
- -{% if not p.club or v and (v.paid_dues or v.id == p.author_id) %} -{% if p.realbody(v) %} -
- {{p.realbody(v) | safe}} - - {% if p.author.sig_html and (p.author_id == 1904 or not (v and v.sigs_disabled)) %} -
- {{p.author.sig_html | safe}} - {% endif %} -
-{% endif %} - -{% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %} -
- - Unable to load image - -
-{% elif p.is_video %} -
- -
-{% elif p.embed_url and p.domain in ['youtu.be','youtube.com'] and p.embed_url.startswith(' - {{p.embed_url | safe}} - -{% endif %} -{% endif %} - -{% else %} - -{% if request.path.endswith('/admin/queue') %} - -
-
-
-
This queue is empty. (That's a good thing.)
-
-
-
- - -{% elif u %} -{% if v and v.id == u.id %} -
-
-
- - - - -

You haven't {% if "saved" in request.full_path %}saved{% else %}made{% endif %} a post yet

-

Your {% if "saved" in request.full_path %}saved posts{% else %}posting history{% endif %} will show here.

- {% if "saved" not in request.full_path %}Create a post{% endif %} -
-
-
- - -{% else %} -
-
-
- - - - -

@{{u.username}} hasn't made a post yet

-

Their posting history will show here.

-
-        
-
-
-
-{% endif %} - -{% else %} -
-
-
- - - - -

There are no posts here.

-
-
-
- - -{% endif %} - -{% endfor %} - -{% if v %} -{% include "delete_post_modal.html" %} -{% include "report_post_modal.html" %} -{% if v.admin_level > 1 %} - {% include "ban_modal.html" %} -{% endif %} -{% endif %} -{% include "expanded_image_modal.html" %} - - - - - - \ No newline at end of file diff --git a/files/templates/submission_listing_mobile.html b/files/templates/submission_listing_mobile.html deleted file mode 100644 index 6c1dc4fad..000000000 --- a/files/templates/submission_listing_mobile.html +++ /dev/null @@ -1,554 +0,0 @@ -{% if v %} - {% include "award_modal.html" %} -{% endif %} - -{% if request.host == 'pcmemes.net' %} - {% set cc='SPLASH MOUNTAIN' %} -{% else %} - {% set cc='COUNTRY CLUB' %} -{% endif %} - -{% if not v or v.highlightcomments %} - -{% endif %} - - - - - -{% for p in listing %} - - - -{% set ups=p.upvotes %} -{% set downs=p.downvotes %} -{% set score=ups-downs %} - -{% if v %} - {% set voted= p.voted %} -{% else %} - {% set voted=-2 %} -{% endif %} - -{% if p.active_flags %} -
- Reported by: -

-		
    - {% for f in p.ordered_flags %} -
  • {{f.user.username}}{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}[remove]{% endif %}
  • - {% endfor %} -
-
-{% endif %} - -
- -
- -
- -
- {% if p.club and not (v and (v.paid_dues or v.id == p.author_id)) %} - post thumnail - {% elif not p.url %} - - post thumnail - - {% elif p.is_image %} - - post thumnail - - {% elif (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm'))) or (p.embed_url and "youtu" in p.domain) or (p.url and "streamable.com/e/" in p.url) %} - - post thumnail - - {% else %} - - post thumnail - - {% endif %} -
- - -
- - -
- - - -
- {% if p.club %}{{cc}}{% endif %} - {% if p.flair %}{{p.flair | safe}}{% endif %} - {{p.realtitle(v) | safe}} -
-
-
- - - -{% if v %} - -{% endif %} - -{% if v and v.admin_level > 1 %} - -{% endif %} - - - - - - -
- -{% if not p.club or v and (v.paid_dues or v.id == p.author_id) %} - {% if p.realbody(v) %} -
- {{p.realbody(v) | safe}} - - {% if p.author.sig_html and (p.author_id == 1904 or not (v and v.sigs_disabled)) %} -
- {{p.author.sig_html | safe}} - {% endif %} -
- {% endif %} - - {% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %} -
- - Unable to load image - -
- {% elif p.is_video %} -
- -
- {% elif p.embed_url and p.domain in ['youtu.be','youtube.com'] and p.embed_url.startswith(' - {{p.embed_url | safe}} - - {% endif %} -{% endif %} - -{% else %} - -{% if request.path.endswith('/admin/queue') %} - -
-
-
-
This queue is empty. (That's a good thing.)
-
-
-
- - -{% elif u %} -{% if v and v.id == u.id %} -
-
-
- - - - -

You haven't {% if "saved" in request.full_path %}saved{% else %}made{% endif %} a post yet

-

Your {% if "saved" in request.full_path %}saved posts{% else %}posting history{% endif %} will show here.

- {% if "saved" not in request.full_path %}Create a post{% endif %} -
-
-
- - -{% else %} -
-
-
- - - - -

@{{u.username}} hasn't made a post yet

-

Their posting history will show here.

-
-			
-
-
-
-{% endif %} - -{% else %} -
-
-
- - - - -

There are no posts here.

-
-
-
- - -{% endif %} - -{% endfor %} - -{% if v %} - {% include "delete_post_modal.html" %} - {% include "report_post_modal.html" %} - {% if v.admin_level > 1 %} - {% include "ban_modal.html" %} - {% endif %} -{% endif %} -{% include "expanded_image_modal.html" %} - - - - - - \ No newline at end of file