show marsey author in deux

remotes/1693045480750635534/spooky-22
Aevann1 2022-07-15 03:13:03 +02:00
parent 48cbe8a6b1
commit 612ea7354b
2 changed files with 8 additions and 17 deletions

View File

@ -19,7 +19,7 @@ def rdrama(id, title):
@app.get("/marseys")
@auth_required
def marseys(v):
if SITE_NAME == 'rDrama':
if SITE in ('rdrama.net','devrama.xyz','deuxrama.net'):
marseys = g.db.query(Marsey, User).join(User)
sort = request.values.get("sort", "usage")
if sort == "usage": marseys = marseys.order_by(Marsey.count.desc(), User.username)

View File

@ -11,30 +11,21 @@
<th>Name</th>
<th>Marsey</th>
<th><a href="?sort=usage">Usage</a></th>
{% if SITE_NAME == 'rDrama' %}<th><a href="?sort=author">Author</a></th>{% endif %}
{% if SITE in ('rdrama.net','devrama.xyz','deuxrama.net') %}<th><a href="?sort=author">Author</a></th>{% endif %}
</tr>
</thead>
<tbody id="followers-table">
{% if SITE_NAME == 'rDrama' %}
{% for marsey, author in marseys %}
<tr>
<td>{{loop.index}}</td>
<td>{{marsey.name}}</td>
<td><img class="marsey" loading="lazy" data-bs-toggle="tooltip" alt=":#{{marsey.name}}:" title=":{{marsey.name}}:" src="/e/{{marsey.name}}.webp"></td>
<td>{{marsey.count}}</td>
<td><a style="color:#{{author.namecolor}};font-weight:bold" href="/@{{author.username}}"><img loading="lazy" src="{{author.profile_url}}" class="pp20"><span {% if author.patron %}class="patron" style="background-color:#{{author.namecolor}}"{% endif %}>{{author.username}}</span></a></td>
</tr>
{% endfor %}
{% else %}
{% for marsey in marseys %}
{% for marsey, author in marseys %}
<tr>
<td>{{loop.index}}</td>
<td>{{marsey.name}}</td>
<td><img class="marsey" loading="lazy" data-bs-toggle="tooltip" alt=":{{marsey.name}}:" title=":{{marsey.name}}:" src="/e/{{marsey.name}}.webp"></td>
<td><img class="marsey" loading="lazy" data-bs-toggle="tooltip" alt=":#{{marsey.name}}:" title=":{{marsey.name}}:" src="/e/{{marsey.name}}.webp"></td>
<td>{{marsey.count}}</td>
{% if SITE in ('rdrama.net','devrama.xyz','deuxrama.net') %}
<td><a style="color:#{{author.namecolor}};font-weight:bold" href="/@{{author.username}}"><img loading="lazy" src="{{author.profile_url}}" class="pp20"><span {% if author.patron %}class="patron" style="background-color:#{{author.namecolor}}"{% endif %}>{{author.username}}</span></a></td>
{% endif %}
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>