Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
d4e58ed9
Commit
d4e58ed9
authored
Mar 10, 2022
by
Etienne Freiss
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_cooperatic' into 2251-shift-screen-associate
parents
fe9266d5
6aa05fdd
Pipeline
#1916
passed with stage
in 1 minute 31 seconds
Changes
9
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
20 deletions
+53
-20
models.py
members/models.py
+5
-2
inscriptions.css
members/static/css/inscriptions.css
+3
-0
inscriptions.js
members/static/js/inscriptions.js
+1
-1
members-space-shifts-exchange.css
members_space/static/css/members-space-shifts-exchange.css
+13
-0
members-space-shifts-exchange.js
members_space/static/js/members-space-shifts-exchange.js
+19
-13
orders_helper.js
orders/static/js/orders_helper.js
+0
-0
views.py
shifts/views.py
+7
-1
inscriptions.html
templates/members/inscriptions.html
+1
-1
index.html
templates/members_space/index.html
+4
-2
No files found.
members/models.py
View file @
d4e58ed9
...
...
@@ -775,9 +775,12 @@ class CagetteMember(models.Model):
cond
=
[[
'name'
,
'ilike'
,
str
(
key
)]]
cond
.
append
(
'|'
)
cond
.
append
([
'is_member'
,
'='
,
True
])
cond
.
append
([
'is_associated_people'
,
'='
,
True
])
if
search_type
!=
'members'
:
cond
.
append
([
'is_associated_people'
,
'='
,
True
])
else
:
cond
.
append
([
'is_associated_people'
,
'='
,
False
])
# cond.append(['cooperative_state', '!=', 'unsubscribed'])
if
search_type
==
"full"
:
if
search_type
==
"full"
or
search_type
==
'members'
:
fields
=
CagetteMember
.
m_default_fields
if
not
shift_id
is
None
:
CagetteMember
.
m_default_fields
.
append
(
'tmpl_reg_line_ids'
)
...
...
members/static/css/inscriptions.css
View file @
d4e58ed9
...
...
@@ -23,6 +23,9 @@
[
data-week
=
"4"
]
{
border
:
2px
#eed000
solid
;}
#new_coop
[
name
=
"email"
]
{
width
:
25em
;}
#new_coop
{
max-width
:
75%
;
}
#mail_generation
{
position
:
absolute
;
bottom
:
30px
;}
#sex
{
padding
:
0
;}
...
...
members/static/js/inscriptions.js
View file @
d4e58ed9
...
...
@@ -689,7 +689,7 @@ $(document).ready(function() {
if
(
search_str
)
{
$
.
ajax
({
url
:
'/members/search/'
+
search_str
,
url
:
'/members/search/'
+
search_str
+
"?search_type=members"
,
dataType
:
'json'
,
success
:
function
(
data
)
{
members_search_results
=
[];
...
...
members_space/static/css/members-space-shifts-exchange.css
View file @
d4e58ed9
...
...
@@ -217,6 +217,19 @@ td{
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
{
table-layout
:
auto
;
}
...
...
members_space/static/js/members-space-shifts-exchange.js
View file @
d4e58ed9
...
...
@@ -116,17 +116,17 @@ function add_or_change_shift(new_shift_id) {
closeModal
();
selected_shift
=
null
;
if
(
error
.
status
===
400
&&
error
.
msg
===
"Old service in less than 24hours."
)
{
if
(
error
.
status
===
400
&&
'msg'
in
error
.
responseJSON
&&
error
.
responseJSON
.
msg
===
"Old service in less than 24hours."
)
{
alert
(
`Désolé ! Le service que tu souhaites échanger démarre dans moins de 24h. `
+
`Afin de faciliter la logistique des services, il n'est plus possible de l'échanger. `
+
`Si tu ne peux vraiment pas venir, tu seras noté.e absent.e à ton service. `
+
`Tu devras alors sélectionner un service de rattrapage sur ton espace membre.`
);
}
else
if
(
error
.
status
===
500
&&
error
.
msg
===
"Fail to create shift"
)
{
}
else
if
(
error
.
status
===
500
&&
'msg'
in
error
.
responseJSON
&&
error
.
responseJSON
.
msg
===
"Fail to create shift"
)
{
// TODO differentiate error cases!
alert
(
`Une erreur est survenue. `
+
`Il est néanmoins possible que la requête ait abouti, `
+
`veuillez patienter quelques secondes puis vérifier vos services enregistrés.`
);
}
else
if
(
error
.
status
===
400
&&
error
.
msg
===
"Bad arguments"
)
{
}
else
if
(
error
.
status
===
400
&&
'msg'
in
error
.
responseJSON
&&
error
.
responseJSON
.
msg
===
"Bad arguments"
)
{
alert
(
`Une erreur est survenue. `
+
`Il est néanmoins possible que la requête ait abouti, `
+
`veuillez patienter quelques secondes puis vérifier vos services enregistrés.`
);
...
...
@@ -306,17 +306,23 @@ function init_shifts_list() {
shift_line_template
.
find
(
".shift_line_time"
).
text
(
datetime_shift_start
.
toLocaleTimeString
(
"fr-fr"
,
time_options
));
// 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"
)
{
shift_line_template
.
find
(
".selectable_shift_line"
).
removeClass
(
"btn--primary"
);
shift_line_template
.
find
(
".selectable_shift_line"
).
addClass
(
"btn"
);
shift_line_template
.
find
(
".checkbox"
).
prop
(
"disabled"
,
"disabled"
);
}
else
{
shift_line_template
.
find
(
".selectable_shift_line"
).
removeClass
(
"btn"
);
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
);
if
(
shift
.
is_makeup
==
true
)
{
shift_line_template
.
find
(
".selectable_shift_line"
).
addClass
(
"btn--warning"
);
shift_line_template
.
find
(
".checkbox"
).
prop
(
"disabled"
,
false
);
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
if
(
partner_data
.
associated_partner_id
===
"False"
&&
partner_data
.
parent_id
===
"False"
)
{
shift_line_template
.
find
(
'.affect_associate_registered'
).
hide
();
...
...
@@ -531,7 +537,7 @@ function init_calendar_page() {
hiddenDays
:
hidden_days
,
events
:
'/shifts/get_list_shift_calendar/'
+
partner_data
.
concerned_partner_id
,
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
;
// Set new shift
...
...
@@ -795,9 +801,9 @@ function init_shifts_exchange() {
$
(
window
).
smartresize
(
function
()
{
// only apply if a width threshold is passed
if
(
vw
>
992
&&
window
.
innerWidth
<=
992
||
vw
<=
992
&&
window
.
innerWidth
>
992
||
vw
>
768
&&
window
.
innerWidth
<=
768
||
vw
>
992
&&
window
.
innerWidth
<=
992
||
vw
<=
992
&&
window
.
innerWidth
>
992
||
vw
>
768
&&
window
.
innerWidth
<=
768
||
vw
<=
768
&&
window
.
innerWidth
>
768
)
{
vw
=
window
.
innerWidth
;
...
...
orders/static/js/orders_helper.js
View file @
d4e58ed9
This diff is collapsed.
Click to expand it.
shifts/views.py
View file @
d4e58ed9
...
...
@@ -101,8 +101,11 @@ def get_list_shift_calendar(request, partner_id):
use_new_members_space
=
getattr
(
settings
,
'USE_NEW_MEMBERS_SPACE'
,
False
)
listRegisterPartner
=
[]
listMakeUpShift
=
[]
for
v
in
registerPartner
:
listRegisterPartner
.
append
(
v
[
'id'
])
if
v
[
'is_makeup'
]:
listMakeUpShift
.
append
(
v
[
'id'
])
start
=
request
.
GET
.
get
(
'start'
)
end
=
request
.
GET
.
get
(
'end'
)
...
...
@@ -136,7 +139,10 @@ def get_list_shift_calendar(request, partner_id):
if
len
(
l
)
>
0
:
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
:
event
[
"className"
]
=
"shift_booked"
event
[
"changed"
]
=
False
...
...
templates/members/inscriptions.html
View file @
d4e58ed9
...
...
@@ -37,7 +37,7 @@
<section
class=
"center"
id=
"new_coop"
>
<div
class=
"grid-1"
>
<div
class=
""
>
<div
class=
"
item-center
"
>
<h2
class=
"title"
>
NOUVEAU MEMBRE
</h2>
...
...
templates/members_space/index.html
View file @
d4e58ed9
...
...
@@ -81,10 +81,12 @@
<div
id=
"calendar_explaination_template"
>
<h4>
Légende du calendrier
</h4>
<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"
><div
class=
"fc-event-main"
><div
class=
"fc-event-main-frame"
><div
class=
"fc-event-time"
>
06:00
</div><div
class=
"fc-event-title-container"
><div
class=
"fc-event-title fc-sticky"
>
- 9/12
</div></div></div></div></a>
<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"
>
- 3/12
</div></div></div></div></a>
<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"
><div
class=
"fc-event-main"
><div
class=
"fc-event-main-frame"
><div
class=
"fc-event-time"
>
06:00
</div><div
class=
"fc-event-title-container"
><div
class=
"fc-event-title fc-sticky"
>
- 9/12
</div></div></div></div></a>
<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_booked_makeup"
><div
class=
"fc-event-main"
><div
class=
"fc-event-main-frame"
><div
class=
"fc-event-time"
>
13:30
</div><div
class=
"fc-event-title-container"
><div
class=
"fc-event-title fc-sticky"
>
- 7/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.
<b>
Plus le chiffre de gauche est petit, plus on a besoin de coopérateurs.rices à ce service !
</b></p>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment