remotes/1693045480750635534/spooky-22
Aevann1 2021-09-09 06:39:54 +02:00
parent da828783e6
commit a0d35cda82
4 changed files with 12 additions and 6 deletions

View File

@ -17,6 +17,7 @@ from files.__main__ import Base, cache
from files.helpers.security import *
site = environ.get("DOMAIN").strip()
site_name = environ.get("SITE_NAME").strip()
defaulttheme = environ.get("DEFAULT_THEME", "light").strip()
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
@ -447,6 +448,11 @@ class User(Base, Stndrd, Age_times):
return g.db.query(Follow).filter_by(target_id=self.id, user_id=user.id).first()
@property
@lazy
def banner_url(self):
if self.bannerurl: return self.bannerurl
else: return f"https://{site}/assets/images/{site_name}/preview.gif"
@cache.memoize(timeout=86400)
def defaultpicture(self):

View File

@ -298,7 +298,7 @@
<div class="d-flex">
<div class="title w-lg-75 text-md-center">
<img loading="lazy" src="{{v.bannerurl}}" class="banner-pic-135">
<img loading="lazy" src="{{v.banner_url}}" class="banner-pic-135">
</div>
<div class="body w-lg-100 my-auto">

View File

@ -3,7 +3,7 @@
<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-3 mb-4">
<div id="user-{{u.id}}" class="card h-100">
<div style="position: relative;"><img loading="lazy" src="{{u.bannerurl}}" class="card-img-top" alt="@{{u.username}} user banner" style="height: 175px; object-fit: cover">
<div style="position: relative;"><img loading="lazy" src="{{u.banner_url}}" class="card-img-top" alt="@{{u.username}} user banner" style="height: 175px; object-fit: cover">
<img loading="lazy" src="{{u.profile_url}}" class="profile-pic-50 border-3 border-white" style="position: absolute; left: 15px; bottom: 15px; box-sizing: content-box;"></div>
<div class="card-body" style="word-wrap: break-word;">

View File

@ -28,7 +28,7 @@
<meta property="og:description" name="description" content="{{u.coins}} {{'COINS_NAME' | app_config}} - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers - {% endif %}{% if not u.is_private %}{{u.post_count}} Posts - {{u.comment_count}} Comments - {% endif %}{{u.bio}}" />
<meta property="og:author" name="author" content="@{{u.username}}" />
<meta property="og:title" content="{{u.username}}" />
<meta property="og:image" content="{% if u.bannerurl %}{{u.bannerurl}}{% else %}{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.gif{% endif %}" />
<meta property="og:image" content="{{u.banner_url}}" />
<meta property="og:url" content="{{u.url | full_link}}" />
<meta property="og:site_name" content="{{request.host}}" />
@ -37,7 +37,7 @@
<meta name="twitter:title" content="{{u.username}}'s profile - {{'SITE_NAME' | app_config}}" />
<meta name="twitter:creator" content="@{{u.username}}">
<meta name="twitter:description" content="{{u.coins}} {{'COINS_NAME' | app_config}} - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers -{% endif %} {% if not u.is_private %} {{u.post_count}} Posts - {{u.comment_count}} Comments -{% endif %} {{u.bio}}" />
<meta name="twitter:image" content="{% if u.bannerurl %}{{u.bannerurl}}{% else %}{{'SITE_NAME' | app_config}}/assets/images/{{'SITE_NAME' | app_config}}/preview.gif{% endif %}" />
<meta name="twitter:image" content="{{u.banner_url}}" />
<meta name="twitter:url" content="{{u.url | full_link}}" />
{% endblock %}
@ -93,7 +93,7 @@
<textarea id="userid" style="display: none;">{% if u.song %}{{u.id}}{% else %}nosong{% endif %}</textarea>
<div class="row d-none d-md-block">
<div class="col px-0">
<div {% if u.bannerurl %} class="jumbotron jumbotron-fluid jumbotron-guild d-none d-md-block" style="background-image: url({{u.bannerurl}})" {% endif %}>
<div class="jumbotron jumbotron-fluid jumbotron-guild d-none d-md-block" style="background-image: url({{u.banner_url}})">
<div class="jumbotron-overlay"></div>
<div class="w-100 my-3">
<div class="container-fluid nobackground">
@ -373,7 +373,7 @@
<div class="container-fluid text-center bg-white d-md-none">
<div class="row">
<div class="col px-0">
<img loading="lazy" src="{{u.bannerurl}}" style="width: 100%; height: 65px; object-fit: cover;">
<img loading="lazy" src="{{u.banner_url}}" style="width: 100%; height: 65px; object-fit: cover;">
</div>
</div>
<div class="row border-bottom">