2020-04-27 23:27:39 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<br>
|
|
|
|
<div class="text-center">
|
2020-07-03 11:38:41 +02:00
|
|
|
<p>{{ 'Are you available in case of alert?'|t }}</p>
|
2020-07-02 21:45:45 +02:00
|
|
|
<button class="btn btn-lg btn-success " onclick="Attivo('{{ user.id }}')">{{ 'Active'|t }}</button>
|
2020-04-27 23:27:39 +02:00
|
|
|
|
2020-07-02 21:45:45 +02:00
|
|
|
<button class="btn btn-lg btn-danger" style="background-color: red" onclick="NonAttivo('{{ user.id }}')">{{ 'Not Active'|t }}</button>
|
2020-04-27 23:27:39 +02:00
|
|
|
</div>
|
|
|
|
<script defer>
|
2020-05-25 22:43:56 +02:00
|
|
|
function Attivo(id){
|
2020-04-27 23:27:39 +02:00
|
|
|
$.ajax({
|
|
|
|
url: "risorse/ajax/ajax_aggiornadispo.php",
|
|
|
|
method: "POST",
|
|
|
|
data: {
|
2020-05-25 22:43:56 +02:00
|
|
|
change_id: id,
|
2020-09-26 16:58:02 +02:00
|
|
|
dispo: 1,
|
|
|
|
token_list: "{{ token_list }}"
|
2020-04-27 23:27:39 +02:00
|
|
|
},
|
|
|
|
success: function(data) {
|
2020-07-02 23:49:41 +02:00
|
|
|
alert("{{ 'Thanks, %s, you have given your availability in case of alert.'|t|format(user.name) }}");
|
2020-04-27 23:27:39 +02:00
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
});
|
2020-05-25 22:43:56 +02:00
|
|
|
}
|
2020-04-27 23:27:39 +02:00
|
|
|
|
2020-05-25 22:43:56 +02:00
|
|
|
function NonAttivo(id){
|
2020-04-27 23:27:39 +02:00
|
|
|
$.ajax({
|
|
|
|
url: "risorse/ajax/ajax_aggiornadispo.php",
|
|
|
|
method: "POST",
|
|
|
|
data: {
|
2020-05-25 22:43:56 +02:00
|
|
|
change_id: id,
|
2020-09-26 16:58:02 +02:00
|
|
|
dispo: 0,
|
|
|
|
token_list: "{{ token_list }}"
|
2020-04-27 23:27:39 +02:00
|
|
|
},
|
|
|
|
success: function(data) {
|
2020-07-02 23:49:41 +02:00
|
|
|
alert("{{ 'Thanks, %s, you have removed your availability in case of alert.'|t|format(user.name) }}");
|
2020-04-27 23:27:39 +02:00
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
});
|
2020-05-25 22:43:56 +02:00
|
|
|
}
|
2020-04-27 23:27:39 +02:00
|
|
|
</script>
|
|
|
|
<br>
|
|
|
|
<br>
|
2020-05-20 22:49:36 +02:00
|
|
|
<img alt="VVF" src="./risorse/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
|
2020-04-27 23:27:39 +02:00
|
|
|
<br>
|
|
|
|
<br>
|
2020-09-02 17:31:41 +02:00
|
|
|
<div id="list"></div>
|
2020-05-25 22:43:56 +02:00
|
|
|
{% if user.full_viewer == false %}
|
2020-04-27 23:27:39 +02:00
|
|
|
<script>
|
2020-09-02 17:31:41 +02:00
|
|
|
$( "#list" ).load("risorse/ajax/ajax_list.php");
|
2020-04-27 23:27:39 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
setInterval(function() {
|
2020-09-02 17:31:41 +02:00
|
|
|
$( "#list" ).load("risorse/ajax/ajax_list.php");
|
2020-04-27 23:27:39 +02:00
|
|
|
}, 10000);
|
|
|
|
});
|
|
|
|
</script>
|
2020-05-25 22:43:56 +02:00
|
|
|
{% elseif user.full_viewer == true %}
|
2020-04-27 23:27:39 +02:00
|
|
|
<script>
|
2020-09-02 17:31:41 +02:00
|
|
|
$( "#list" ).load("risorse/ajax/ajax_admin_list.php");
|
2020-04-27 23:27:39 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
setInterval(function() {
|
2020-09-02 17:31:41 +02:00
|
|
|
$( "#list" ).load("risorse/ajax/ajax_admin_list.php");
|
2020-04-27 23:27:39 +02:00
|
|
|
}, 10000);
|
|
|
|
});
|
|
|
|
</script>
|
2020-06-17 22:48:10 +02:00
|
|
|
<style>
|
|
|
|
#add {
|
|
|
|
outline: none;
|
|
|
|
cursor: pointer;
|
|
|
|
text-align: center;
|
|
|
|
text-decoration: none;
|
|
|
|
font: bold 12px Arial, Helvetica, sans-serif;
|
|
|
|
color: #fff;
|
|
|
|
padding: 10px 20px;
|
|
|
|
border: solid 1px #0076a3;
|
|
|
|
background: #0095cd;
|
|
|
|
}
|
2020-09-02 17:31:41 +02:00
|
|
|
|
2020-06-17 22:48:10 +02:00
|
|
|
#href {
|
|
|
|
outline: none;
|
|
|
|
cursor: pointer;
|
|
|
|
text-align: center;
|
|
|
|
text-decoration: none;
|
|
|
|
font: bold 12px Arial, Helvetica, sans-serif;
|
|
|
|
color: #fff;
|
|
|
|
padding: 10px 20px;
|
|
|
|
border: solid 1px #0076a3;
|
|
|
|
background: #0095cd;
|
|
|
|
}
|
|
|
|
</style>
|
2020-04-27 23:27:39 +02:00
|
|
|
{% endif %}
|
|
|
|
<script defer type="text/javascript" src="risorse/js/cache.js"></script>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
{% endblock %}
|