Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

remotes/1693045480750635534/spooky-22
Aevann1 2022-08-16 17:42:48 +00:00
commit da96603c5a
10 changed files with 69 additions and 56 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -21,8 +21,11 @@ def normalize_urls_runtime(body, v):
if v and v.reddit != 'old.reddit.com':
body = reddit_to_vreddit_regex.sub(rf'\1https://{v.reddit}/\2/', body)
if v.nitter: body = twitter_to_nitter_regex.sub(r'https://nitter.42l.fr/\1', body)
if v.imginn: body = body.replace('https://instagram.com/', 'https://imginn.com/')
if v.nitter:
body = body.replace('https://twitter.com/', 'https://nitter.42l.fr/')
body = body.replace('https://nitter.42l.fr/i/', 'https://twitter.com/i/')
if v.imginn:
body = body.replace('https://instagram.com/', 'https://imginn.com/')
return body

View File

@ -998,6 +998,11 @@ tiers={
"(JIDF Bankroller)": 6,
"(Rich Bich)": 7,
"(LlamaBean)": 1,
"(Victim)": 1,
"(Corpse)": 2,
"(Zombie)": 3,
"(Ghost)": 4,
"(Survivor)": 5,
}
DISCORD_WELCOME_CHANNEL = "846509313941700618"

View File

@ -90,8 +90,6 @@ greentext_regex = re.compile("(\n|^)>([^ >][^\n]*)", flags=re.A)
ascii_only_regex = re.compile("[ -~]+", flags=re.A)
twitter_to_nitter_regex = re.compile("https:\/\/twitter.com\/(\w{2,15}(\/status\/\d+[^/]*)?)", flags=re.A)
reddit_to_vreddit_regex = re.compile('(^|>|")https:\/\/old.reddit.com\/(r|u)\/', flags=re.A)
reddit_domain_regex = re.compile("(^|\s|\()https?:\/\/(reddit\.com|new\.reddit.com|www\.reddit.com|i\.reddit\.com|libredd\.it|teddit\.net)\/(r|u)\/", flags=re.A)

View File

@ -900,6 +900,10 @@ def settings_pronouns_change(v):
if not pronouns_regex.fullmatch(pronouns):
return render_template("settings_profile.html", v=v, error="The pronouns you entered don't match the required format.")
bare_pronouns = pronouns.lower().replace('/', '')
if 'nig' in bare_pronouns: pronouns = 'BI/POC'
elif 'fag' in bare_pronouns: pronouns = 'cute/twink'
v.pronouns = pronouns
g.db.add(v)

View File

@ -169,7 +169,7 @@
<a class="nav-link position-relative" href="/chat">
<i class="fas fa-messages" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Chat"></i>
<b class="text-lg" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now">
{{cache.get(ONLINE_STR) or 0}}
{{cache.get(ONLINE_STR) or 1}}
</b>
</a>
</li>

View File

@ -14,7 +14,7 @@
),
(
'Submit Marseys',
'For original Marseys or other emoji.',
'For original Marseys or other emojis.',
'fa-cat', '#ffa500',
'/post/16583',
),

View File

@ -51,7 +51,7 @@
<button class="col px-0 btn btn-dead m-0 pt-0" style="background: None !important; border: None;">
<a href="/chat" class="text-decoration-none" role="button">
<div class="text-center {% if request.path=='/chat' %}text-primary{% else %}text-muted{% endif %}">
<b class="text-lg" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now">{{cache.get(ONLINE_STR) or 0}}</b>
<b class="text-lg" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now">{{cache.get(ONLINE_STR) or 1}}</b>
<div class="text-small">Chat</div>
</div>
</a>

View File

