Commit 6a825fc3 by Damien Moulard

Merge branch 'evolution_bdm' of…

Merge branch 'evolution_bdm' of gl.cooperatic.fr:cooperatic-foodcoops/third-party into evolution_bdm
parents 4d3070db f70ac9a7
Pipeline #1496 passed with stage
in 1 minute 27 seconds
......@@ -1175,8 +1175,8 @@ class CagetteServices(models.Model):
dateutil.parser.parse(s['date_begin_tz']).replace(tzinfo=None)
).total_seconds() / 60 > default_acceptable_minutes_after_shift_begins
if with_members is True:
cond = [['id', 'in', s['registration_ids']], ['state', '!=', 'cancel']]
fields = ['partner_id', 'shift_type', 'state']
cond = [['id', 'in', s['registration_ids']], ['state', 'not in', ['cancel', 'waiting', 'draft']]]
fields = ['partner_id', 'shift_type', 'state', 'is_late']
members = api.search_read('shift.registration', cond, fields)
s['members'] = sorted(members, key=lambda x: x['partner_id'][0])
if len(s['members']) > 0:
......
......@@ -43,8 +43,9 @@ h1 .member_name {font-weight: bold;}
{border:1px solid #000; border-radius: 5px; padding:5px; margin-bottom:15px;background:#FFF;}
.members_list {list-style: none;}
.members_list li {display:block;margin-bottom:5px;}
.members_list.late li {background-color: #de9b00; color: white}
.members_list li.btn--inverse {background: #449d44 !important; cursor:not-allowed; color: #FFF; }
.members_list li.btn--inverse {background: #449d44; cursor:not-allowed; color: #FFF; }
.members_list li.btn--inverse.late {background-color: #de9b00; color: white}
#service_entry_success {font-size: x-large;}
#service_entry_success .explanations {margin: 25px 0; font-size: 18px;}
......
......@@ -263,15 +263,18 @@ function fill_service_entry(s) {
if (s.members) {
m_list = '<ul class="members_list">';
if (typeof s.late != "undefined" && s.late == true) {
m_list = '<ul class="members_list late">';
}
// if (typeof s.late != "undefined" && s.late == true) {
// m_list = '<ul class="members_list late">';
// }
$.each(s.members, function(i, e) {
var li_class = "btn";
var li_data = "";
if (e.state == "done") {
li_class += "--inverse";
if (e.is_late == true) {
li_class += " late";
}
} else {
li_data = ' data-rid="'+e.id+'" data-mid="'+e.partner_id[0]+'"';
}
......
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