remotes/1693045480750635534/spooky-22
Aevann1 2022-01-11 00:43:00 +02:00
parent 8d96b01dd1
commit 0f2eb87e31
10 changed files with 24 additions and 18 deletions

View File

@ -39,6 +39,8 @@ class CustomRenderer(HTMLRenderer):
user = get_user(target, graceful=True)
if not user: return f"{space}@{target}"
return f'''{space}<a href="/id/{user.id}"><img alt="@{user.username}'s profile picture" loading="lazy" src="/uid/{user.id}/pic" class="pp20">@{user.username}</a>'''
def render_sub_mention(self, token):
@ -64,6 +66,8 @@ class Renderer(HTMLRenderer):
user = get_user(target, graceful=True)
if not user: return f"{space}@{target}"
return f'{space}<a href="/id/{user.id}">@{user.username}</a>'
def render_sub_mention(self, token):

View File

@ -401,9 +401,9 @@ def edit_post(pid, v):
if p.author_id != v.id and not (v.admin_level > 1 and v.admin_level > 2): abort(403)
title = request.values.get("title", "").strip()
title = request.values.get("title", "").strip().replace('','')
body = request.values.get("body", "").strip()
body = request.values.get("body", "").strip().replace('','')
if len(body) > 10000: return {"error":"Character limit is 10000!"}, 403
@ -691,14 +691,14 @@ def submit_post(v):
if not v or v.oldsite: template = ''
else: template = 'CHRISTMAS/'
title = request.values.get("title", "").strip()[:500]
title = request.values.get("title", "").strip()[:500].replace('','')
url = request.values.get("url", "").strip()
if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username)
title_html = filter_emojis_only(title)
body = request.values.get("body", "").strip()
body = request.values.get("body", "").strip().replace('','')
if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', title_html))) > 0: return {"error":"You can only type marseys!"}, 40

View File

@ -67,6 +67,7 @@ def searchposts(v):
if 'author' in criteria:
author = get_user(criteria['author'])
if not author: return {"error": f"User not found"}
if author.is_private and v.admin_level < 2 and not v.eye:
if request.headers.get("Authorization"):
return {"error": f"@{author.username}'s profile is private; You can't use the 'author' syntax on them"}
@ -214,6 +215,7 @@ def searchcomments(v):
if 'author' in criteria:
author = get_user(criteria['author'])
if not author: return {"error": f"User not found"}
if author.is_private and v.admin_level < 2 and not v.eye:
if request.headers.get("Authorization"):
return {"error": f"@{author.username}'s profile is private; You can't use the 'author' syntax on them"}

View File

@ -210,7 +210,7 @@
{% if c.author.verified %}<i class="fas fa-badge-check align-middle ml-1" style="color:{% if c.author.verifiedcolor %}#{{c.author.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{c.author.verified}}"></i>
{% endif %}
<a class="user-name text-decoration-none" onclick='popclick({{c.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="focus" data-content-id="popover" role="button" tabindex="0" style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;"><img alt="@{{c.author.username}}'s profile picture" loading="lazy" data-src="{{c.author.profile_url}}" src="/static/assets/images/loading.webp" class="profile-pic-25 mr-2"><span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.namecolor}};"{% elif c.distinguish_level and request.host == 'rdrama.net' %}class="mod"{% endif %}>{{c.author.username}}</span></a>
<a class="user-name text-decoration-none" onclick='popclick({{c.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="focus" data-content-id="popover" role="button" tabindex="0" style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;"><img alt="@{{c.author.username}}'s profile picture" loading="lazy" src="{{c.author.profile_url}}" class="profile-pic-25 mr-2"><span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.namecolor}};"{% elif c.distinguish_level and request.host == 'rdrama.net' %}class="mod"{% endif %}>{{c.author.username}}</span></a>
{% if c.author.customtitle %}&nbsp;<bdi style="color: #{{c.author.titlecolor}}">&nbsp;{% if c.author.quadrant %}<img alt="{{c.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{c.author.quadrant}}.webp?a=3">{% endif %}{{c.author.customtitle | safe}}</bdi>{% endif %}
{% if c.parent_comment_id and not standalone and level != 1 %}<a href="#comment-{{ c.parent_comment_id }}-only" class="text-muted ml-2"><i class="fas fa-reply fa-sm fa-fw fa-flip-horizontal mr-1"></i>{{ c.parent_comment.author.username }}</a>{% endif %}

View File

