2017-02-01 18:57:29 +01:00
|
|
|
{% extends 'billard/base.html' %}
|
2017-02-10 19:39:21 +01:00
|
|
|
{% load display_client %}
|
2017-02-01 18:57:29 +01:00
|
|
|
|
|
|
|
{% block title %}Location Data{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2017-02-21 08:10:00 +01:00
|
|
|
{% if not locations|length_is:"1" %}
|
|
|
|
<form action="." method="post" id="location-form">
|
|
|
|
{% csrf_token %}
|
|
|
|
<div id="location-selector" class="alert">
|
|
|
|
<select class="form-control" form="location-form" name="location-selector" id="location-select">
|
|
|
|
{% for loc in locations %}
|
|
|
|
<option value="{{ loc.id }}"{% if loc.id == location_id %} selected{% endif %}>{{ loc.code }} - {{ loc.name }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
2017-04-27 10:35:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-21 08:10:00 +01:00
|
|
|
<div id="desk_data">
|
2017-02-20 19:11:48 +01:00
|
|
|
{% include 'billard/index_ajax.html' %}
|
2017-02-21 08:10:00 +01:00
|
|
|
</div>
|
2017-03-06 19:22:01 +01:00
|
|
|
<div id="modal-wrapper">
|
|
|
|
</div>
|
2017-02-20 19:11:48 +01:00
|
|
|
{% endblock %}
|
2017-04-27 10:35:10 +02:00
|
|
|
|
2017-02-20 19:11:48 +01:00
|
|
|
{% block js %}
|
|
|
|
<script type="text/javascript">
|
2017-03-06 19:44:36 +01:00
|
|
|
var interval;
|
2017-02-22 17:11:39 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
$.ajaxSetup({ cache: false });
|
2017-03-06 19:44:36 +01:00
|
|
|
interval = window.setInterval(refresh_page, 1000);
|
2017-02-20 19:11:48 +01:00
|
|
|
});
|
2017-02-22 17:11:39 +01:00
|
|
|
|
|
|
|
function refresh_page() {
|
2017-03-06 18:43:17 +01:00
|
|
|
$('#desk_data').load('#');
|
2017-03-06 19:31:35 +01:00
|
|
|
$('#modal-wrapper').load('{% url 'accountmodal' %}', function() {
|
2017-03-06 19:48:59 +01:00
|
|
|
if ( $('#accountsmodal').length ) {
|
|
|
|
window.clearInterval(interval);
|
|
|
|
$('#accountsmodal').modal('show');
|
|
|
|
}
|
2017-03-06 19:31:35 +01:00
|
|
|
});
|
2017-02-22 17:11:39 +01:00
|
|
|
}
|
2017-02-20 19:11:48 +01:00
|
|
|
</script>
|
2017-02-01 18:57:29 +01:00
|
|
|
{% endblock %}
|