1
0
mirror of https://github.com/Damillora/Altessimo synced 2024-12-23 10:23:46 +00:00
Altessimo/home/templates/randomizer.html

61 lines
1.9 KiB
HTML
Raw Normal View History

2021-07-09 19:51:55 +00:00
{% extends 'layouts/base.html' %}
{% block content %}
<h1>Song Randomizer</h1>
<p>A simple song randomizer. </p>
<p><strong>WARNING: Very experimental. Implementation is not very smart yet.</strong></p>
2021-07-10 13:41:17 +00:00
{% if song %}
<table class="table">
<tr>
<th>Branch</th>
<th>Song</th>
</tr>
<tr class="song-row branch-{{ song.branch.acronym }}">
<td class="col-1">
<a href="/taxonomy/branches/{{ song.branch.acronym }}">{{ song.branch.acronym }}</a>
</td>
<td>
<a href="/songs/{{ song.id }}/{{ song.title }}">{{ song.title }}</a>
</td>
</tr>
</table>
{% endif %}
{% if idols %}
<table class="table">
<tr>
<th>Branch</th>
<th>Idol</th>
</tr>
2021-07-09 19:51:55 +00:00
{% for idol in idols %}
2021-07-10 13:41:17 +00:00
<tr class="song-row branch-{{ idol.branch.acronym }}">
<td class="col-1">
<a href="/taxonomy/branches/{{ idol.branch.acronym }}">{{ idol.branch.acronym }}</a>
</td>
<td><a href="/idols/{{ idol.id }}">{{ idol.romanized_name}}</a></td>
</tr>
2021-07-09 19:51:55 +00:00
{% endfor %}
2021-07-10 13:41:17 +00:00
</table>
{% endif %}
{% if song is None and idols is None %}
<form action="{{ request.path }}" method="GET">
<button class="btn btn-outline-secondary" type="submit">Randomize song</button>
2021-07-09 19:51:55 +00:00
</form>
{% endif %}
2021-07-10 13:41:17 +00:00
{% if song and idols is None%}
<form action="{{ request.path }}" method="GET">
<div class="input-group mb-3">
<input type="hidden" name="song_id" value="{{ song.id }}">
<input type="number" class="form-control" placeholder="Number of idols" aria-label="Number of idols"
value="{{ num }}" name="num">
<button class="btn btn-outline-secondary" type="submit">Randomize idols</button>
</div>
</form>
{% endif %}
<form action="{{ request.path }}" method="GET">
<div class="input mb-3">
<button class="btn btn-outline-secondary" type="submit">Randomize song again</button>
</div>
</form>
2021-07-09 19:51:55 +00:00
{% endblock %}