Commit 523a4803 by François C.

Fix #3859 bug (shift template listener if weeks filter triggered

parent c984b632
Pipeline #2481 passed with stage
in 1 minute 24 seconds
...@@ -21,6 +21,7 @@ var volant = null; ...@@ -21,6 +21,7 @@ var volant = null;
function get_displayed_weeks() { function get_displayed_weeks() {
displayed_weeks = []; displayed_weeks = [];
$('#week_types').find('.selected_weeks :checked').each(function() { $('#week_types').find('.selected_weeks :checked').each(function() {
...@@ -227,6 +228,8 @@ function draw_shift_templates(params) { ...@@ -227,6 +228,8 @@ function draw_shift_templates(params) {
}); });
draw_table(begin_hours, function() { draw_table(begin_hours, function() {
const is_inscription_page = $('body').hasClass('inscriptions');
$.each(shift_templates, function(i, e) { $.each(shift_templates, function(i, e) {
if (e.data) { if (e.data) {
var keep_it = false; var keep_it = false;
...@@ -292,9 +295,9 @@ function draw_shift_templates(params) { ...@@ -292,9 +295,9 @@ function draw_shift_templates(params) {
} }
}); });
if (type == 1) { if (type == 1) {
if (!params || (typeof params.shift_listener !== "undefined" && params.shift_listener == true)){ if (!params || (typeof params.shift_listener !== "undefined" && params.shift_listener == true) || is_inscription_page == true){
shift_table.find('.shift').on("click", single_shift_click); shift_table.find('.shift').on("click", single_shift_click);
} }
} }
...@@ -320,7 +323,7 @@ function draw_shift_templates(params) { ...@@ -320,7 +323,7 @@ function draw_shift_templates(params) {
} }
} }
if (!params || (typeof params.shift_listener !== "undefined" && params.shift_listener == true)){ if (!params || (typeof params.shift_listener !== "undefined" && params.shift_listener == true) || is_inscription_page == true){
shift_table.find('.shift').on("click", select_shift_among_compact); shift_table.find('.shift').on("click", select_shift_among_compact);
} }
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<script src="{% static "js/modernizr-custom.min.js" %}"></script> <script src="{% static "js/modernizr-custom.min.js" %}"></script>
{% block additionnal_scripts %}{% endblock %} {% block additionnal_scripts %}{% endblock %}
</head> </head>
<body> <body class="{% block body_class %}nospecific{% endblock %}">
{% block menu %}{% endblock %} {% block menu %}{% endblock %}
<!-- The overlay --> <!-- The overlay -->
<div id="modal" class="overlay"> <div id="modal" class="overlay">
......
{% extends "members/base.html" %} {% extends "members/base.html" %}
{% block body_class %}inscriptions{% endblock %}
{% load static %} {% load static %}
{% block additionnal_css %} {% block additionnal_css %}
<link rel="stylesheet" href="{% static "css/inscriptions.css" %}?v=1651853225"> <link rel="stylesheet" href="{% static "css/inscriptions.css" %}?v=1651853225">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment