sneed
This commit is contained in:
parent
0195b174e4
commit
a88b14488b
2 changed files with 24 additions and 5 deletions
|
@ -295,6 +295,21 @@ class User(Base, Stndrd, Age_times):
|
||||||
|
|
||||||
return f"Unban in {text}"
|
return f"Unban in {text}"
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def display_awards(self):
|
||||||
|
|
||||||
|
_awards = {}
|
||||||
|
|
||||||
|
for a in self.awards:
|
||||||
|
if a.kind in _awards:
|
||||||
|
_awards[a.kind]['count'] += 1
|
||||||
|
else:
|
||||||
|
_awards[a.kind] = a.type
|
||||||
|
_awards[a.kind]['count'] = 1
|
||||||
|
|
||||||
|
return list(_awards.values())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def post_notifications_count(self):
|
def post_notifications_count(self):
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
<th style="font-weight:bold;">#</th>
|
<th style="font-weight:bold;">#</th>
|
||||||
<th style="font-weight:bold;">Name</th>
|
<th style="font-weight:bold;">Name</th>
|
||||||
<th style="font-weight:bold;">Tier</th>
|
<th style="font-weight:bold;">Tier</th>
|
||||||
<th style="font-weight:bold;">Shit awards</th>
|
<th style="font-weight:bold;">Awards</th>
|
||||||
<th style="font-weight:bold;">Ban awards</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
|
@ -18,9 +17,14 @@
|
||||||
|
|
||||||
<td><img style="width: 32px; height: 32px" src="/assets/images/badges/patron-{{user.patron}}.gif"></td>
|
<td><img style="width: 32px; height: 32px" src="/assets/images/badges/patron-{{user.patron}}.gif"></td>
|
||||||
|
|
||||||
<td style="font-weight:bold;">{% if user.shitawards %}{{user.shitawards}}{% endif %}</td>
|
<td style="font-weight:bold;">
|
||||||
|
{% for a in user.display_awards %}
|
||||||
<td style="font-weight:bold;">{% if user.banawards %}{{user.banawards}}{% endif %}</td>
|
<span class="d-inline-block mx-2">
|
||||||
|
<i class="{{ a['icon'] }} {{ a['color'] }}" data-toggle="tooltip" data-placement="bottom" title="{{ a['title'] }} Awards owned"></i>
|
||||||
|
{{ a['count'] }}
|
||||||
|
</span>
|
||||||
|
{% endfor %}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue