Commit 6f10063e by Damien Moulard

INS: register to comitees shift

parent d893ecc1
Pipeline #2147 passed with stage
in 1 minute 28 seconds
......@@ -773,4 +773,7 @@ $(document).ready(function() {
searchMembersForAssociate();
});
if (committees_shift_id !== "None") {
$("#shift_choice button[data-select='Volant']").text("Comités");
}
});
......@@ -87,7 +87,9 @@ def inscriptions(request, type=1):
"""
template = loader.get_template('members/inscriptions.html')
context = {'type': type, 'title': 'Inscriptions',
committees_shift_id = CagetteServices.get_committees_shift_id()
context = {
'type': type, 'title': 'Inscriptions',
'couchdb_server': settings.COUCHDB['url'],
'mag_place_string': settings.MAG_NAME,
'office_place_string': settings.OFFICE_NAME,
......@@ -104,6 +106,7 @@ def inscriptions(request, type=1):
'db': settings.COUCHDB['dbs']['member'],
'ASSOCIATE_MEMBER_SHIFT' : getattr(settings, 'ASSOCIATE_MEMBER_SHIFT', ''),
'prepa_odoo_url' : getattr(settings, 'PREPA_ODOO_URL', '/members/prepa-odoo'),
'committees_shift_id': committees_shift_id,
}
response = HttpResponse(template.render(context, request))
......
......@@ -53,8 +53,13 @@ function subscribe_shift(shift_t_id) {
var s_data = shift_templates[shift_t_id].data;
var shift_name = get_shift_name(s_data);
if (committees_shift_id !== undefined && committees_shift_id !== "None" && shift_name === "Volant") {
shift_name = 'des Comités'
}
let msg = 'On inscrit le membre au créneau ' + shift_name
openModal(
'On inscrit le membre au créneau ' + shift_name,
msg,
function() {
closeModal();
current_coop.shift_template = shift_templates[shift_t_id];
......@@ -327,8 +332,15 @@ function retrieve_and_draw_shift_tempates() {
$.each(shift_templates, function(i, e) {
if (e.data.type == 2 && volant == null) {
// has comitee shift
if (committees_shift_id !== undefined && committees_shift_id !== "None") {
if (e.data.id == parseInt(committees_shift_id)) {
volant = e.data.id
}
} else {
volant = e.data.id;
}
}
});
dbc.allDocs({include_docs: true, descending: true}, function(err, resp) {
......
......@@ -178,9 +178,11 @@
auto_compaction: false
});
var mag_place_string = '{{mag_place_string}}';
var office_place_string = '{{office_place_string}}'
var max_begin_hour = '{{max_begin_hour}}'
var email_domain = '{{email_domain}}'
var office_place_string = '{{office_place_string}}';
var max_begin_hour = '{{max_begin_hour}}';
var email_domain = '{{email_domain}}';
var committees_shift_id = '{{committees_shift_id}}';
</script>
<script src="{% static "js/all_common.js" %}?v="></script>
<script src="{% static "js/common.js" %}?v="></script>
......
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