forked from rDrama/rDrama
fdMerge branch 'frost' of https://github.com/Aevann1/Drama into frost
commit
0059749818
|
@ -220,7 +220,7 @@ class User(Base):
|
|||
@property
|
||||
@lazy
|
||||
def paid_dues(self):
|
||||
return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or self.patron or (self.club_allowed != False and self.truecoins > dues))
|
||||
return not self.shadowbanned and not (self.is_banned and not self.unban_utc) and (self.admin_level or self.club_allowed or (self.club_allowed != False and self.truecoins > dues))
|
||||
|
||||
@lazy
|
||||
def any_block_exists(self, other):
|
||||
|
|
|
@ -42,6 +42,7 @@ def notifications(v):
|
|||
messages = request.values.get('messages')
|
||||
modmail = request.values.get('modmail')
|
||||
posts = request.values.get('posts')
|
||||
reddit = request.values.get('reddit')
|
||||
if modmail and v.admin_level > 1:
|
||||
comments = g.db.query(Comment).filter(Comment.sentto==2).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all()
|
||||
next_exists = (len(comments) > 25)
|
||||
|
@ -68,12 +69,30 @@ def notifications(v):
|
|||
g.db.commit()
|
||||
|
||||
next_exists = (len(notifications) > len(listing))
|
||||
elif reddit:
|
||||
notifications = v.notifications.join(Notification.comment).filter(Comment.body_html.like('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(101).all()
|
||||
|
||||
listing = []
|
||||
|
||||
for index, x in enumerate(notifications[:100]):
|
||||
c = x.comment
|
||||
if x.read and index > 24: break
|
||||
elif not x.read:
|
||||
x.read = True
|
||||
c.unread = True
|
||||
g.db.add(x)
|
||||
if x.created_utc > 1620391248: c.notif_utc = x.created_utc
|
||||
listing.append(c)
|
||||
|
||||
g.db.commit()
|
||||
|
||||
next_exists = (len(notifications) > len(listing))
|
||||
else:
|
||||
notifications = v.notifications.join(Notification.comment).filter(
|
||||
Comment.is_banned == False,
|
||||
Comment.deleted_utc == 0,
|
||||
Comment.author_id != AUTOJANNY_ID,
|
||||
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()
|
||||
|
||||
next_exists = (len(notifications) > 50)
|
||||
|
@ -92,7 +111,7 @@ def notifications(v):
|
|||
i += 1
|
||||
g.db.commit()
|
||||
|
||||
if not posts:
|
||||
if not posts and not reddit:
|
||||
listing = []
|
||||
for c in comments:
|
||||
if c.parent_submission:
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
<div class="overflow-x-auto"><table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<!-- Border based button
|
||||
https://litmus.com/blog/a-guide-to-bulletproof-buttons-in-email-design -->
|
||||
<div class="overflow-x-auto><table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
<div class="overflow-x-auto"><table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<!-- Border based button
|
||||
https://litmus.com/blog/a-guide-to-bulletproof-buttons-in-email-design -->
|
||||
<div class="overflow-x-auto><table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
<div class="overflow-x-auto"><table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<!-- Border based button
|
||||
https://litmus.com/blog/a-guide-to-bulletproof-buttons-in-email-design -->
|
||||
<div class="overflow-x-auto><table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
<div class="overflow-x-auto"><table class="body-action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<!-- Border based button
|
||||
https://litmus.com/blog/a-guide-to-bulletproof-buttons-in-email-design -->
|
||||
<div class="overflow-x-auto><table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation">
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
|
|
@ -82,13 +82,13 @@
|
|||
{% block navbar %}
|
||||
<div class="d-flex align-items-center">
|
||||
{% if v %}
|
||||
<!-- {% if v.paid_dues %}
|
||||
{% if v.paid_dues %}
|
||||
{% if ccmode=="true"%}
|
||||
<a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Only show country club posts" class="btn btn-primary text-primary mx-2" href="?sort={{sort}}&t={{t}}&ccmode=false"><i class="fas fa-golf-club mr-2 "></i>CC</a>
|
||||
{% else %}
|
||||
<a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Only show country club posts" class="btn btn-secondary mx-2" href="?sort={{sort}}&t={{t}}&ccmode=true"><i class="fas fa-golf-club mr-2 "></i>CC</a>
|
||||
{% endif %}
|
||||
{% endif %} -->
|
||||
{% endif %}
|
||||
|
||||
<div class="dropdown dropdown-actions mx-2 d-none d-lg-block">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
|
|
|
@ -37,6 +37,13 @@
|
|||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if v.admin_level %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link py-3{% if '/notifications?reddit=true' in request.full_path %} active{% endif %}" href="/notifications?reddit=true">
|
||||
Reddit
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue