master
Aevann1 2021-10-10 05:42:12 +02:00
parent 20da364d6c
commit 4dffbe4c69
18 changed files with 38 additions and 59 deletions

View File

@ -185,7 +185,7 @@ def searchcomments(v):
try: page = max(1, int(request.values.get("page", 1)))
except: page = 1
sort = request.values.get("sort", "top").lower()
sort = request.values.get("sort", "new").lower()
t = request.values.get('t', 'all').lower()
criteria=searchparse(query)
@ -203,6 +203,10 @@ def searchcomments(v):
words=tuple(words)
comments=comments.filter(*words)
if 'over18' in criteria: comments = comments.filter(Comment.over_18==True)
if 'author' in criteria: comments = comments.filter(Comment.author_id == get_user(criteria['author']).id)
if not(v and v.admin_level >= 3):
comments = comments.filter(
Comment.deleted_utc == 0,
@ -262,7 +266,7 @@ def searchusers(v):
query = request.values.get("q", '').strip()
page = max(1, int(request.values.get("page", 1)))
sort = request.values.get("sort", "top").lower()
sort = request.values.get("sort", "new").lower()
t = request.values.get('t', 'all').lower()
term=query.lstrip('@')
term=term.replace('\\','')

View File

@ -15,11 +15,11 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
{% endif %}
</head>

View File

@ -100,7 +100,7 @@
<script>
(() => {
const date = new Date('{{c.created_datetime}}');
const date = new Date({{c.created_utc*1000}});
document.getElementById('timestamp-{{c.id}}').title = date.toString();
})()
</script>

View File

@ -250,12 +250,12 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% endif %}
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
{% endif %}
{% endblock %}

View File

@ -115,11 +115,7 @@
<div class="px-2">
<a class="dropdown-item" href="/assets/{{'SITE_NAME' | app_config}}_App.apk"><i class="fab fa-android fa-fw text-left mr-3"></i>Android app</a>
{% if "rama" in request.host %}
<a class="dropdown-item" href="/post/2510/posting-guidelines-policies-legal-shit"><i class="fas fa-balance-scale fa-fw text-left mr-3"></i>Rules</a>
{% else %}
<a class="dropdown-item" href="/rules"><i class="fas fa-balance-scale fa-fw text-left mr-3"></i>Rules</a>
{% endif %}
<a class="dropdown-item" href="/rules"><i class="fas fa-balance-scale fa-fw text-left mr-3"></i>Rules</a>
<a class="dropdown-item" href="/changelog"><i class="fas fa-clipboard fa-fw text-left mr-3"></i>Changelog</a>
@ -180,11 +176,7 @@
</li>
<a class="nav-item nav-link" href="/assets/{{'SITE_NAME' | app_config}}_App.apk"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
{% if "rama" in request.host %}
<a class="nav-item nav-link" href="/post/2510/posting-guidelines-policies-legal-shit"><i class="fas fa-balance-scale fa-fw mr-3"></i>Rules</a>
{% else %}
<a class="nav-item nav-link" href="/rules"><i class="fas fa-balance-scale fa-fw mr-3"></i>Rules</a>
{% endif %}
<a class="nav-item nav-link" href="/rules"><i class="fas fa-balance-scale fa-fw mr-3"></i>Rules</a>
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/Drama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>

View File

@ -17,11 +17,11 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
{% endif %}
<div class="row justify-content-around">

View File

@ -15,7 +15,7 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
</head>

View File

@ -12,7 +12,7 @@
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
</head>

View File

@ -55,8 +55,8 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
<link href="/assets/css/fa.css?v=52" rel="stylesheet">
</head>

View File

@ -40,10 +40,10 @@
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
{% endif %}
<link href="/assets/css/fa.css?v=52" rel="stylesheet">

View File

@ -21,7 +21,7 @@
<form id="profile-settings" action="/settings/css" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<textarea class="form-control rounded" id="bio-text" aria-label="With textarea" placeholder="Custom CSS" rows="50" name="css" form="profile-settings" maxlength="50000">{% if v.css %}{{v.css}}{% endif %}</textarea>
<small>Limit of 50000 characters</small>
<small>Limit of 4000 characters</small>
<div class="d-flex mt-2">
<input id="submit-btn" class="btn btn-primary ml-auto" type="submit" value="Save">
</div>

View File

@ -6,7 +6,7 @@
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}
<script src="/assets/js/settings_profile.js?v=51"></script>
<script src="/assets/js/settings_profile.js?v=52"></script>
<div id="posts" class="row">

View File

@ -21,7 +21,7 @@
<form id="profile-settings" action="/settings/profilecss" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<textarea class="form-control rounded" id="bio-text" aria-label="With textarea" placeholder="Custom profile css" rows="50" name="profilecss" form="profile-settings" maxlength="50000">{% if v.profilecss %}{{v.profilecss}}{% endif %}</textarea>
<small>Limit of 50000 characters</small>
<small>Limit of 4000 characters</small>
<div class="d-flex mt-2">
<input class="btn btn-primary ml-auto" type="submit" value="Save">
</div>

View File

@ -36,7 +36,7 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
</head>

View File

@ -31,7 +31,7 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
</head>

View File

@ -667,12 +667,7 @@
<div id="filename-show-reply-{{p.id}}"><i class="far fa-image"></i></div>
<input id="file-upload-reply-{{p.fullname}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-show-reply-{{p.id}}').innerHTML='image';" hidden>
</label>
<!-- &nbsp;&nbsp;
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="nsfwCheck-{{p.fullname}}" name="over_18" form="reply-to-{{p.fullname}}">
<label class="custom-control-label" for="nsfwCheck">+18</label>
</div>
--> <a id="save-reply-to-{{p.fullname}}" href="javascript:void(0)" form="reply-to-{{p.fullname}}" class="btn btn-primary text-whitebtn ml-auto" onclick="post_comment('{{p.fullname}}', '{{p.id}}')">Comment</a>
<a id="save-reply-to-{{p.fullname}}" href="javascript:void(0)" form="reply-to-{{p.fullname}}" class="btn btn-primary text-whitebtn ml-auto" onclick="post_comment('{{p.fullname}}', '{{p.id}}')">Comment</a>
</div>
</form>
</div>
@ -682,7 +677,7 @@
<textarea class="comment-box form-control rounded" name="body" aria-label="With textarea" placeholder="Add your comment..." rows="3" onclick="location.href='/login?redirect={{request.path | urlencode}}';"></textarea>
</div>
{% if p.comment_count >= 2 %}
<div class="card border-0 bg-light mt-4">
<div class="card border-0 mt-4">
<div class="card-body">
<h5 class="card-title">Jump in the discussion.</h5>
<p class="card-text">No email address required.</p>

View File

@ -25,11 +25,11 @@
{% block stylesheets %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% endif %}
<link rel="stylesheet" href="/assets/css/main.css?v=63"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62">
<link rel="stylesheet" href="/assets/css/main.css?v=63">
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
{% endif %}
{% endblock %}

View File

@ -1,26 +1,14 @@
{% extends "default.html" %}
{% if u and u.profilecss %}
{% block stylesheets %}
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=62">
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css?v=62">{% endif %}
{% else %}
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=62"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=62">
{% endif %}
{% if u and u.profilecss %}
<link rel="stylesheet" href="/@{{u.username}}/profilecss">
{% endif %}
{% endblock %}
{% endif %}
{% block pagetype %}userpage{% endblock %}
{% block title %}
{% if u and u.profilecss %}
<link rel="stylesheet" href="/@{{u.username}}/profilecss">
{% endif %}
<style>
.wtf {
object-fit: cover !important;