Commit 84f0455b by Etienne Freiss

develop

parent afe5a5e8
Pipeline #1890 passed with stage
in 1 minute 31 seconds
...@@ -180,6 +180,19 @@ td{ ...@@ -180,6 +180,19 @@ td{
color: white; color: white;
} }
.fc-event.shift_booked_makeup {
background-color: #f0ad4e;
cursor: auto;
border-color: #f0ad4e;
}
.fc-event.shift_booked_makeup td {
--fc-list-event-hover-bg-color:#f0ad4e;
}
.fc-list-event.shift_booked_makeup {
color: white;
}
#calendar .fc-list-table { #calendar .fc-list-table {
table-layout: auto; table-layout: auto;
} }
......
...@@ -306,17 +306,23 @@ function init_shifts_list() { ...@@ -306,17 +306,23 @@ function init_shifts_list() {
shift_line_template.find(".shift_line_time").text(datetime_shift_start.toLocaleTimeString("fr-fr", time_options)); shift_line_template.find(".shift_line_time").text(datetime_shift_start.toLocaleTimeString("fr-fr", time_options));
// Disable or not // Disable or not
shift_line_template.find(".selectable_shift_line").removeClass("btn--primary");
shift_line_template.find(".selectable_shift_line").removeClass("btn");
shift_line_template.find(".selectable_shift_line").removeClass("btn--warning");
if (!can_exchange_shifts() && block_actions_for_attached_people === "True") { if (!can_exchange_shifts() && block_actions_for_attached_people === "True") {
shift_line_template.find(".selectable_shift_line").removeClass("btn--primary");
shift_line_template.find(".selectable_shift_line").addClass("btn"); shift_line_template.find(".selectable_shift_line").addClass("btn");
shift_line_template.find(".checkbox").prop("disabled", "disabled"); shift_line_template.find(".checkbox").prop("disabled", "disabled");
} else { } else {
shift_line_template.find(".selectable_shift_line").removeClass("btn"); if (shift.is_makeup==true) {
shift_line_template.find(".selectable_shift_line").addClass("btn--primary"); shift_line_template.find(".selectable_shift_line").addClass("btn--warning");
shift_line_template.find(".checkbox").prop("disabled", false); shift_line_template.find(".checkbox").prop("disabled", false);
shift_line_template.find(".checkbox").prop("value", shift.id); shift_line_template.find(".checkbox").prop("value", shift.id);
} else {
shift_line_template.find(".selectable_shift_line").addClass("btn--primary");
shift_line_template.find(".checkbox").prop("disabled", false);
shift_line_template.find(".checkbox").prop("value", shift.id);
}
} }
// Set assign shift button // Set assign shift button
if (partner_data.associated_partner_id === "False" && partner_data.parent_id === "False") { if (partner_data.associated_partner_id === "False" && partner_data.parent_id === "False") {
shift_line_template.find('.affect_associate_registered').hide(); shift_line_template.find('.affect_associate_registered').hide();
...@@ -525,7 +531,7 @@ function init_calendar_page() { ...@@ -525,7 +531,7 @@ function init_calendar_page() {
hiddenDays: hidden_days, hiddenDays: hidden_days,
events: '/shifts/get_list_shift_calendar/' + partner_data.concerned_partner_id, events: '/shifts/get_list_shift_calendar/' + partner_data.concerned_partner_id,
eventClick: function(info) { eventClick: function(info) {
if (!$(info.el).hasClass("shift_booked")) { if (!$(info.el).hasClass("shift_booked") && !$(info.el).hasClass("shift_booked_makeup")) {
const new_shift_id = info.event.id; const new_shift_id = info.event.id;
// Set new shift // Set new shift
...@@ -789,9 +795,9 @@ function init_shifts_exchange() { ...@@ -789,9 +795,9 @@ function init_shifts_exchange() {
$(window).smartresize(function() { $(window).smartresize(function() {
// only apply if a width threshold is passed // only apply if a width threshold is passed
if ( if (
vw > 992 && window.innerWidth <= 992 || vw > 992 && window.innerWidth <= 992 ||
vw <= 992 && window.innerWidth > 992 || vw <= 992 && window.innerWidth > 992 ||
vw > 768 && window.innerWidth <= 768 || vw > 768 && window.innerWidth <= 768 ||
vw <= 768 && window.innerWidth > 768 vw <= 768 && window.innerWidth > 768
) { ) {
vw = window.innerWidth; vw = window.innerWidth;
......
...@@ -101,8 +101,11 @@ def get_list_shift_calendar(request, partner_id): ...@@ -101,8 +101,11 @@ def get_list_shift_calendar(request, partner_id):
use_new_members_space = getattr(settings, 'USE_NEW_MEMBERS_SPACE', False) use_new_members_space = getattr(settings, 'USE_NEW_MEMBERS_SPACE', False)
listRegisterPartner = [] listRegisterPartner = []
listMakeUpShift = []
for v in registerPartner: for v in registerPartner:
listRegisterPartner.append(v['id']) listRegisterPartner.append(v['id'])
if v['is_makeup']:
listMakeUpShift.append(v['id'])
start = request.GET.get('start') start = request.GET.get('start')
end = request.GET.get('end') end = request.GET.get('end')
...@@ -136,7 +139,10 @@ def get_list_shift_calendar(request, partner_id): ...@@ -136,7 +139,10 @@ def get_list_shift_calendar(request, partner_id):
if len(l) > 0: if len(l) > 0:
if use_new_members_space is True: if use_new_members_space is True:
event["classNames"] = ["shift_booked"] if set(value['registration_ids']) & set(listRegisterPartner) & set(listMakeUpShift):
event["classNames"] = ["shift_booked_makeup"]
else :
event["classNames"] = ["shift_booked"]
else: else:
event["className"] = "shift_booked" event["className"] = "shift_booked"
event["changed"] = False event["changed"] = False
......
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
<p>Un service colorié en noir : je suis déjà inscrit.e à ce service.</p> <p>Un service colorié en noir : je suis déjà inscrit.e à ce service.</p>
<a class="example-event fc-daygrid-event fc-daygrid-block-event fc-h-event fc-event fc-event-start fc-event-end fc-event-future shift_less_alf"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-time">10:45</div><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">&nbsp;- 3/12</div></div></div></div></a> <a class="example-event fc-daygrid-event fc-daygrid-block-event fc-h-event fc-event fc-event-start fc-event-end fc-event-future shift_less_alf"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-time">10:45</div><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">&nbsp;- 3/12</div></div></div></div></a>
<p>Un service colorié en bleu : je peux m'inscrire à ce service.</p> <p>Un service colorié en bleu : je peux m'inscrire à ce service.</p>
<a class="example-event fc-daygrid-event fc-daygrid-block-event fc-h-event fc-event fc-event-start fc-event-end fc-event-future shift_booked_makeup"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-time">10:45</div><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">&nbsp;- 3/12</div></div></div></div></a>
<p>Un service colorié en orange : Je suis inscrit.e à un rattrapage sur ce service.</p>
<p>3/12 <i class="arrow_explanation_numbers fas fa-arrow-right"></i> il y a déjà 3 places réservées à ce service sur 12 disponibles. <p>3/12 <i class="arrow_explanation_numbers fas fa-arrow-right"></i> il y a déjà 3 places réservées à ce service sur 12 disponibles.
<b>Plus le chiffre de gauche est petit, plus on a besoin de coopérateurs.rices à ce service !</b></p> <b>Plus le chiffre de gauche est petit, plus on a besoin de coopérateurs.rices à ce service !</b></p>
</div> </div>
......
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