remotes/1693045480750635534/spooky-22
Aevann1 2022-04-04 00:11:01 +02:00
parent a4a474ac24
commit 69b4ddc11d
2 changed files with 11 additions and 14 deletions

View File

@ -88,12 +88,12 @@ def notifications(v):
next_exists = (len(notifications) > len(listing)) next_exists = (len(notifications) > len(listing))
else: else:
notifications = v.notifications.join(Notification.comment).filter( notifications = v.notifications.join(Notification.comment).distinct(Comment.top_comment_id).filter(
Comment.is_banned == False, Comment.is_banned == False,
Comment.deleted_utc == 0, Comment.deleted_utc == 0,
Comment.author_id != AUTOJANNY_ID, Comment.author_id != AUTOJANNY_ID,
Comment.body_html.notlike('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%') Comment.body_html.notlike('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')
).order_by(Notification.created_utc.desc()).offset(50 * (page - 1)).limit(51).all() ).order_by(Comment.top_comment_id.desc()).offset(50 * (page - 1)).limit(51).all()
next_exists = (len(notifications) > 50) next_exists = (len(notifications) > 50)
notifications = notifications[:50] notifications = notifications[:50]
@ -115,20 +115,11 @@ def notifications(v):
listing = [] listing = []
for c in comments: for c in comments:
if c.parent_submission: if c.parent_submission:
if c.replies2 == None: c.replies2 = []
for x in c.child_comments:
if x.author_id == v.id:
x.voted = 1
if x not in c.replies2: c.replies2.append(x)
while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments):
parent = c.parent_comment parent = c.parent_comment
if parent.replies2 == None: parent.replies2 = [c] if parent.replies2 == None: parent.replies2 = [c]
elif c not in parent.replies2: parent.replies2.append(c) elif c not in parent.replies2: parent.replies2.append(c)
c = parent c = parent
if c.replies2 == None: c.replies2 = []
else: else:
while c.parent_comment: while c.parent_comment:
c = c.parent_comment c = c.parent_comment

View File

@ -29,17 +29,23 @@
{% for vote in ups %} {% for vote in ups %}
<tr> <tr>
<td><a style="color:#{{vote.user.namecolor}};font-weight:bold" href="/@{{vote.user.username}}"><img loading="lazy" src="{{vote.user.profile_url}}" class="pp20"><span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.namecolor}}"{% endif %}>{{vote.user.username}}</span></a></td> <td><a style="color:#{{vote.user.namecolor}};font-weight:bold" href="/@{{vote.user.username}}"><img loading="lazy" src="{{vote.user.profile_url}}" class="pp20"><span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.namecolor}}"{% endif %}>{{vote.user.username}}</span></a></td>
<td>{{vote.user.truecoins}} <td>{{vote.user.truecoins}}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<h2>Downvotes</h2> <h2>Downvotes</h2>
<div class="overflow-x-auto"><table class="table table-striped mb-5"> <div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white"><tr><th>User</th></tr></thead> <thead class="bg-primary text-white"><tr>
<th>User</th>
<th>User truescore</th>
</tr></thead>
{% for vote in downs %} {% for vote in downs %}
<tr><td><a style="color:#{{vote.user.namecolor}}" href="/@{{vote.user.username}}"><img loading="lazy" src="{{vote.user.profile_url}}" class="pp20"><span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.namecolor}}"{% endif %}>{{vote.user.username}}</span></a></td></tr> <tr>
<td><a style="color:#{{vote.user.namecolor}};font-weight:bold" href="/@{{vote.user.username}}"><img loading="lazy" src="{{vote.user.profile_url}}" class="pp20"><span {% if vote.user.patron %}class="patron" style="background-color:#{{vote.user.namecolor}}"{% endif %}>{{vote.user.username}}</span></a></td>
<td>{{vote.user.truecoins}}</td>
</tr>
{% endfor %} {% endfor %}
</table> </table>