diff options
| author | Jokler <jokler@protonmail.com> | 2020-06-04 21:51:49 +0200 |
|---|---|---|
| committer | Jokler <jokler@protonmail.com> | 2020-06-04 21:51:49 +0200 |
| commit | 3575ac579cdcc5a9fa3ffec84952a634d1d7deaf (patch) | |
| tree | 93666bf5d3ba01e2529f07cbedc049bda1f5079b /web_server/templates/index.htm | |
| parent | 654f6b349ab20ce4b19afdd5d37f9a569165d1f2 (diff) | |
| download | pokebot-3575ac579cdcc5a9fa3ffec84952a634d1d7deaf.tar.gz pokebot-3575ac579cdcc5a9fa3ffec84952a634d1d7deaf.zip | |
Improve the default website somewhat
Diffstat (limited to 'web_server/templates/index.htm')
| -rw-r--r-- | web_server/templates/index.htm | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/web_server/templates/index.htm b/web_server/templates/index.htm index eed31f3..fc1f8e1 100644 --- a/web_server/templates/index.htm +++ b/web_server/templates/index.htm @@ -13,24 +13,63 @@ <a href="/docs/api">API</a> </nav> -<ul> - {% for bot in bots %} +<nav> + <ul> + {% let bot_name %} + {% match bot %} + {% when Some with (bot) %} + {% let bot_name = bot.name.clone() %} + {% when None %} + {% let bot_name = "".to_owned() %} + {% endmatch %} + {% for name in bot_names %} + {% if name.clone() == bot_name %} + <li><a href="/bot/{{ name }}" class="botname selected">{{ name }}</a></li> + {% else %} + <li><a href="/bot/{{ name }}" class="botname">{{ name }}</a></li> + {% endif %} + {% endfor %} + </ul> +</nav> +{% match bot %} + {% when Some with (bot) %} <h2>{{ bot.name }}</h1> <div>State: {{ bot.state }}</div> <div>Volume: {{ bot.volume * 100.0 }}%</div> {% match bot.currently_playing %} {% when Some with (current) %} - <span>Currently playing:</span> - {% let item = current %} - {% include "song.htm" %} + <h3>Currently playing:</h3> + {% match current.thumbnail %} + {% when Some with (thumbnail) %} + <img src="{{ thumbnail }}" class="thumbnail"> + {% when None %} + {% endmatch %} + <a href="{{ current.webpage_url }}">{{ current.title }}</a> + <span>({{ current.duration|fmt_duration }})</span> {% when None %} {% endmatch %} - {% for item in bot.playlist %} - <li> - {% include "song.htm" %} - </li> - {% endfor %} - {% endfor %} -</ul> + <h3>Playlist</h3> + <table class="tracktable" cellspacing="0" cellpadding="0"> + <tr class="tableheader"> + <td class="stat">#</td> + <td>track</td> + <td>length</td> + <td>added by</td> + </tr> + {% for item in bot.playlist %} + <tr> + <td class="stat">{{ loop.index }}</td> + <td><a href="{{ item.webpage_url }}">{{ item.title }}</a></td> + <td> + {% let duration = item.duration %} + {{ duration|fmt_duration }} + </td> + <td>{{ item.added_by }}</td> + </tr> + {% endfor %} + </table> + </ul> + {% when None %} + {% endmatch %} {% endblock %} |
