Commit b1c17470 by François C.

Merge branch '2916-insciptions-register-to-comittees' into 'dev_cooperatic'

INS: register to comitees shift

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