Commit dfc58992 by François C.

Merge branch 'evolution_bdm' into 'ticket_1738'

# Conflicts:
#   members_space/static/js/members-space-my-shifts.js
parents 2bafd38f 6b6c53bc
Pipeline #1535 passed with stage
in 1 minute 33 seconds
......@@ -27,7 +27,7 @@ class CagetteMembersSpace(models.Model):
['state', '!=', 'replaced'],
['state', '!=', 'replacing'],
]
f = ['create_date', 'shift_id', 'name', 'state', 'is_late', 'is_makeup']
f = ['date_begin', 'shift_id', 'name', 'state', 'is_late', 'is_makeup']
marshal_none_error = 'cannot marshal None unless allow_none is enabled'
try:
......@@ -36,10 +36,45 @@ class CagetteMembersSpace(models.Model):
except Exception as e:
if not (marshal_none_error in str(e)):
res['error'] = repr(e)
coop_logger.error(res['error'] + ' : %s', str(payment_id))
coop_logger.error(res['error'] + ' : %s', str(partner_id))
else:
res = []
# Get committees shifts
committees_shifts_name = getattr(settings, 'ENTRANCE_ADD_PT_EVENT_NAME', 'Validation service comité')
cond = [
['partner_id', '=', partner_id],
['name', '=', committees_shifts_name]
]
f = ['create_date']
try:
# Don't bother having a global pagination, use the same
res_committees_shifts = self.o_api.search_read('shift.counter.event', cond, f, limit=limit, offset=offset,
order='create_date DESC')
for committee_shift in res_committees_shifts:
item = {
"date_begin": committee_shift["create_date"],
"shift_id": False,
"name": "Services des comités",
"state": "done",
"is_late": False,
"is_makeup": False,
}
for index, res_item in enumerate(res):
if (res_item["date_begin"] < item["date_begin"]):
res.insert(index, item)
break
except Exception as e:
if not (marshal_none_error in str(e)):
res['error'] = repr(e)
coop_logger.error(res['error'] + ' : %s', str(partner_id))
else:
res = res + []
except Exception as e:
print(str(e))
......
......@@ -41,8 +41,8 @@
display: none;
}
@media screen and (max-width: 992px) {
/* When the screen is less than 992 pixels wide, hide all links, except for the first one ("Home"). Show the link that contains should open and close the topnav (.icon) */
@media screen and (max-width: 1146px) {
/* When the screen is less than 1146px pixels wide, hide all links, except for the first one ("Home"). Show the link that contains should open and close the topnav (.icon) */
.topnav a:not(:first-child) {display: none;}
.topnav a.icon {
float: right;
......@@ -65,4 +65,4 @@
#deconnect {
float: none;
}
}
\ No newline at end of file
}
......@@ -134,17 +134,12 @@ body {
height: 100%;
flex-direction: column;
align-items: center;
font-size: 2rem;
}
@media screen and (max-width: 992px) {
#home_tile_my_info .tile_content {
font-size: 1.7rem;
}
font-size: 1.6rem;
}
@media screen and (max-width: 380px) {
@media screen and (max-width: 576px) {
#home_tile_my_info .tile_content {
font-size: 1.6rem !important;
font-size: 1.4rem !important;
}
}
......@@ -210,22 +205,14 @@ body {
}
.member_associated_partner_area {
font-size: 1.9rem;
line-height: 1.3;
}
@media screen and (max-width: 380px) {
.member_associated_partner_area {
font-size: 1.6rem;
}
}
@media screen and (max-width: 992px) {
.member_associated_partner_area {
display: flex;
flex-direction: column;
align-items: center;
font-size: 1.7rem;
}
}
......
......@@ -48,6 +48,16 @@ function prepare_server_data(data) {
res = [];
for (history_item of data) {
history_item.shift_name = (history_item.shift_id === false) ? '' : history_item.shift_id[1];
if (history_item.name === "Services des comités") {
let shift_datetime = new Date(history_item.date_begin);
let str_shift_datetime = `${("0" + shift_datetime.getDate()).slice(-2)}/${("0" + (shift_datetime.getMonth() + 1)).slice(-2)}/${shift_datetime.getFullYear()}`
str_shift_datetime = str_shift_datetime + " " + shift_datetime.toLocaleTimeString("fr-fr", time_options);
history_item.shift_name = `Services des comités ${str_shift_datetime}`
}
history_item.details = '';
if (history_item.state === 'excused' || history_item.state === 'absent') {
history_item.details = "Absent";
......
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