1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

Minor fixes on consumptions page

This commit is contained in:
Yohann D'ANELLO
2020-03-13 09:26:39 +01:00
parent 56a2d482c9
commit a1f8ef721a
6 changed files with 35 additions and 17 deletions

View File

@ -161,6 +161,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
</div>
</footer>
<script>
CSRF_TOKEN = "{{ csrf_token }}";
</script>
{% block extrajavascript %}
{% endblock extrajavascript %}
</body>

View File

@ -143,14 +143,18 @@
{% block extrajavascript %}
<script type="text/javascript" src="/static/js/consos.js"></script>
<script type="text/javascript">
var CSRF_TOKEN = "{{ csrf_token }}";
$("#double_conso").click(function() {
$("#consos_list_div").show();
$("#infos_div").attr('class', 'col-sm-5 col-xl-6');
$("#note_infos_div").attr('class', 'col-xl-3');
$("#user_select_div").attr('class', 'col-xl-4');
$("#buttons_div").attr('class', 'col-sm-7 col-xl-6');
if (buttons.length > 0) {
let note_list_obj = $("#note_list");
$("#consos_list").html(note_list_obj.html());
note_list_obj.html("");
}
});
$("#single_conso").click(function() {
@ -159,6 +163,18 @@
$("#note_infos_div").attr('class', 'col-xl-5');
$("#user_select_div").attr('class', 'col-xl-7');
$("#buttons_div").attr('class', 'col-sm-7 col-md-8');
if (buttons.length > 0) {
if (notes_display.length === 0) {
let consos_list_obj = $("#consos_list");
$("#note_list").html(consos_list_obj.html());
consos_list_obj.html("");
}
else {
buttons.length = 0;
$("#consos_list").html("");
}
}
});
$("#consos_list_div").hide();

View File

@ -71,13 +71,11 @@ SPDX-License-Identifier: GPL-2.0-or-later
{% block extrajavascript %}
<script>
var CSRF_TOKEN = "{{ csrf_token }}";
var sources = [];
var sources_notes_display = [];
var dests = [];
var dests_notes_display = [];
var transfer_mode = false;
sources = [];
sources_notes_display = [];
dests = [];
dests_notes_display = [];
transfer_mode = false;
$(document).ready(function() {
autoCompleteNote("source_note", "source_alias_matched", "source_note_list", sources, sources_notes_display,