forked from rDrama/rDrama
1
0
Fork 0

Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

master
Aevann1 2022-07-14 19:04:58 +02:00
commit 407d0410ba
10 changed files with 27 additions and 32 deletions

View File

@ -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()]))
result = str(choice(commands[match.group(2).lower()]))
if match.group(2) == 'roll':
color = tuple(choices(range(256), k=3))
result = f'<b style="color:rgb{color}">Your roll: {result}</b>'
return match.group(1) + result

View File

@ -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)

View File

@ -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,

View File

@ -29,6 +29,6 @@
</table>
</div>
<script src="/assets/js/sort_table.js?v=243"></script>
<script src="/assets/js/sort_table.js?v=244"></script>
{% endblock %}

View File

@ -37,6 +37,6 @@
</table>
</div>
<script src="/assets/js/sort_table.js?v=243"></script>
<script src="/assets/js/sort_table.js?v=244"></script>
{% endblock %}

View File

@ -39,29 +39,20 @@
<input disabled autocomplete="off" class="form-control px-2" type="text" id="emoji_search" placeholder="Search.." onchange="start_search()" {% if not (v and v.poor) %}oninput="start_search()"{% endif %}>
</div>
<div class="px-3 d-flex flex-row">
<fieldset class="p-2">
<label style="display: inline">Options:</legend>
<div style="display: inline" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Makes the emoji larger">
<fieldset class="py-2 pr-2 pl-1">
<div class="mr-2" style="display: inline" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Makes the emoji larger">
<input type="checkbox" id="emoji-sel-0" value="#" class="emoji-suffix">
<label for="emoji-sel-0">Large</label>
<label class="emoji-option" for="emoji-sel-0">Large</label>
</div>
<div style="display: inline" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Mirror the emoji along the Y axis">
<div class="mr-2" style="display: inline" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Mirror the emoji along the Y axis">
<input type="checkbox" id="emoji-sel-1" value="!" class="emoji-suffix">
<label for="emoji-sel-1">Mirror</label>
<label class="emoji-option" for="emoji-sel-1">Mirror</label>
</div>
<div style="display: inline" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Adds a hand that pats the emoji">
<input type="checkbox" id="emoji-sel-2" value="pat" class="emoji-postfix">
<label for="emoji-sel-2">Pat</label>
</div>
</fieldset>
<fieldset class="p-2">
<label style="display: inline">Search:</legend>
<div style="display: inline" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Iterate through all substrings of the query. YIKES">
<input type="checkbox" id="emoji-complete-search">
<label for="emoji-complete-search">complete</label>
<label class="emoji-option" for="emoji-sel-2">Pat</label>
</div>
</fieldset>
</div>

View File

@ -13,14 +13,14 @@
</pre>
<h3>{{thing.body_html}} - {{ups | length}} votes</h3>
<h3>{{thing.body_html | safe}} - {{ups | length}} votes</h3>
<div class="overflow-x-auto mt-5">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>User</th>
<th role="button" onclick="sort_table(1)">User Truescore</th>
<th>Vote Time</th>
<th role="button" onclick="sort_table(2)">Vote Time</th>
</tr>
</thead>
@ -41,7 +41,7 @@
</table>
</div>
<script src="/assets/js/sort_table.js?v=243"></script>
<script src="/assets/js/sort_table.js?v=244"></script>
{% endif %}

View File

@ -30,6 +30,6 @@
</table>
</div>
<script src="/assets/js/sort_table.js?v=243"></script>
<script src="/assets/js/sort_table.js?v=244"></script>
{% endblock %}

View File

@ -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,

View File

@ -32,7 +32,7 @@
<tr>
<th>User</th>
<th role="button" onclick="sort_table(1)">User Truescore</th>
<th>Vote Time</th>
<th role="button" onclick="sort_table(2)">Vote Time</th>
</tr>
</thead>
@ -60,7 +60,7 @@
<tr>
<th>User</th>
<th role="button" onclick="sort_table(1)">User Truescore</th>
<th>Vote Time</th>
<th role="button" onclick="sort_table(2)">Vote Time</th>
</tr>
</thead>
@ -81,7 +81,7 @@
</table>
</div>
<script src="/assets/js/sort_table.js?v=243"></script>
<script src="/assets/js/sort_table.js?v=244"></script>
{% endif %}