@ -6,10 +6,8 @@
<title>Search for "{{query}}" - {{SITE_NAME}}"</title> <meta name="description" content="{{total}} result{{'s' if total != 1 else ''}}">
{% endblock %}
{% block PseudoSubmitForm %}{% endblock %}
{% block navbar %}
<form class="form-inline search flex-nowrap mx-0 mx-lg-auto" action="/search/{% if '/posts' in request.path %}posts{% elif '/comments' in request.path %}comments{% else %}users{% endif %}" method="get" style="padding-top:42px">
{% block PseudoSubmitForm %}
<form class="form-inline search flex-nowrap mx-0 mx-lg-auto mt-1" action="/search/{% if '/posts' in request.path %}posts{% elif '/comments' in request.path %}comments{% else %}users{% endif %}" method="get">
<input autocomplete="off" class="form-control w-100" type="search" placeholder="Search" aria-label="Search" name="q" value="{{query}}">
<span class="input-group-append">
<span class="input-group-text border-0 bg-transparent" style="margin-left: -2.5rem;">
@ -17,8 +15,47 @@
</span>
</span>
</form>
{% endblock %}
{% block navbar %}
{% endblock %}
{% block content %}
<div class="row no-gutters my-md-3">
<div class="col">
<div class="card search-results">
<div class="card-header bg-white d-none">
<ul class="list-inline no-bullets mb-0">
<li class="list-inline-item active mr-4"><i class="fas fa-align-left text-gray-400"></i></li>
<li class="list-inline-item"><i class="fas fa-link text-gray-400"></i></li>
</ul>
</div>
<div class="card-body pb-2">
<div class="pl-md-3">
{% if not request.path.startswith('/search/users') %}
<strong>Advanced search parameters (with examples)</strong>
<ul class="mt-2">
<li class="mb-1">author:quadnarca</li>
<li class="mb-1">domain:reddit.com</li>
<li class="mb-1">over18:true</li>
<li class="mb-1">{{HOLE_NAME}}:music</li>
<li class="mb-1">before:1660590018</li>
<li class="mb-1">after:1660590018</li>
{% if request.path.startswith('/search/comments') %}
<li class="mb-1">post:504</li>
{% endif %}
</ul>
<br>
{% endif %}
<div class="text-muted text-small mb-1">Showing {% block listinglength %}{{listing | length}}{% endblock %} of {{total}} result{{'s' if total != 1 else ''}} for</div>
<h1 class="h4 mb-0">{{query}}</h1>
{% if not '/users' in request.path %}
<div class="mt-5 d-flex align-items-center">
<div class="mt-3 d-flex align-items-center" style="float:right">
<div class="dropdown dropdown-actions">
<button class="btn btn-secondary dropdown-toggle" role="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if t=="hour" %}<i class="fas fa-clock mr-1"></i>
@ -61,41 +98,7 @@
</div>
</div>
{% endif %}
{% endblock %}
{% block content %}
<div class="row no-gutters my-md-3">
<div class="col">
<div class="card search-results">
<div class="card-header bg-white d-none">
<ul class="list-inline no-bullets mb-0">
<li class="list-inline-item active mr-4"><i class="fas fa-align-left text-gray-400"></i></li>
<li class="list-inline-item"><i class="fas fa-link text-gray-400"></i></li>
</ul>
</div>
<div class="card-body">
<div class="pl-md-3">
{% if not request.path.startswith('/search/users') %}
<strong>Advanced search parameters (with examples)</strong>
<ul class="mt-2">
<li class="mb-1">author:quadnarca</li>
<li class="mb-1">domain:reddit.com</li>
<li class="mb-1">over18:true</li>
<li class="mb-1">{{HOLE_NAME}}:music</li>
<li class="mb-1">before:1660590018</li>
<li class="mb-1">after:1660590018</li>
{% if request.path.startswith('/search/comments') %}
<li class="mb-1">post:504</li>
{% endif %}
</ul>
<br>
{% endif %}
<div class="text-muted text-small mb-1">Showing {% block listinglength %}{{listing | length}}{% endblock %} of {{total}} result{{'s' if total != 1 else ''}} for</div>
<h1 class="h4 mb-0">{{query}}</h1>
</div>
</div>

View File

@ -725,7 +725,7 @@
{% if p.realurl(v) %}
{% if not p.embed_url and not p.is_image %}
<a rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}" {% if not v or v.newtabexternal %}target="_blank"{% endif %}>
<div class="d-flex d-md-none justify-content-between align-items-center border rounded p-2{% if p.realbody(v) %} mb-3{% endif %}">
<div class="d-flex {% if p.is_video or p.is_audio %}d-md-none{% endif %} justify-content-between align-items-center border rounded p-2{% if p.realbody(v) %} mb-3{% endif %}">
<span>{{p.realurl(v)}}</span>
<i class="fas fa-external-link-alt text-small"></i>
</div>