remotes/1693045480750635534/spooky-22
Aevann1 2021-09-03 22:52:40 +02:00
parent 3e7cfac7cb
commit c0279fa97a
5 changed files with 35 additions and 10 deletions

View File

@ -20,6 +20,7 @@ site = environ.get("DOMAIN").strip()
defaulttheme = environ.get("DEFAULT_THEME", "light").strip()
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "day").strip()
cardview = bool(int(environ.get("CARD_VIEW", 1)))
class User(Base, Stndrd, Age_times):
__tablename__ = "users"
@ -33,6 +34,7 @@ class User(Base, Stndrd, Age_times):
titlecolor = Column(String, default=defaultcolor)
theme = Column(String, default=defaulttheme)
themecolor = Column(String, default=defaultcolor)
cardview = Column(Boolean, default=cardview)
song = Column(String)
highres = Column(String)
profileurl = Column(String)

View File

@ -58,6 +58,10 @@ def settings_profile_post(v):
updated = True
v.hidevotedon = request.values.get("hidevotedon", None) == 'true'
if request.values.get("cardview", v.cardview) != v.cardview:
updated = True
v.cardview = request.values.get("cardview", None) == 'true'
if request.values.get("newtab", v.newtab) != v.newtab:
updated = True
v.newtab = request.values.get("newtab", None) == 'true'

View File

@ -32,7 +32,7 @@
</div>
</div>
</div>
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">

View File

@ -45,6 +45,25 @@
<div class="settings-section rounded">
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="cardview">Card View</label>
</div>
<div class="body w-lg-100">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="cardview" name="cardview"{% if v.cardview %} checked{% endif %} onchange="post_toast('/settings/profile?cardview='+document.getElementById('cardview').checked);">
<label class="custom-control-label" for="cardview"></label>
</div>
<span class="text-small-extra text-muted">Enable if you would like to display images in full size in the frontpage.</span>
</div>
</div>
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="theme">Website Theme</label>

View File

@ -216,18 +216,18 @@
</div>
</div>
{% if "pcm" in request.host and p.is_image %}
<div style="text-align: center" class="mt-4">
<a target="_blank" rel="nofollow noopener noreferrer" href="{{p.url}}">
<img loading="lazy" src="{{p.url}}" class="img-fluid" style="max-height:500px;" alt="Unable to load image">
</a>
</div>
{% if p.is_image and (not v or v.cardview) %}
<div style="text-align: center" class="mt-4">
<a target="_blank" rel="nofollow noopener noreferrer" href="{{p.url}}">
<img loading="lazy" src="{{p.url}}" class="img-fluid" style="max-height:500px;" alt="Unable to load image">
</a>
</div>
{% endif %}
{% if p.realbody(v) %}
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.id}}">
{{p.realbody(v) | safe}}
</div>
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.id}}">
{{p.realbody(v) | safe}}
</div>
{% endif %}
<div class="card-footer d-block d-md-none mt-2">