diff --git a/files/routes/awards.py b/files/routes/awards.py index 45c419274..68c384a8f 100755 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -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') diff --git a/files/routes/settings.py b/files/routes/settings.py index 95d5bc69e..e64665b04 100755 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -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): diff --git a/files/templates/comments.html b/files/templates/comments.html index 8ffa37c63..0fafc55dc 100755 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -109,6 +109,13 @@ })() +{% if c.author.bio_html %} + {% set bio = c.author.bio_html.replace('src="/assets/images/loading.gif" data-', '') %} +{% endif %} + +
- {% if c.author.bio_html %}{{c.author.bio_html.replace('src="/assets/images/loading.gif" data-', '') | safe}}{% endif %} + {% if c.author.bio_html %}{{bio | safe}}{% endif %}
@@ -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) %}