bazarr/views/systemreleases.html

56 lines
1.6 KiB
HTML

{% extends '_main.html' %}
{% block title %}Releases - Bazarr{% endblock %}
{% block head %}
<style>
.badge {
vertical-align: text-bottom;
margin-left: 10px;
}
</style>
{% endblock head %}
{% block bcleft %}
{% endblock bcleft %}
{% block bcright %}
{% endblock bcright %}
{% block body %}
<div class="container-fluid" style="padding-top: 3em;">
<span id="releases"></span>
</div>
{% endblock body %}
{% block tail %}
<script>
$(document).ready(function () {
$.ajax({
url: "{{ url_for('api.systemreleases') }}"
}).done(function (data) {
var releases = '';
data.data.forEach(appendFunc);
function appendFunc(value) {
entries = '';
value['body'].forEach(appendEntry);
releases = releases + '<h3 style="display:inline;">'+value['name']+'</h3>'
releases += ' — '+value['date']
releases += ((value['prerelease']) ? '<span class="badge badge-danger">Development</span>' : '<span class="badge badge-info">Master</span>')
releases += ((value['current']) ? '<span class="badge badge-secondary">Currently Installed</span>' : '')
releases += '</h4><hr/><p><b>From newest to oldest:</b></p><ul>'+entries+'</ul>';
function appendEntry(entry) {
entries = entries + '<li>'+entry+'</li>';
}
}
$('#releases').html(releases);
});
})
</script>
{% endblock tail %}