forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-01-14 06:15:41 +02:00
parent acad522929
commit 7aede92a46
7 changed files with 38 additions and 10 deletions

View File

@ -424,7 +424,7 @@ class Submission(Base):
@property @property
@lazy @lazy
def is_video(self): def is_video(self):
return self.url and any((self.url.lower().endswith(x) for x in ('.mp4','.webm','.mov'))) return self.url and any((self.url.lower().endswith(x) for x in ('.mp4','.webm','.mov', '#t=0.1')))
@property @property
@lazy @lazy

View File

@ -29,13 +29,21 @@ def emojis(v):
return render_template("marseys.html", v=v, marseys=marsey_counted) return render_template("marseys.html", v=v, marseys=marsey_counted)
@app.get("/terms") @app.get("/terms")
@auth_required @app.get("/logged_out/terms")
@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')
@auth_required @app.get('/logged_out/sidebar')
@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)

View File

@ -92,7 +92,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="/terms" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>terms of use</a></label> href="/logged_out/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">

View File

@ -43,4 +43,14 @@
<h5>RULE 5 </h5>All rules can and likely will be ignored at admin discretion. Be funny, or at least compelling, and pretty much anything legal is fine.<br><br> <h5>RULE 5 </h5>All rules can and likely will be ignored at admin discretion. Be funny, or at least compelling, and pretty much anything legal is fine.<br><br>
Okay I think thats all, thanks for reading! No one cares about your dumb <I>free speech</I> or whatever, go to Gab or something if you want to screech about amendments and stuff. Rules are not hard and fast, and janitorial abuse is inherent to the platform. So is ban evasion. Have fun or log out, both are easy! Okay I think thats all, thanks for reading! No one cares about your dumb <I>free speech</I> or whatever, go to Gab or something if you want to screech about amendments and stuff. Rules are not hard and fast, and janitorial abuse is inherent to the platform. So is ban evasion. Have fun or log out, both are easy!
<pre>
</pre>
</div> </div>

View File

@ -4,4 +4,14 @@
<a class="btn btn-primary btn-block mt-4" href="https://ip2.network">STREAM LIST</a> <a class="btn btn-primary btn-block mt-4" 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/4103">BUGS/SUGGESTIONS MEGATHREAD</a>
<p class="mt-4">Rules: No doxxing, No CP or other clearly illegal shit. Thanks.</p> <p class="mt-4">Rules: No doxxing, No CP or other clearly illegal shit. Thanks.</p>
<pre>
</pre>
</div> </div>

View File

@ -113,9 +113,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="/terms">terms of use href="/logged_out/terms">terms of use
{% else %} {% else %}
href="/sidebar">rules href="/logged_out/sidebar">rules
{% endif %} {% endif %}
</a></label> </a></label>
</div> </div>

View File

@ -143,7 +143,7 @@
<meta property="og:author" name="author" content="{{'@'+comment_info.author.username}}" > <meta property="og:author" name="author" content="{{'@'+comment_info.author.username}}" >
<meta property="og:title" content="{{'@'+comment_info.author.username}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}" > <meta property="og:title" content="{{'@'+comment_info.author.username}} comments on {{p.plaintitle(v)}} - {{SITE_NAME}}" >
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/preview.gif{% endif %}" > <meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/preview.gif{% endif %}" >
{% if p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm') or p.url.lower().endswith('.mov')) %} {% if p.is_video %}
<meta property="og:video" content="{{ p.realurl(v) }}" > <meta property="og:video" content="{{ p.realurl(v) }}" >
{% endif %} {% endif %}
<meta property="og:url" content="{{comment_info.permalink | full_link}}" > <meta property="og:url" content="{{comment_info.permalink | full_link}}" >
@ -168,7 +168,7 @@
{% if p.author %}<meta property="og:author" name="author" content="{{'@'+p.author.username}}" >{% endif %} {% if p.author %}<meta property="og:author" name="author" content="{{'@'+p.author.username}}" >{% endif %}
<meta property="og:title" content="{{p.plaintitle(v)}} - {{SITE_NAME}}" > <meta property="og:title" content="{{p.plaintitle(v)}} - {{SITE_NAME}}" >
<meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/preview.gif{% endif %}" > <meta property="og:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{SITE_NAME}}/static/assets/images/{{SITE_NAME}}/preview.gif{% endif %}" >
{% if p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm') or p.url.lower().endswith('.mov')) %} {% if p.url and p.is_video %}
<meta property="og:video" content="{{ p.realurl(v) }}" > <meta property="og:video" content="{{ p.realurl(v) }}" >
{% endif %} {% endif %}
<meta property="og:url" content="{{p.permalink | full_link}}" > <meta property="og:url" content="{{p.permalink | full_link}}" >
@ -391,7 +391,7 @@
<div id="post-body" class="post-body mt-3"> <div id="post-body" class="post-body mt-3">
{% if p.realurl(v) %} {% if p.realurl(v) %}
{% if not p.embed_url and not p.is_image and not (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm') or p.url.lower().endswith('.mov'))) %} {% if not p.embed_url and not p.is_image and not p.is_video %}
<a rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}" {% if not v or v.newtabexternal %}target="_blank"{% endif %}> <a rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}" {% if not v or v.newtabexternal %}target="_blank"{% endif %}>
<div class="d-flex d-md-none justify-content-between align-items-center border rounded p-2{% if p.realbody(v) %} mb-3{% endif %}"> <div class="d-flex d-md-none justify-content-between align-items-center border rounded p-2{% if p.realbody(v) %} mb-3{% endif %}">
<span>{{p.domain|truncate(30, True)}}</span> <span>{{p.domain|truncate(30, True)}}</span>
@ -650,7 +650,7 @@
</div> </div>
{% if not p.is_image and not (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm') or p.url.lower().endswith('.mov'))) %} {% if not p.is_image and not p.is_video %}
<div class="row no-gutters d-md-none"> <div class="row no-gutters d-md-none">
<div class="col"> <div class="col">
<a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}"></a> <a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}"></a>