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
2b5c057a
Commit
2b5c057a
authored
Sep 28, 2021
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
block shift exchange if suspended and no delay
parent
056fe5d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
7 deletions
+71
-7
members-space-shifts-exchange.css
members_space/static/css/members-space-shifts-exchange.css
+20
-3
members-space-shifts-exchange.js
members_space/static/js/members-space-shifts-exchange.js
+44
-3
shifts_exchange.html
templates/members_space/shifts_exchange.html
+7
-1
No files found.
members_space/static/css/members-space-shifts-exchange.css
View file @
2b5c057a
#shifts_exchan
ge_content
{
.shifts_exchange_pa
ge_content
{
width
:
95%
;
margin
:
3rem
auto
;
display
:
flex
;
flex-direction
:
column
;
}
/* -- Suspended screen */
#suspended_content
{
align-items
:
center
;
text-align
:
center
;
}
.select_makeups
{
margin
:
2rem
0
;
}
/* -- Calendar screen, shifts list */
#shifts_list
{
flex-direction
:
column
;
display
:
none
;
...
...
@@ -36,12 +49,14 @@
cursor
:
not-allowed
;
}
/* -- Calendar screen, makeups message */
#need_to_select_makeups_message
{
display
:
none
;
align-self
:
center
;
background-color
:
#d9534f
;
color
:
white
;
margin
:
0
1rem
1
rem
1rem
;
margin
:
0
1rem
2
rem
1rem
;
padding
:
1rem
1.25rem
;
text-align
:
center
;
}
...
...
@@ -56,8 +71,10 @@
}
}
/* -- Calendar screen, calendar */
#calendar
{
margin
:
3
rem
1rem
;
margin
:
2
rem
1rem
;
display
:
none
;
}
...
...
members_space/static/js/members-space-shifts-exchange.js
View file @
2b5c057a
...
...
@@ -169,9 +169,10 @@ function init_shifts_list() {
}
}
function
init_shifts_exchange
()
{
// TODO : loading
/**
* Inits the page when the calendar is displayed
*/
function
init_calendar_page
()
{
if
(
incoming_shifts
!==
null
)
{
init_shifts_list
();
}
else
{
...
...
@@ -286,4 +287,43 @@ function init_shifts_exchange() {
});
calendar
.
render
();
}
function
init_shifts_exchange
()
{
// TODO : loading
// TODO : suspended
$
(
".shifts_exchange_page_content"
).
hide
();
if
(
partner_data
.
cooperative_state
===
'unsubscribed'
)
{
// TODO
// $(".unsuscribed_form_link")
// .show()
// .attr('href', unsuscribe_form_link)
// .on('click', function() {
// setTimeout(500, () => {
// $(this).removeClass('active');
// });
// });
}
else
if
(
partner_data
.
cooperative_state
===
'suspended'
&&
partner_data
.
date_delay_stop
===
'False'
)
{
$
(
"#suspended_content"
).
show
();
$
(
".select_makeups"
).
on
(
'click'
,
()
=>
{
openModal
();
// Create 6 month delay
request_delay
()
.
then
(()
=>
{
$
(
"#suspended_content"
).
hide
();
$
(
"#shifts_exchange_content"
).
show
();
closeModal
();
init_calendar_page
();
});
});
}
else
{
$
(
"#shifts_exchange_content"
).
show
();
init_calendar_page
();
}
}
\ No newline at end of file
templates/members_space/shifts_exchange.html
View file @
2b5c057a
<div
id=
"shifts_exchange"
>
<div
id=
"shifts_exchange_content"
>
<div
id=
"suspended_content"
class=
"shifts_exchange_page_content"
>
<h3>
Je suis suspendu.e, je dois sélectionner mes rattrapages pour pouvoir refaire mes courses.
</h3>
<button
type=
"button"
class=
"btn--danger select_makeups"
>
Je sélectionne mes rattrapages
</button>
</div>
<div
id=
"shifts_exchange_content"
class=
"shifts_exchange_page_content"
>
<div
id=
"need_to_select_makeups_message"
>
<span
class=
"select_makeups_message_block"
>
<i
class=
"fas fa-exclamation-triangle makeups_warning"
></i>
...
...
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