@ -54,7 +54,7 @@ You can use Markdown formatting:
<tr>
<td>Images</td>
<td>https://i.imgur.com/Lf6dfPO.jpg</td>
<td><img alt="example image" src="https://i.imgur.com/Lf6dfPO.jpg"></td>
<td><img loading="lazy" alt="example image" src="https://i.imgur.com/Lf6dfPO.jpg"></td>
</tr>
<tr>
<td>Youtube Videos</td>
@ -445,7 +445,7 @@ line breaks
&lt;img src="https://i.imgur.com/SwVuagI_d.webp" width="200"&gt;
</td>
<td>
<img alt="example image" src="https://i.imgur.com/SwVuagI_d.webp" width="200">
<img loading="lazy" alt="example image" src="https://i.imgur.com/SwVuagI_d.webp" width="200">
</td>
</tr>
</tbody>

View File

@ -95,8 +95,8 @@
<div><img alt="your profile picture" loading="lazy" src="{{v.profile_url}}" class="profile-pic-35"></div>
<div class="text-left pl-2">
<div style="color: #{{v.namecolor}}" class="text-small font-weight-bold {% if v.patron %}patron{% endif %}"><span {% if v.patron %}class="patron" style="background-color:#{{v.namecolor}}"{% endif %}>{{v.username}}</span></div>
<div class="text-small-extra text-primary"><img alt="{{'COINS_NAME' | app_config}}" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/static/assets/images/emojis/marseycoin.webp" data-bs-original-title="{{'COINS_NAME' | app_config}}" aria-label="{{'COINS_NAME' | app_config}}"><span id="user-coins-amount">{{v.coins}}</span> {{'COINS_NAME' | app_config}}</div>
<div class="text-small-extra text-primary"><img alt="marseybux" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/static/assets/images/emojis/marseybux.webp" data-bs-original-title="Marseybux" aria-label="Marseybux"><span id="user-bux-amount">{{v.procoins}}</span> Marseybux</div>
<div class="text-small-extra text-primary"><img alt="{{'COINS_NAME' | app_config}}" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/static/assets/images/marseycoin.webp" data-bs-original-title="{{'COINS_NAME' | app_config}}" aria-label="{{'COINS_NAME' | app_config}}"><span id="user-coins-amount">{{v.coins}}</span> {{'COINS_NAME' | app_config}}</div>
<div class="text-small-extra text-primary"><img alt="marseybux" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/static/assets/images/marseybux.webp" data-bs-original-title="Marseybux" aria-label="Marseybux"><span id="user-bux-amount">{{v.procoins}}</span> Marseybux</div>
</div>
</div>
</a>

View File

@ -61,7 +61,7 @@
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 31px, 0px);">
<a class="dropdown-item" href="/log{% if type %}?kind={{type}}{% endif %}"><img src="/static/assets/images/emojis/marseyjanny.webp" alt="avatar" width=20 height=20 class="rounded-circle mr-2">All</a>
{% for a in admins %}
<a class="dropdown-item" href="?admin={{a}}{% if type %}&kind={{type}}{% endif %}"><img src="/@{{a}}/pic" alt="avatar" width=20 height=20 class="rounded-circle mr-2">{{a}}</a>
<a class="dropdown-item" href="?admin={{a}}{% if type %}&kind={{type}}{% endif %}"><img loading="lazy" src="/@{{a}}/pic" alt="avatar" width=20 height=20 class="rounded-circle mr-2">{{a}}</a>
{% endfor %}
</div>
</div>
@ -95,7 +95,7 @@
<div class="d-flex align-items-center justify-content-center {{ma.color}} mr-3 rounded-lg flex-shrink-0" style="width: 32px;height: 32px;"><i class="far text-center {{ma.icon}} text-lg text-white fa-fw"></i></div>
<div class="d-flex align-items-center">
<span class="rounded">
<img src="{{ma.user.profile_url}}" alt="avatar" width=42 height=42 class="rounded-circle">
<img loading="lazy" src="{{ma.user.profile_url}}" alt="avatar" width=42 height=42 class="rounded-circle">
</span>
<div class="text-muted pl-3">
<div>

View File

@ -182,7 +182,7 @@
<div class="d-flex">
<div class="title w-lg-25 text-md-center">
<img alt="your profile picture" src="{{v.profile_url}}" class="profile-pic-75">
<img loading="lazy" alt="your profile picture" src="{{v.profile_url}}" class="profile-pic-75">
</div>
<div class="body w-lg-100 my-auto">
@ -224,7 +224,7 @@
<div class="d-flex">
<div class="title w-lg-75 text-md-center">
<img alt="your banner" src="{{v.banner_url}}" class="banner-pic-135">
<img loading="lazy" alt="your banner" src="{{v.banner_url}}" class="banner-pic-135">
</div>
<div class="body w-lg-100 my-auto">

