remotes/1693045480750635534/spooky-22
Aevann1 2021-10-21 17:06:55 +02:00
parent c9dfbbd73d
commit 9d59de2134
3 changed files with 36 additions and 30 deletions

View File

@ -7,6 +7,33 @@ from files.classes.award import *
from .front import frontlist
from flask import g, request
AWARDS2 = {
"ban": {
"kind": "ban",
"title": "1-Day Ban",
"description": "Bans the author for a day.",
"icon": "fas fa-gavel",
"color": "text-danger",
"price": 3000
},
"grass": {
"kind": "grass",
"title": "Grass",
"description": "Ban the author permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)",
"icon": "fas fa-seedling",
"color": "text-success",
"price": 10000
},
"shit": {
"kind": "shit",
"title": "Shit",
"description": "Makes flies swarm a post.",
"icon": "fas fa-poop",
"color": "text-black-50",
"price": 500
},
}
@app.get("/shop")
@app.get("/settings/shop")
@auth_required
@ -122,33 +149,6 @@ def shop(v):
},
}
AWARDS2 = {
"ban": {
"kind": "ban",
"title": "1-Day Ban",
"description": "Bans the author for a day.",
"icon": "fas fa-gavel",
"color": "text-danger",
"price": 3000
},
"grass": {
"kind": "grass",
"title": "Grass",
"description": "Ban the author permanently (must provide a timestamped picture of them touching grass to the admins to get unbanned)",
"icon": "fas fa-seedling",
"color": "text-success",
"price": 10000
},
"shit": {
"kind": "shit",
"title": "Shit",
"description": "Makes flies swarm a post.",
"icon": "fas fa-poop",
"color": "text-black-50",
"price": 500
},
}
query = g.db.query(
User.id, User.username, User.patron, User.namecolor,
AwardRelationship.kind.label('last_award_kind'), func.count(AwardRelationship.id).label('last_award_count')

View File

@ -100,7 +100,7 @@ def settings_profile_post(v):
updated = True
v.is_nofollow = request.values.get("nofollow", None) == 'true'
if request.values.get("bio"):
if request.values.get("bio") or request.files.get('file'):
bio = request.values.get("bio")[:1500]
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', bio, re.MULTILINE):

View File

@ -109,6 +109,13 @@
})()
</script>
{% if c.author.bio_html %}
{% set bio = c.author.bio_html.replace('src="/assets/images/loading.gif" data-', '') %}
{% endif %}
<script>
console.log({{bio}})
</script>
<div style="display:none" id="popover-{{c.id}}">
<div class="popover-user-profile" role="tooltip">
<img class="w-100 h-64 object-cover" src="{{c.author.banner_url}}">
@ -119,7 +126,7 @@
</div>
</div>
<div class="px-3">
<span class="text-black">{% if c.author.bio_html %}{{c.author.bio_html.replace('src="/assets/images/loading.gif" data-', '') | safe}}{% endif %}</span>
<span class="text-black">{% if c.author.bio_html %}{{bio | safe}}{% endif %}</span>
</div>
<div class="border-top d-flex align-items-center px-2 py-3 gap-3 smol">
<span>
@ -153,7 +160,6 @@
{% set replies=c.replies %}
{% endif %}
{% if (c.is_banned or c.deleted_utc > 0 or c.is_blocking or c.is_blocked) and not (v and v.admin_level>0) and not (v and v.id==c.author_id) %}
<div id="comment-{{c.id}}" class="comment">