Merge branch 'master' into regex-sensor-v2

remotes/1693045480750635534/spooky-22
Aevann1 2021-10-19 18:23:19 +02:00 committed by GitHub
commit 258bef191a
9 changed files with 27 additions and 32 deletions

7
fd
View File

@ -1,7 +0,0 @@
git pull
git add .
git commit -m "sneed"
git push
cd /media/a/Files/1
git pull

View File

@ -300,7 +300,9 @@ class Comment(Base):
if not body: return ""
t = time.time()
body = censor_slurs(body, v)
print(time.time() - t)
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")

View File

@ -317,22 +317,22 @@ def award_comment(cid, v):
send_notification(NOTIFICATIONS_ACCOUNT, c.author, msg)
if kind == "ban":
author = comment.author
link = f"[this comment]({comment.permalink})"
author = c.author
link = f"[this comment]({c.permalink})"
if not author.is_suspended:
author.ban(reason=f"one-day ban award used by @{v.username} on /comment/{comment.id}", days=1)
author.ban(reason=f"one-day ban award used by @{v.username} on /comment/{c.id}", days=1)
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for a day for {link}. It sucked and you should feel bad.")
elif author.unban_utc > 0:
author.unban_utc += 24*60*60
g.db.add(author)
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended for yet another day for {link}. Seriously man?")
elif kind == "grass":
author = comment.author
author = c.author
author.is_banned = AUTOJANNY_ACCOUNT
author.ban_reason = f"grass award used by @{v.username} on /comment/{comment.id}"
author.ban_reason = f"grass award used by @{v.username} on /comment/{c.id}"
g.db.add(author)
link = f"[this comment]({comment.permalink})"
link = f"[this comment]({c.permalink})"
send_notification(NOTIFICATIONS_ACCOUNT, author, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
c.author.received_award_count += 1

View File

@ -853,16 +853,14 @@ def settings_title_change(v):
new_name=request.values.get("title").strip()[:100].replace("𒐪","")
if new_name==v.customtitle:
return render_template("settings_profile.html",
v=v,
error="You didn't change anything")
if new_name==v.customtitle: return render_template("settings_profile.html", v=v, error="You didn't change anything")
v.customtitleplain = new_name
v.customtitle = filter_title(new_name)
g.db.add(v)
g.db.commit()
if len(v.customtitle) < 1000:
g.db.add(v)
g.db.commit()
return redirect("/settings/profile")

View File

@ -160,6 +160,7 @@ def patrons(v):
return render_template("patrons.html", v=v, result=result)
@app.get("/admins")
@app.get("/badmins")
@auth_desired
def admins(v):
admins = g.db.query(User).options(lazyload('*')).filter_by(admin_level=6).order_by(User.coins.desc()).all()
@ -167,6 +168,7 @@ def admins(v):
@app.get("/log")
@app.get("/modlog")
@auth_desired
def log(v):
@ -215,6 +217,8 @@ def api(v):
return render_template("api.html", v=v)
@app.get("/contact")
@app.get("/press")
@app.get("/media")
@auth_required
def contact(v):

View File

@ -48,7 +48,7 @@
{% else %}
<a class="mobile-nav-icon d-md-none" href="/login"><i class="fas fa-feather-alt align-middle text-gray-500 black"></i></a>
{% endif %}
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive"
<button class="navbar-toggler pr-1" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive"
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon {% if v and v.notifications_count %}position-relative{% endif %}"><i class="fal fa-bars text-gray-500 black"></i>
{% if v and v.notifications_count %}

View File

@ -310,7 +310,7 @@
{% if not p.is_image and p.thumb_url and not p.embed_url %}
<div class="card-header bg-transparent border-0 d-none d-md-flex flex-row flex-nowrap pl-3 p-0">
<a rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}" style="height: fit-content;" {% if not v or v.newtabexternal %}target="_blank"{% endif %}><img loading="lazy" src="{{p.thumb_url}}" class="post-img d-none d-md-block" alt="Unable to load image"></a>
<a rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}" style="height: fit-content;" {% if not v or v.newtabexternal %}target="_blank"{% endif %}><img loading="lazy" src="/assets/images/loading.gif" data-src="{{p.thumb_url}}" class="post-img d-none d-md-block" alt="Unable to load image"></a>
</div>
{% endif %}

View File

@ -140,19 +140,19 @@
<img loading="lazy" src="/assets/images/emojis/marseyglow.webp" class="post-img">
{% elif not p.url %}
<a {% if v and v.newtab %}target="_blank"{% endif %} {% if v %}href="{{p.permalink}}"{% else %}href="/logged_out{{p.permalink}}"{% endif %}>
<img loading="lazy" src="{{p.thumb_url}}" class="post-img">
<img loading="lazy" src="/assets/images/loading.gif" data-src="{{p.thumb_url}}" class="post-img">
</a>
{% elif p.is_image %}
<a href="javascript:void(0)" data-bs-toggle="modal" data-bs-target="#expandImageModal" data-bs-url="{{p.realurl(v)}}" onclick="expandDesktopImage('{{ p.realurl(v) }}')">
<img loading="lazy" src="{{p.thumb_url}}" class="post-img">
<img loading="lazy" src="/assets/images/loading.gif" data-src="{{p.thumb_url}}" class="post-img">
</a>
{% elif (p.url and p.url.lower().endswith('.mp4')) or (p.embed_url and "youtu" in p.domain) or (p.url and "streamable.com/e/" in p.url) %}
<a href="javascript:void(0)" onclick="document.getElementById('video-{{p.id}}').classList.toggle('d-none')">
<img loading="lazy" src="{{p.thumb_url}}" class="post-img">
<img loading="lazy" src="/assets/images/loading.gif" data-src="{{p.thumb_url}}" class="post-img">
</a>
{% else %}
<a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}">
<img loading="lazy" src="{{p.thumb_url}}" class="post-img">
<img loading="lazy" src="/assets/images/loading.gif" data-src="{{p.thumb_url}}" class="post-img">
</a>
{% endif %}
</div>

12
push.sh
View File

@ -1,7 +1,5 @@
git pull
git add .
git commit -m "sneed"
git push
cd D:\1
git pull
git pull
git add .
git commit -m "sneed"
git push
. /media/a/Files/1