remotes/1693045480750635534/spooky-22
Aevann1 2022-01-06 22:30:08 +02:00
parent 9126a7d984
commit 101aa43006
3 changed files with 9 additions and 4 deletions

View File

@ -66,6 +66,11 @@ class Submission(Base):
def __repr__(self):
return f"<Submission(id={self.id})>"
@property
@lazy
def comments(self):
return g.db.query(Comment.author_id, Comment.created_utc, Comment.id).filter_by(parent_submission=self.id)
@property
@lazy
def controversial(self):

View File

@ -559,7 +559,7 @@ class User(Base):
@property
@lazy
def applications(self):
return g.db.query(OauthApp).filter_by(author_id=self.id).order_by(OauthApp.id.asc()).all()
return g.db.query(OauthApp).filter_by(author_id=self.id).order_by(OauthApp.id)
@lazy
def subscribed_idlist(self, page=1):

View File

@ -861,9 +861,9 @@
redhtml = '<i style="color:red !important" class="text-admin fas fa-circle" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Unread"></i>'
if (lastCount)
{
{% for c in comments %}
{% if not (v and v.id==c.author_id) %}
if ({{c.created_utc*1000}} > lastCount.t) document.getElementById("reddot-{{c.id}}").innerHTML = redhtml
{% for c in p.comments %}
{% if not (v and v.id==c[0]) %}
if ({{c[1]*1000}} > lastCount.t) document.getElementById("reddot-{{c[2]}}").innerHTML = redhtml
{% endif %}
{% endfor %}
}