Commit 27f86846 by François C.

Merge branch '4444_improve_presence_recording' into 'dev_cooperatic'

4444 improve presence recording

See merge request !228
parents bdecae48 ffcc0c36
Pipeline #2752 passed with stage
in 1 minute 28 seconds
......@@ -29,7 +29,7 @@ video {max-width:none;}
#webcam_button {min-width:115px; max-width:115px;}
#multi_results_preview button {margin:2px;}
#member_slide {grid-gap:0;padding:5px;display:none;}
#member_slide .coop-info {background: #fbfbd5;}
#member_slide .coop-info {background: #449d44;}
#image_medium {width:128px;float:left;}
#image_medium:hover {cursor: url(/static/img/ip-camera.png), url(/static/img/ip-camera.svg) 5 5, pointer;}
#barcode {height:128px;}
......
......@@ -101,18 +101,23 @@ function fill_member_slide(member) {
}
html_elts.image_medium.html('<img src="'+img_src+'" width="128" />');
html_elts.cooperative_state.html(member.cooperative_state);
if (member.cooperative_state == 'Rattrapage') {
if (member.cooperative_state == 'Suspendu(e)') {
var explanation = "Tu as dû manquer un service! Pour pouvoir faire tes courses aujourd'hui, tu dois d'abord sélectionner un rattrapage sur ton espace membre.";
html_elts.status_explanation.html(explanation);
}
if (member.cooperative_state == 'Désinscrit(e)' || member.cooperative_state == 'Parti(e)') coop_info.addClass('b_red');
else if (member.cooperative_state == 'En alerte' || member.cooperative_state == 'Délai accordé' || member.cooperative_state == 'Rattrapage') coop_info.addClass('b_orange');
if (member.cooperative_state == 'Désinscrit(e)' || member.cooperative_state == 'Parti(e)') {
coop_info.addClass('b_red');
}
else if (member.cooperative_state == 'En alerte' || member.cooperative_state == 'Délai accordé') {
coop_info.addClass('b_yellow')
} else if (member.cooperative_state == 'Suspendu(e)') {
coop_info.addClass('b_orange');
}
if (member.shifts.length > 0) {
html_elts.next_shifts.append('Prochains services : ');
var slist = $('<ul>');
for (i in member.shifts) {
var s = $('<li>').text(member.shifts[i].start);
......
......@@ -294,7 +294,8 @@ def record_service_presence(request):
stid = int(request.POST.get("stid", 0)) # shift_ticket_id
cancel = request.POST.get("cancel") == 'true'
typeAction = str(request.POST.get("type"))
coop_logger.info("Enregistrement presence : mid = %s, rid = %s, sid = %s, stid = %s, cancel = %s, typeAction = %s",
str(mid), str(rid), str(sid), str(stid), str(cancel), typeAction)
app_env = getattr(settings, 'APP_ENV', "prod")
if (rid > -1 and mid > 0):
overrided_date = ""
......@@ -316,6 +317,7 @@ def record_service_presence(request):
res['update'] = 'ok'
else:
res['update'] = 'ko'
coop_logger.info("Résultat update record_service_presence : %s", res['update'])
if res['update'] == 'ok':
members = CagetteMember.search('id', mid)
m = members[0]
......@@ -331,6 +333,7 @@ def record_service_presence(request):
except Exception as e:
res['error'] = str(e)
coop_logger.error("Erreur record_service_presence : %s", str(e))
return JsonResponse({'res': res})
def easy_validate_shift_presence(request):
......
.green {color:#60B000;}
.b_green, .b_more_than_50pc {background:#d9ebd2}
.b_green, .b_more_than_50pc {background:#d9ebd2 !important;}
.orange {color:#FFA500;}
.b_orange, .b_less_than_50pc {background:#F0B000 !important;}
.yellow {color:#F0B000;}
.b_yellow {background: #fcf3cc;}
.b_yellow {background: #fcf3cc !important;}
.red {color:#FF0000;}
.b_red, .b_less_than_25pc {background:#ff3333 !important;}
.loading {background-image: url("/static/img/ajax-loader.gif"); background-repeat:no-repeat; background-position: center; background-color: #efefef;}
......
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