View File

@ -193,7 +193,7 @@
{% if p.active_flags %}<a class="btn btn-primary" role="button" style="padding:1px 5px; font-size:10px;" onclick="document.getElementById('flaggers-{{p.id}}').classList.toggle('d-none')">{{p.active_flags}} Reports</a>{% endif %}
{% if p.author.verified %}<i class="fas fa-badge-check align-middle ml-1" style="color:{% if p.author.verifiedcolor %}#{{p.author.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{p.author.verified}}"></i>
{% endif %}
<a class="user-name text-decoration-none" onclick='popclick({{p.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="focus" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold;"><img alt="@{{p.author.profile_url}}'s profile picture" loading="lazy" data-src="{{p.author.profile_url}}" src="/static/assets/images/loading.webp" class="profile-pic-25 mr-2"><span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level and request.host == 'rdrama.net' %}class="mod"{% endif %}>{{p.author.username}}</span></a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}">&nbsp;&nbsp;{% if p.author.quadrant %}<img alt="{{p.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{p.author.quadrant}}.webp?a=3">{% endif %}{{p.author.customtitle | safe}}</bdi>{% endif %}
<a class="user-name text-decoration-none" onclick='popclick({{p.author.json_popover(v) | tojson}})' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="focus" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold;"><img alt="@{{p.author.profile_url}}'s profile picture" loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2"><span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level and request.host == 'rdrama.net' %}class="mod"{% endif %}>{{p.author.username}}</span></a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}">&nbsp;&nbsp;{% if p.author.quadrant %}<img alt="{{p.author.quadrant}} quadrant" loading="lazy" height="20" src="/static/assets/images/quadrants/{{p.author.quadrant}}.webp?a=3">{% endif %}{{p.author.customtitle | safe}}</bdi>{% endif %}
<span data-bs-toggle="tooltip" data-bs-placement="bottom" onmouseover="timestamp('timestamp-{{p.id}}','{{p.created_utc}}')" id="timestamp-{{p.id}}">&nbsp;{{p.age_string}}</span>
&nbsp;
({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.realurl(v) %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>{{p.domain}}</a>{% else %}text post{% endif %})

View File

@ -105,10 +105,10 @@
<div class="font-weight-bolder">
<span id="profile-coins-amount">{{u.coins}}</span>
<img alt="{{'COINS_NAME' | app_config}}" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{'COINS_NAME' | app_config}}" height="20" src="/static/assets/images/emojis/marseycoin.webp?a=3">&nbsp;&nbsp;
<img alt="{{'COINS_NAME' | app_config}}" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{'COINS_NAME' | app_config}}" height="20" src="/static/assets/images/marseycoin.webp?a=3">&nbsp;&nbsp;
<span id="profile-bux-amount">{{u.procoins}}</span>
<img alt="marseybux" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Marseybux" height="20" src="/static/assets/images/emojis/marseybux.webp?a=3">&nbsp;&nbsp;
<img alt="marseybux" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Marseybux" height="20" src="/static/assets/images/marseybux.webp?a=3">&nbsp;&nbsp;
<a href="/@{{u.username}}/followers">{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}</a>&nbsp;&nbsp;
@ -380,10 +380,10 @@
<div class="font-weight-normal">
<span id="profile-coins-amount-mobile" class="font-weight-bold">{{u.coins}}</span>
<img alt="{{'COINS_NAME' | app_config}}" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{'COINS_NAME' | app_config}}" height="15" src="/static/assets/images/emojis/marseycoin.webp?a=3">&nbsp;&nbsp;
<img alt="{{'COINS_NAME' | app_config}}" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{'COINS_NAME' | app_config}}" height="15" src="/static/assets/images/marseycoin.webp?a=3">&nbsp;&nbsp;
<span id="profile-bux-amount-mobile" class="font-weight-bold">{{u.procoins}}</span>
<img alt="marseybux" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Marseybux" height="15" src="/static/assets/images/emojis/marseybux.webp?a=3">&nbsp;&nbsp;
<img alt="marseybux" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Marseybux" height="15" src="/static/assets/images/marseybux.webp?a=3">&nbsp;&nbsp;
<a href="/@{{u.username}}/followers" class="font-weight-bold">{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}</a>&nbsp;&nbsp;