Add entry deletion, footer

This commit is contained in:
2019-05-22 12:19:28 +02:00
parent 0f7144dbc9
commit 5818eb1150
5 changed files with 126 additions and 9 deletions

View File

@ -45,11 +45,24 @@
</form>-->
</div>
</nav>
<main role="main" class="container">
{% block content %}{% endblock %}
</main><!-- /.container -->
<div class="site">
<main role="main" class="container">
{% block content %}{% endblock %}
</main><!-- /.container -->
</div>
<!-- Footer -->
<footer class="footer">
<div class="container text-center py-3">
{% if not auth %}
<a href="/login"><i class='material-icons'>launch</i>&nbsp;Login</a>
{% endif %}
<a href="https://github.com/PhoenixTwoFive/karaoqueue"><i class='material-icons'>code</i>&nbsp;Github</a>
<span class="text-muted">KaraoQueue -&nbsp;<span
style="display:inline-block;transform: rotate(180deg);">&copy</span>&nbsp;2019 - Phillip
Kühne</span>
</div>
</footer>
<!-- Footer -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

45
templates/main_admin.html Normal file
View File

@ -0,0 +1,45 @@
{% extends 'base.html' %}
{% block title %}Home{% endblock %}
{% block content %}
<table class="table">
<tr>
<th scope="col">Name</th>
<th scope="col">Song</th>
<th scope="col">Künstler</th>
<th scope="col">Löschen</th>
</tr>
{% for entry in list: %}
<tr>
<td>
{{ entry[0] }}
</td>
<td>
{{ entry[1] }}
</td>
<td>
{{ entry[2] }}
</td>
<td>
<button type='button' class='btn btn-danger' onclick='deleteEntry({{ entry[3] }})'><i
class='material-icons'>delete</i></button>
</td>
</tr>
{% endfor %}
</table>
<a name="end"></a>
{% endblock %}
{% block extrajs %}
<script>
function deleteEntry(entry_id) {
$.ajax({
type: 'GET',
url: '/api/entries/delete/'+entry_id,
contentType: "application/json",
dataType: 'json'
});
location.reload();
}
</script>
{% endblock %}