bbb
parent
62921d2900
commit
837410187c
|
@ -436,7 +436,7 @@ class User(Base):
|
|||
@lazy
|
||||
def banner_url(self):
|
||||
if self.bannerurl: return self.bannerurl
|
||||
else: return f"https://{site}/static/assets/images/{site_name}/preview.webp?a=200"
|
||||
else: return f"https://{site}/static/assets/images/{site_name}/site_preview.webp?a=1"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -109,7 +109,7 @@ def sanitize(sanitized, noimages=False, alert=False):
|
|||
for i in re.finditer("<p>@((\w|-){1,25})", sanitized):
|
||||
u = get_user(i.group(1), graceful=True)
|
||||
if u:
|
||||
sanitized = sanitized.replace(i.group(0), f'<p><a href="/id/{u.id}"><img loading="lazy" src="/uid/{u.id}/pic" class="pp20">@{u.username}</a>')
|
||||
sanitized = sanitized.replace(i.group(0), f'''<p><a href="/id/{u.id}"><img alt="@{u.username}'s profile picture" loading="lazy" src="/uid/{u.id}/pic" class="pp20">@{u.username}</a>''')
|
||||
else:
|
||||
sanitized = re.sub('(^|\s|\n|<p>)\/?((r|u)\/\w{3,25})', r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">\2</a>', sanitized)
|
||||
|
||||
|
@ -120,7 +120,7 @@ def sanitize(sanitized, noimages=False, alert=False):
|
|||
if noimages:
|
||||
sanitized = sanitized.replace(i.group(0), f'{i.group(1)}<a href="/id/{u.id}">@{u.username}</a>')
|
||||
else:
|
||||
sanitized = sanitized.replace(i.group(0), f'{i.group(1)}<a href="/id/{u.id}"><img loading="lazy" src="/uid/{u.id}/pic" class="pp20">@{u.username}</a>')
|
||||
sanitized = sanitized.replace(i.group(0), f'''{i.group(1)}<a href="/id/{u.id}"><img alt="@{u.username}'s profile picture" loading="lazy" src="/uid/{u.id}/pic" class="pp20">@{u.username}</a>''')
|
||||
|
||||
|
||||
for i in re.finditer('https://i\.imgur\.com/(([^_]*?)\.(jpg|png|jpeg))', sanitized):
|
||||
|
@ -160,7 +160,7 @@ def sanitize(sanitized, noimages=False, alert=False):
|
|||
tag["loading"] = "lazy"
|
||||
tag["data-src"] = tag["src"]
|
||||
tag["src"] = "/static/assets/images/loading.webp"
|
||||
tag['alt'] = f'![]({tag["src"]})'
|
||||
tag['alt'] = f'![]({tag["data-src"]})'
|
||||
|
||||
link = soup.new_tag("a")
|
||||
link["href"] = tag["data-src"]
|
||||
|
@ -203,10 +203,10 @@ def sanitize(sanitized, noimages=False, alert=False):
|
|||
classes = 'class="emoji-lg" '
|
||||
remoji = emoji[1:]
|
||||
elif emoji.startswith("!"):
|
||||
classes = 'height=60 class="emoji-md mirrored" '
|
||||
classes = 'class="emoji-md mirrored" '
|
||||
remoji = emoji[1:]
|
||||
else:
|
||||
classes = 'height=60 class="emoji-md" '
|
||||
classes = 'class="emoji-md" '
|
||||
remoji = emoji
|
||||
|
||||
if path.isfile(f'files/assets/images/emojis/{remoji}.webp'):
|
||||
|
@ -221,11 +221,11 @@ def sanitize(sanitized, noimages=False, alert=False):
|
|||
if emoji.startswith("!"):
|
||||
emoji = emoji[1:]
|
||||
if path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
|
||||
sanitized = re.sub(f'(?<!"):!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" height=30 class="emoji mirrored" src="/static/assets/images/emojis/{emoji}.webp">', sanitized, flags=re.I)
|
||||
sanitized = re.sub(f'(?<!"):!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" class="emoji mirrored" src="/static/assets/images/emojis/{emoji}.webp">', sanitized, flags=re.I)
|
||||
marseys_used.add(emoji)
|
||||
|
||||
elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
|
||||
sanitized = re.sub(f'(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=30 class="emoji" src="/static/assets/images/emojis/{emoji}.webp">', sanitized, flags=re.I)
|
||||
sanitized = re.sub(f'(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" class="emoji" src="/static/assets/images/emojis/{emoji}.webp">', sanitized, flags=re.I)
|
||||
marseys_used.add(emoji)
|
||||
|
||||
sanitized = sanitized.replace("https://www.", "https://").replace("https://youtu.be/", "https://youtube.com/watch?v=").replace("https://music.youtube.com/watch?v=", "https://youtube.com/watch?v=").replace("https://open.spotify.com/", "https://open.spotify.com/embed/").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/watch?v=").replace("https://mobile.twitter", "https://twitter").replace("https://m.facebook", "https://facebook").replace("m.wikipedia.org", "wikipedia.org").replace("https://m.youtube", "https://youtube")
|
||||
|
@ -277,10 +277,10 @@ def filter_emojis_only(title):
|
|||
if emoji.startswith("!"):
|
||||
emoji = emoji[1:]
|
||||
if path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
|
||||
title = re.sub(f'(?<!"):!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" height=30 src="/static/assets/images/emojis/{emoji}.webp" class="emoji mirrored">', title, flags=re.I)
|
||||
title = re.sub(f'(?<!"):!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" src="/static/assets/images/emojis/{emoji}.webp" class="emoji mirrored">', title, flags=re.I)
|
||||
|
||||
elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
|
||||
title = re.sub(f'(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=30 class="emoji" src="/static/assets/images/emojis/{emoji}.webp">', title, flags=re.I)
|
||||
title = re.sub(f'(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" class="emoji" src="/static/assets/images/emojis/{emoji}.webp">', title, flags=re.I)
|
||||
|
||||
if len(title) > 1500: abort(400)
|
||||
else: return title
|
|
@ -256,7 +256,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
|
||||
if sort == "hot":
|
||||
ti = int(time.time()) + 3600
|
||||
posts = posts.order_by(-1000000*(Submission.realupvotes + 1 + Submission.comment_count/5)/(func.power(((ti - Submission.created_utc)/1000), 1.35)))
|
||||
posts = posts.order_by(-1000000*(Submission.realupvotes + 1 + Submission.comment_count/5)/(func.power(((ti - Submission.created_utc)/1000), 1.23)))
|
||||
elif sort == "new":
|
||||
posts = posts.order_by(Submission.created_utc.desc())
|
||||
elif sort == "old":
|
||||
|
|
|
@ -1037,7 +1037,12 @@ def submit_post(v):
|
|||
if request.headers.get("Authorization"): return {"error": "File type not allowed"}, 400
|
||||
return render_template(f"{template}submit.html", v=v, error="File type not allowed.", title=title, body=request.values.get("body", "")), 400
|
||||
|
||||
if not new_post.thumburl and new_post.url and request.headers.get('cf-ipcountry')!="T1": gevent.spawn( thumbnail_thread, new_post.id)
|
||||
|
||||
if not new_post.thumburl and new_post.url:
|
||||
if request.host in new_post.url or new_post.url.startswith('/') or request.host == 'rdrama.net' and 'rdrama' in new_post.url:
|
||||
new_post.thumburl = '/static/assets/images/{site_name}/site_preview.webp'
|
||||
elif request.headers.get('cf-ipcountry')!="T1":
|
||||
gevent.spawn( thumbnail_thread, new_post.id)
|
||||
|
||||
if not new_post.private:
|
||||
|
||||
|
@ -1162,8 +1167,13 @@ def submit_post(v):
|
|||
|
||||
g.db.commit()
|
||||
|
||||
|
||||
if request.headers.get("Authorization"): return new_post.json
|
||||
else: return redirect(new_post.permalink)
|
||||
else:
|
||||
if 'megathread' in new_post.title.lower(): sort = 'new'
|
||||
else: sort = v.defaultsortingcomments
|
||||
new_post.replies = [c]
|
||||
return render_template('submission.html', v=v, p=new_post, sort=sort, render_replies=True, offset=0, success=True)
|
||||
|
||||
|
||||
@app.post("/delete_post/<pid>")
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -39,7 +39,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script src="/static/assets/js/bootstrap.js?a=3"></script>
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -32,13 +32,13 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
{% endif %}
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<meta name="thumbnail" content="/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3">
|
||||
<meta name="thumbnail" content="/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1">
|
||||
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{'SITE_NAME' | app_config}}/icon.webp?a=8">
|
||||
{% block title %}
|
||||
|
@ -47,7 +47,7 @@
|
|||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta property="og:url" content="{{request.path | full_link}}">
|
||||
<meta property="og:description" name="description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="@{{request.host_url}}" >
|
||||
|
@ -58,7 +58,7 @@
|
|||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta name="twitter:creator" content="@{{request.host_url}}">
|
||||
<meta name="twitter:description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta name="twitter:url" content="{{request.path | full_link}}" >
|
||||
{% endblock %}
|
||||
|
||||
|
@ -227,11 +227,11 @@
|
|||
|
||||
{% if v %}
|
||||
<a href="{% if request.host == 'rdrama.net' %}https://secure.transequality.org/site/Donation2?df_id=1480{% else %}/{% endif %}">
|
||||
<img class="banner" alt="site banner" src="/static/assets/images/{{'SITE_NAME' | app_config}}/banner.webp?a=8" width="100%">
|
||||
<img class="banner" alt="site banner" src="/static/assets/images/{{'SITE_NAME' | app_config}}/banner.webp?a=9" width="100%">
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="/login">
|
||||
<img class="banner" alt="site banner" src="/static/assets/images/{{'SITE_NAME' | app_config}}/cached.webp?a=6" width="100%">
|
||||
<img class="banner" alt="site banner" src="/static/assets/images/{{'SITE_NAME' | app_config}}/cached.webp?a=7" width="100%">
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -30,7 +30,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% endblock %}
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="@{{request.host_url}}" >
|
||||
|
@ -29,12 +29,12 @@
|
|||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta name="twitter:creator" content="@{{request.host_url}}">
|
||||
<meta name="twitter:description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}" >
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta name="twitter:url" content="{{request.host}}" >
|
||||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<meta name="author" content="">
|
||||
<meta name="thumbnail" content="/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3">
|
||||
<meta name="thumbnail" content="/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1">
|
||||
<link rel="icon" type="image/png" href="/static/assets/images/{{'SITE_NAME' | app_config}}/icon.webp?a=8">
|
||||
|
||||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta property="og:url" content="{{request.path | full_link}}">
|
||||
<meta property="og:description" name="description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="{{request.host_url}}" >
|
||||
|
@ -29,7 +29,7 @@
|
|||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta name="twitter:creator" content="{{request.host_url}}">
|
||||
<meta name="twitter:description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta name="twitter:image" content="/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta name="twitter:url" content="{{request.path | full_link}}" >
|
||||
|
||||
|
||||
|
@ -39,10 +39,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
{% endif %}
|
||||
</head>
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="{{request.host_url}}" >
|
||||
|
@ -25,13 +25,13 @@
|
|||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta name="twitter:creator" content="{{request.host_url}}">
|
||||
<meta name="twitter:description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}" >
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta name="twitter:url" content="{{request.host}}" >
|
||||
|
||||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<meta property="og:type" content="article" >
|
||||
<meta property="og:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta property="og:site_name" content="{{request.host}}" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta property="og:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta property="og:url" content="{{request.host}}">
|
||||
<meta property="og:description" name="description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}">
|
||||
<meta property="og:author" name="author" content="{{request.host_url}}" >
|
||||
|
@ -26,13 +26,13 @@
|
|||
<meta name="twitter:title" content="{{'SITE_NAME' | app_config}}" >
|
||||
<meta name="twitter:creator" content="{{request.host_url}}">
|
||||
<meta name="twitter:description" content="{{'SITE_NAME' | app_config}} - {{'SLOGAN' | app_config}}" >
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.webp?a=3" >
|
||||
<meta name="twitter:image" content="{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/site_preview.webp?a=1" >
|
||||
<meta name="twitter:url" content="{{request.host}}" >
|
||||
|
||||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -13,6 +13,14 @@
|
|||
|
||||
{% block title %}
|
||||
|
||||
{% if success %}
|
||||
<script data-cfasync="false">
|
||||
history.pushState(null, null, '{{p.permalink | full_link}}');
|
||||
window.localStorage.setItem("post_title", "")
|
||||
window.localStorage.setItem("post_text", "")
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("wholesome") %}
|
||||
<style>
|
||||
.seal {
|
||||
|
@ -149,10 +157,6 @@
|
|||
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb%}{{p.thumb_url}}{% else %}{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.gif{% endif %}" >
|
||||
<meta name="twitter:url" content="{{p.permalink | full_link}}" >
|
||||
|
||||
{% if linked_comment.author.is_private %}
|
||||
<meta name="robots" content="noindex">
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<title>{{p.plaintitle(v)}} - {{'SITE_NAME' | app_config}}</title>
|
||||
|
||||
|
@ -178,10 +182,6 @@
|
|||
<meta name="twitter:image" content="{% if p.is_image %}{{p.realurl(v)}}{% elif p.has_thumb %}{{p.thumb_url}}{% else %}{{'SITE_NAME' | app_config}}/static/assets/images/{{'SITE_NAME' | app_config}}/preview.gif{% endif %}" >
|
||||
<meta name="twitter:url" content="{{p.permalink | full_link}}" >
|
||||
|
||||
{% if p.author.is_private %}
|
||||
<meta name="robots" content="noindex">
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=11">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -50,7 +50,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=71">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=72">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=3">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -199,11 +199,49 @@
|
|||
document.getElementById('post-title').value = fetched_title
|
||||
let fetched_text = window.localStorage.getItem("post_text")
|
||||
document.getElementById('post-text').value = fetched_text
|
||||
|
||||
function checkForRequired() {
|
||||
|
||||
var title = document.getElementById("post-title");
|
||||
|
||||
var url = document.getElementById("post-URL");
|
||||
|
||||
var text = document.getElementById("post-text");
|
||||
|
||||
var button = document.getElementById("create_button");
|
||||
|
||||
var image = document.getElementById("file-upload");
|
||||
|
||||
if (url.value.length > 0 || image.value.length > 0) {
|
||||
text.required = false;
|
||||
url.required=false;
|
||||
} else if (text.value.length > 0 || image.value.length > 0) {
|
||||
url.required = false;
|
||||
} else {
|
||||
text.required = true;
|
||||
url.required = true;
|
||||
}
|
||||
|
||||
var isValidTitle = title.checkValidity();
|
||||
|
||||
var isValidURL = url.checkValidity();
|
||||
|
||||
var isValidText = text.checkValidity();
|
||||
|
||||
if (isValidTitle && (isValidURL || image.value.length>0)) {
|
||||
button.disabled = false;
|
||||
} else if (isValidTitle && isValidText) {
|
||||
button.disabled = false;
|
||||
} else {
|
||||
button.disabled = true;
|
||||
}
|
||||
}
|
||||
checkForRequired()
|
||||
</script>
|
||||
|
||||
<script src="/static/assets/js/marked.js?a=3"></script>
|
||||
<script src="/static/assets/js/formatting.js?a=3"></script>
|
||||
<script src="/static/assets/js/submit.js?a=4"></script>
|
||||
<script src="/static/assets/js/submit.js?a=5"></script>
|
||||
{% include "emoji_modal.html" %}
|
||||
{% include "gif_modal.html" %}
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
<link rel="stylesheet" href="/@{{u.username}}/profilecss">
|
||||
{% endif %}
|
||||
<title>{{u.username}}'s profile - {{'SITE_NAME' | app_config}}</title>
|
||||
{% if u.is_private %}
|
||||
<meta name="robots" content="noindex">
|
||||
{% endif %}
|
||||
<meta property="og:article:author" content="@{{u.username}}" >
|
||||
<meta property="article:section" content="{{u.username}}'s profile - {{'SITE_NAME' | app_config}}" >
|
||||
<meta property="article:published_time" content="{{u.created_date}}" >
|
||||
|
|
Loading…
Reference in New Issue