fsdsf
This commit is contained in:
parent
61696e9ddb
commit
d09d7a0c64
8 changed files with 937 additions and 890 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,16 +1,31 @@
|
|||
from os import environ, listdir
|
||||
import re
|
||||
from copy import deepcopy
|
||||
from json import loads
|
||||
|
||||
SITE = environ.get("DOMAIN", '').strip()
|
||||
SITE_NAME = environ.get("SITE_NAME", '').strip()
|
||||
|
||||
marseys = []
|
||||
others = []
|
||||
for x in sorted(x.replace('.webp','') for x in listdir("files/assets/images/emojis")):
|
||||
if x.startswith('mar') or x.endswith('sey'): marseys.append(x)
|
||||
else: others.append(x)
|
||||
allemojis = marseys + others
|
||||
import json
|
||||
|
||||
with open("files/assets/js/emoji_modal.js", 'r') as file:
|
||||
text = file.read().split('emojis: ')[1].split('cops police"},')[0] + '"}}'
|
||||
result = loads(text)
|
||||
|
||||
marseys = {}
|
||||
|
||||
for k, val in result.items():
|
||||
marseys[k] = val['author']
|
||||
|
||||
del result
|
||||
|
||||
topmakers = {}
|
||||
for k, val in marseys.items():
|
||||
if val in topmakers: topmakers[val] += 1
|
||||
else: topmakers[val] = 1
|
||||
|
||||
topmakers.pop('unknown')
|
||||
topmakers = sorted(topmakers.items(), key=lambda x: x[1], reverse=True)[:25]
|
||||
|
||||
AJ_REPLACEMENTS = {
|
||||
' your ': " you're ",
|
||||
|
|
|
@ -17,12 +17,10 @@ site_name = environ.get("SITE_NAME").strip()
|
|||
def privacy(v):
|
||||
return render_template(f"privacy.html", v=v)
|
||||
|
||||
@app.get("/emojis")
|
||||
@app.get("/marseys")
|
||||
@auth_desired
|
||||
def emojis(v):
|
||||
if not v or v.oldsite: template = ''
|
||||
else: template = 'CHRISTMAS/'
|
||||
return render_template(f"{template}emojis.html", v=v, emojis=allemojis)
|
||||
return render_template(f"marseys.html", v=v, marseys=marseys.items())
|
||||
|
||||
@app.get('/sidebar')
|
||||
@auth_desired
|
||||
|
|
|
@ -304,7 +304,10 @@ def leaderboard(v):
|
|||
for user in users11: users12.append((user, badges[user.id]))
|
||||
users12 = sorted(users12, key=lambda x: x[1], reverse=True)[:25]
|
||||
|
||||
return render_template(f"{template}leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users6=users6, users7=users7, users9=users9, users10=users10, users12=users12)
|
||||
if True: users13 = topmakers
|
||||
else: users13 = None
|
||||
|
||||
return render_template(f"{template}leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users6=users6, users7=users7, users9=users9, users10=users10, users12=users12, users13=users13)
|
||||
|
||||
|
||||
@app.get("/@<username>/css")
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/assets/js/emoji_modal.js?a=16"></script>
|
||||
<script src="/static/assets/js/emoji_modal.js?a=17"></script>
|
||||
|
||||
<style>
|
||||
a.emojitab {
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
{% extends "default.html" %}
|
||||
{% block content %}
|
||||
<pre>
|
||||
|
||||
|
||||
</pre>
|
||||
<div class="overflow-x-auto"><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">Emoji</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="followers-table">
|
||||
{% for emoji in emojis %}
|
||||
<tr>
|
||||
<td style="font-weight: bold">{{loop.index}}</td>
|
||||
<td style="font-weight: bold">{{emoji}}</td>
|
||||
<td><img loading="lazy" data-bs-toggle="tooltip" alt=":{{emoji}}:" title=":{{emoji}}:" delay="0" src="/static/assets/images/emojis/{{emoji}}.webp" ></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
|
@ -245,7 +245,7 @@
|
|||
|
||||
|
||||
|
||||
{% if request.host == "pcmemes.net" %}
|
||||
{% if users6 %}
|
||||
<pre>
|
||||
|
||||
|
||||
|
@ -272,4 +272,36 @@
|
|||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% if users13 %}
|
||||
<pre>
|
||||
|
||||
|
||||
</pre>
|
||||
<h5 style="font-weight:bold;text-align: center;">Top 25 by marseys made</h5>
|
||||
<pre>
|
||||
|
||||
|
||||
</pre>
|
||||
|
||||
<div class="overflow-x-auto"><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">Marseys</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="followers-table">
|
||||
{% for user in users13 %}
|
||||
<tr>
|
||||
<td style="font-weight: bold">{{loop.index}}</td>
|
||||
<td>{% if user[0]=='anton-d' %}{{user[0]}}{% else %}<a style="font-weight:bold;" href="/@{{user[0]}}"><img alt="@{{user[0]}}'s profile picture" loading="lazy" src="/@{{user[0]}}/pic" class="pp20">{{user[0]}}</a>{% endif %}</td>
|
||||
<td style="font-weight: bold">{{user[1]}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
28
files/templates/marseys.html
Normal file
28
files/templates/marseys.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
{% extends "default.html" %}
|
||||
{% block content %}
|
||||
<pre>
|
||||
|
||||
|
||||
</pre>
|
||||
<div class="overflow-x-auto"><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">Marsey</th>
|
||||
<th style="font-weight: bold">Author</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="followers-table">
|
||||
{% for marsey, author in marseys %}
|
||||
<tr>
|
||||
<td style="font-weight: bold">{{loop.index}}</td>
|
||||
<td style="font-weight: bold">{{marsey}}</td>
|
||||
<td><img loading="lazy" data-bs-toggle="tooltip" alt=":{{marsey}}:" title=":{{marsey}}:" delay="0" src="/static/assets/images/emojis/{{marsey}}.webp" ></td>
|
||||
<td>{% if author in ('anton-d','unknown') %}{{author}}{% else %}<a style="font-weight:bold;" href="/@{{author}}"><img alt="@{{author}}'s profile picture" loading="lazy" src="/@{{author}}/pic" class="pp20">{{author}}</a>{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue