forked from rDrama/rDrama
fddf
parent
67a76912fd
commit
9b88a70354
|
@ -326,11 +326,13 @@ class User(Base, Stndrd, Age_times):
|
|||
Comment.deleted_utc == 0).count()
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def post_count(self):
|
||||
|
||||
return self.submissions.filter_by(is_banned=False, deleted_utc=0).count()
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def comment_count(self):
|
||||
|
||||
return self.comments.filter(Comment.parent_submission != None).filter_by(is_banned=False, deleted_utc=0).count()
|
||||
|
|
|
@ -182,7 +182,8 @@ def frontlist(v=None, sort="hot", page=1,t="all", ids_only=True, filter_words=''
|
|||
def front_all(v):
|
||||
if v and v.is_banned and not v.unban_utc: return render_template("seized.html")
|
||||
|
||||
page = int(request.args.get("page") or 1)
|
||||
try: page = int(request.args.get("page") or 1)
|
||||
except: abort(400)
|
||||
|
||||
# prevent invalid paging
|
||||
page = max(page, 1)
|
||||
|
|
|
@ -47,4 +47,33 @@
|
|||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<pre>
|
||||
|
||||
|
||||
</pre>
|
||||
<h5 style="font-weight:bold;">Top 10 dramatards by post count</h5>
|
||||
<pre>
|
||||
|
||||
|
||||
</pre>
|
||||
<table class="table table-striped mb-5">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th style="font-weight:bold;">#</th>
|
||||
<th style="font-weight:bold;">Name</th>
|
||||
<th style="font-weight:bold; text-align:right;">Post count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for user in users3 %}
|
||||
<tr>
|
||||
<td style="font-weight:bold;">{{users3.index(user)+1}}</td>
|
||||
<td><a style="color:#{{user.namecolor}}; font-weight:bold;" href="/@{{user.username}}">{{user.username}}</a></td>
|
||||
<td style="font-weight:bold; text-align:right;">{{user.post_count}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<pre>
|
||||
|
||||
|
||||
</pre>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue