ijdjoiefjrje
parent
9cc44ce777
commit
2fc8faae14
|
@ -400,6 +400,13 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
|||
if self.url: return self.url.lower().endswith('.jpg') or self.url.lower().endswith('.png') or self.url.lower().endswith('.gif') or self.url.lower().endswith('.jpeg') or self.url.lower().endswith('?maxwidth=9999')
|
||||
else: return False
|
||||
|
||||
@property
|
||||
def is_video(self) -> bool:
|
||||
if self.url:
|
||||
return self.url.startswith("https://i.imgur.com") and self.url.lower().endswith('.mp4')
|
||||
else:
|
||||
return False
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def active_flags(self): return self.flags.count()
|
||||
|
|
|
@ -301,7 +301,7 @@
|
|||
<iframe src="{{streamurl}}" width="100%" height="80" frameBorder="0" allowtransparency="true" allow="encrypted-media"></iframe>
|
||||
<pre></pre>
|
||||
|
||||
{% elif not p.embed_url and not p.is_image %}
|
||||
{% elif 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 %}>
|
||||
<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>
|
||||
|
@ -321,6 +321,15 @@
|
|||
</div>
|
||||
</div>
|
||||
<pre></pre>
|
||||
{% elif p.is_video %}
|
||||
<div class="row no-gutters">
|
||||
<div class="col">
|
||||
<video controls preload="none" style="max-width: 100%">
|
||||
<source src="{{ p.realurl(v) }}" type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
<pre></pre>
|
||||
{% endif %}
|
||||
{{p.realbody(v) | safe}}
|
||||
</div>
|
||||
|
@ -498,7 +507,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
{% if not p.is_image %}
|
||||
{% if not p.is_image and not p.is_video %}
|
||||
<div class="row no-gutters d-block d-md-none">
|
||||
<div class="col">
|
||||
<a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}"></a>
|
||||
|
|
Loading…
Reference in New Issue