diff --git a/files/helpers/regex.py b/files/helpers/regex.py index 6eeb33f875..90f38551c3 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -1,6 +1,6 @@ import re from .const import * -from random import choice +from random import choice, choices if SITE_NAME == 'PCM': valid_username_chars = 'a-zA-Z0-9_\-А-я' @@ -144,4 +144,8 @@ commands = { command_regex = re.compile("(\s|\n|^)#(fortune|factcheck|8ball|roll)", flags=re.A|re.I) def command_regex_matcher(match, upper=False): - return match.group(1) + str(choice(commands[match.group(2).lower()])) \ No newline at end of file + result = str(choice(commands[match.group(2).lower()])) + if match.group(2) == 'roll': + color = tuple(choices(range(256), k=3)) + result = f'Your roll: {result}' + return match.group(1) + result \ No newline at end of file diff --git a/files/routes/admin.py b/files/routes/admin.py index 6206c086e7..d2c468812d 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1470,7 +1470,7 @@ def admin_nuke_user(v): ) g.db.add(ma) - notify_mod_action(v.id, f"@{v.username} has nuked @{user.username}") + notify_mod_action(v.id, f"@{v.username} has has removed all content of @{user.username}") return redirect(user.url) @@ -1508,7 +1508,7 @@ def admin_nunuke_user(v): ) g.db.add(ma) - notify_mod_action(v.id, f"@{v.username} has un-nuked @{user.username}") + notify_mod_action(v.id, f"@{v.username} has approved all of content of @{user.username}") return redirect(user.url) diff --git a/files/routes/polls.py b/files/routes/polls.py index 98ff61e773..74c5e96657 100644 --- a/files/routes/polls.py +++ b/files/routes/polls.py @@ -47,7 +47,7 @@ def option_votes(option_id, v): if not option: abort(404) - ups = g.db.query(SubmissionOptionVote).filter_by(option_id=option_id).all() + ups = g.db.query(SubmissionOptionVote).filter_by(option_id=option_id).order_by(SubmissionOptionVote.created_utc).all() return render_template("poll_votes.html", v=v, @@ -97,7 +97,7 @@ def option_votes_comment(option_id, v): if not option: abort(404) - ups = g.db.query(CommentOptionVote).filter_by(option_id=option_id).all() + ups = g.db.query(CommentOptionVote).filter_by(option_id=option_id).order_by(CommentOptionVote.created_utc).all() return render_template("poll_votes.html", v=v, diff --git a/files/templates/admins.html b/files/templates/admins.html index 985875e530..f00b635c08 100644 --- a/files/templates/admins.html +++ b/files/templates/admins.html @@ -29,6 +29,6 @@ - + {% endblock %} diff --git a/files/templates/badges.html b/files/templates/badges.html index 37852ce2d6..76fd02020d 100644 --- a/files/templates/badges.html +++ b/files/templates/badges.html @@ -37,6 +37,6 @@ - + {% endblock %} \ No newline at end of file diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index cd86e553a9..26fb4cacd4 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -39,29 +39,20 @@
-
-
- + {% endblock %} \ No newline at end of file diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index f67f00c1c8..685124c468 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -1,6 +1,6 @@ {%- set CACHE_VER = { - 'css/main.css': 397, + 'css/main.css': 399, 'css/catalog.css': 2, 'css/4chan.css': 61, @@ -20,7 +20,7 @@ set CACHE_VER = { 'js/bootstrap.js': 275, 'js/comments+submission_listing.js': 263, 'js/submission_listing.js': 261, - 'js/emoji_modal.js': 297, + 'js/emoji_modal.js': 298, 'js/formatting.js': 240, 'js/lottery.js': 256, 'js/marked.js': 280, diff --git a/files/templates/votes.html b/files/templates/votes.html index eb4ad9c75f..429becc2fe 100644 --- a/files/templates/votes.html +++ b/files/templates/votes.html @@ -32,7 +32,7 @@ User User Truescore - Vote Time + Vote Time @@ -60,7 +60,7 @@ User User Truescore - Vote Time + Vote Time @@ -81,7 +81,7 @@ - + {% endif %}