fd
This commit is contained in:
parent
c7c9bf9586
commit
8dd72722ca
5 changed files with 35 additions and 10 deletions
|
@ -20,6 +20,7 @@ site = environ.get("DOMAIN").strip()
|
||||||
defaulttheme = environ.get("DEFAULT_THEME", "light").strip()
|
defaulttheme = environ.get("DEFAULT_THEME", "light").strip()
|
||||||
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
|
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
|
||||||
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "day").strip()
|
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "day").strip()
|
||||||
|
cardview = bool(int(environ.get("CARD_VIEW", 1)))
|
||||||
|
|
||||||
class User(Base, Stndrd, Age_times):
|
class User(Base, Stndrd, Age_times):
|
||||||
__tablename__ = "users"
|
__tablename__ = "users"
|
||||||
|
@ -33,6 +34,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
titlecolor = Column(String, default=defaultcolor)
|
titlecolor = Column(String, default=defaultcolor)
|
||||||
theme = Column(String, default=defaulttheme)
|
theme = Column(String, default=defaulttheme)
|
||||||
themecolor = Column(String, default=defaultcolor)
|
themecolor = Column(String, default=defaultcolor)
|
||||||
|
cardview = Column(Boolean, default=cardview)
|
||||||
song = Column(String)
|
song = Column(String)
|
||||||
highres = Column(String)
|
highres = Column(String)
|
||||||
profileurl = Column(String)
|
profileurl = Column(String)
|
||||||
|
|
|
@ -58,6 +58,10 @@ def settings_profile_post(v):
|
||||||
updated = True
|
updated = True
|
||||||
v.hidevotedon = request.values.get("hidevotedon", None) == '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:
|
if request.values.get("newtab", v.newtab) != v.newtab:
|
||||||
updated = True
|
updated = True
|
||||||
v.newtab = request.values.get("newtab", None) == 'true'
|
v.newtab = request.values.get("newtab", None) == 'true'
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-lg-flex border-bottom">
|
<div class="d-lg-flex border-bottom">
|
||||||
<div class="title w-lg-25">
|
<div class="title w-lg-25">
|
||||||
|
|
|
@ -45,6 +45,25 @@
|
||||||
|
|
||||||
<div class="settings-section rounded">
|
<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="d-lg-flex border-bottom">
|
||||||
<div class="title w-lg-25">
|
<div class="title w-lg-25">
|
||||||
<label for="theme">Website Theme</label>
|
<label for="theme">Website Theme</label>
|
||||||
|
|
|
@ -216,18 +216,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if "pcm" in request.host and p.is_image %}
|
{% if p.is_image and (not v or v.cardview) %}
|
||||||
<div style="text-align: center" class="mt-4">
|
<div style="text-align: center" class="mt-4">
|
||||||
<a target="_blank" rel="nofollow noopener noreferrer" href="{{p.url}}">
|
<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">
|
<img loading="lazy" src="{{p.url}}" class="img-fluid" style="max-height:500px;" alt="Unable to load image">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.realbody(v) %}
|
{% if p.realbody(v) %}
|
||||||
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.id}}">
|
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.id}}">
|
||||||
{{p.realbody(v) | safe}}
|
{{p.realbody(v) | safe}}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="card-footer d-block d-md-none mt-2">
|
<div class="card-footer d-block d-md-none mt-2">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue