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()
|
||||
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)
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
</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">
|
||||
<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">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue