This commit is contained in:
Aevann1 2021-09-05 21:47:05 +02:00
parent 8020c6402d
commit 45b23a717d
4 changed files with 30 additions and 7 deletions

View file

@ -22,6 +22,15 @@ def post_embed(id, v):
return render_template("submission_listing.html", listing=[p], v=v)
@app.template_filter("favorite_emojis")
def favorite_emojis():
str = ""
emojis = session["favorite_emojis"]
emojis = sorted(emojis.items(), key=lambda x: x[1], reverse=True)
for k, v in emojis:
str += f'<button class="btn m-1 px-0" onclick="getEmoji(\'{k}\', \'@form@\')" style="background: None!important; width:60px; overflow: hidden; border: none;" data-toggle="tooltip" title=":{k}:" delay:="0"><img loading="lazy" width=50 src="/assets/images/emojis/{k}.gif" alt="{k}-emoji"/></button>'
return str
@app.context_processor
def inject_constants():
constants = [c for c in dir(const) if not c.startswith("_")]