1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 08:38:59 +00:00

display bot icons!

This commit is contained in:
Lynne Megido 2019-09-17 19:13:36 +10:00
parent f46e954f5a
commit e8c666c711
2 changed files with 2 additions and 2 deletions

View file

@ -19,7 +19,7 @@
<div class="container" style="min-height: 300px;">
{% for bot in bots %}
<div class="row light">
<div class="panel-icon {{ "online" if bot['enabled'] else "offline"}}"></div>
<div class="panel-icon {{ "online" if bot['enabled'] else "offline"}}" style="{{ "background-image: url('" + bot['icon'] + "')" if bot['icon'] else "" }}"></div>
<div class="panel-text">
{% set handle_list = bot['handle'].split('@') %}
<div class="panel-name">@{{ handle_list[1] }}<span class="subtle tiny">@{{ handle_list[2] }}</span></div>

View file

@ -44,7 +44,7 @@ def home():
c.execute("SELECT COUNT(*) FROM `bots` WHERE user_id = %s AND enabled = TRUE", (session['user_id'],))
active_count = c.fetchone()[0]
dc = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
dc.execute("SELECT `handle`, `enabled`, `last_post`, `post_frequency` FROM `bots` WHERE user_id = %s", (session['user_id'],))
dc.execute("SELECT `handle`, `enabled`, `last_post`, `post_frequency`, `icon` FROM `bots` WHERE user_id = %s", (session['user_id'],))
bots = dc.fetchall()
dc.close()