Move to GitHub

This commit is contained in:
Ross Stewart
2022-08-05 16:37:56 +01:00
commit 58885be096
18 changed files with 2092 additions and 0 deletions

22
skill/templates/base.html Normal file
View File

@@ -0,0 +1,22 @@
<!doctype html>
<html>
<head>
<title>{{ title }}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/dataTables.bootstrap5.css">
</head>
<body>
<div class="container">
<h1>{{ title }}</h1>
<hr>
<h3>Now playing {{ current.title }} by {{ current.artist }}</h3>
<h4>Track ID: {{ current.id }}</h4>
<br>
{% block content %}{% endblock %}
</div>
<script type="text/javascript" charset="utf8" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.25/js/dataTables.bootstrap5.js"></script>
{% block scripts %}{% endblock %}
</body>
</html>

View File

@@ -0,0 +1,42 @@
{% extends "base.html" %}
{% block content %}
<table id="data" class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Artist</th>
<th>Title</th>
<th>Album</th>
<th>Year</th>
<th>Genre</th>
<th>Duration</th>
<th>Bit Rate</th>
<th>URI</th>
</tr>
</thead>
<tbody>
{% for track in tracks %}
<tr>
<td>{{ track.id }}</td>
<td>{{ track.artist }}</td>
<td>{{ track.title }}</td>
<td>{{ track.album }}</td>
<td>{{ track.year }}</td>
<td>{{ track.genre }}</td>
<td>{{ track.duration }}</td>
<td>{{ track.bitrate }}</td>
<td>{{ track.uri }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
{% block scripts %}
<script>
$(document).ready(function () {
$('#data').DataTable();
});
</script>
{% endblock %}