allerta-vvf/server/templates/list.html

80 lines
2.0 KiB
HTML
Raw Normal View History

2020-04-27 23:27:39 +02:00
{% extends "base.html" %}
{% block content %}
2020-11-14 23:00:36 +01:00
<br>
<div class="text-center">
<p>{{ 'Are you available in case of alert?'|t }}</p>
<button class="btn btn-lg btn-success " onclick="activate('{{ user.id }}')">{{ 'Activate'|t }}</button>
<button class="btn btn-lg btn-danger" style="background-color: red"
onclick="deactivate('{{ user.id }}')">{{ 'Deactivate'|t }}</button>
</div>
<br>
<br>
<script>
function activate(id) {
$.ajax({
url: "resources/ajax/ajax_change_availability.php",
method: "POST",
data: {
change_id: id,
dispo: 1,
token_list: "{{ token_list }}"
},
success: function (data) {
alert("{{ 'Thanks, %s, you have given your availability in case of alert.'|t|format(user.name) }}");
location.reload();
}
});
}
2020-11-14 23:00:36 +01:00
function deactivate(id) {
$.ajax({
url: "resources/ajax/ajax_change_availability.php",
method: "POST",
data: {
change_id: id,
dispo: 0,
token_list: "{{ token_list }}"
},
success: function (data) {
alert("{{ 'Thanks, %s, you have removed your availability in case of alert.'|t|format(user.name) }}");
location.reload();
}
});
}
2020-11-14 23:00:36 +01:00
</script>
<img alt="VVF" src="./resources/images/owner.png" width="150"
style="display: block; margin-left: auto; margin-right: auto;">
<br>
<br>
2020-10-22 15:03:45 +02:00
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
<tr>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Available'|t }}</th>
{% if user.full_viewer %}
<th>{{ 'Driver'|t }}</th>
<th>{{ 'Call'|t }}</th>
<th>{{ 'Write'|t }}</th>
<th>{{ 'Services'|t }}</th>
<th>{{ 'Availability Minutes'|t }}</th>
<th>{{ 'Other'|t }}</th>
{% endif %}
</tr>
</thead>
<tbody id="table_body">
</tbody>
</table>
<script>
2020-11-14 23:00:36 +01:00
loadTable("list");
</script>
</div>
<br><br>
<p style="text-align: center;">
<a id='add' href="edit_user.php?add">{{ 'Add user'|t }}</a>
</p>
<br>
<br>
2020-04-27 23:27:39 +02:00
{% endblock %}