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
23109cf5
Commit
23109cf5
authored
Mar 08, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete future registration
parent
9298c1f1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
206 additions
and
73 deletions
+206
-73
members-space-shifts-exchange.css
members_space/static/css/members-space-shifts-exchange.css
+8
-0
members-space-shifts-exchange.js
members_space/static/js/members-space-shifts-exchange.js
+163
-69
urls.py
shifts/urls.py
+1
-0
views.py
shifts/views.py
+31
-0
index.html
templates/members_space/index.html
+3
-4
No files found.
members_space/static/css/members-space-shifts-exchange.css
View file @
23109cf5
...
...
@@ -90,6 +90,14 @@
border-radius
:
5px
;
}
.delete_registration_button
{
justify-content
:
center
;
align-items
:
center
;
margin
:
0.75rem
15px
;
color
:
#d9534f
;
cursor
:
pointer
;
display
:
none
;
}
/* -- Calendar screen, makeups message */
...
...
members_space/static/js/members-space-shifts-exchange.js
View file @
23109cf5
This diff is collapsed.
Click to expand it.
shifts/urls.py
View file @
23109cf5
...
...
@@ -15,6 +15,7 @@ urlpatterns = [
url
(
r'^change_shift'
,
views
.
change_shift
),
url
(
r'^affect_shift'
,
views
.
affect_shift
),
url
(
r'^add_shift'
,
views
.
add_shift
),
url
(
r'^cancel_shift'
,
views
.
cancel_shift
),
url
(
r'^request_delay'
,
views
.
request_delay
),
url
(
r'^reset_members_positive_points'
,
views
.
reset_members_positive_points
)
]
shifts/views.py
View file @
23109cf5
...
...
@@ -310,6 +310,37 @@ def add_shift(request):
else
:
return
HttpResponseForbidden
()
def
cancel_shift
(
request
):
""" Annule une présence à un shift """
if
'verif_token'
in
request
.
POST
:
partner_id
=
int
(
request
.
POST
.
get
(
'idPartner'
))
if
Verification
.
verif_token
(
request
.
POST
.
get
(
'verif_token'
),
partner_id
)
is
True
:
cs
=
CagetteShift
()
listRegister
=
[
int
(
request
.
POST
[
'idRegister'
])]
try
:
response
=
cs
.
cancel_shift
(
listRegister
)
# decrement extra_shift_done if param exists
if
'extra_shift_done'
in
request
.
POST
:
target
=
int
(
request
.
POST
[
"extra_shift_done"
])
-
1
# extra security
if
target
<
0
:
target
=
0
cm
=
CagetteMember
(
partner_id
)
cm
.
update_extra_shift_done
(
target
)
return
JsonResponse
({
"res"
:
'response'
})
except
Exception
as
e
:
return
JsonResponse
({
"error"
:
str
(
e
)},
status
=
500
)
else
:
return
HttpResponseForbidden
()
else
:
return
HttpResponseForbidden
()
def
request_delay
(
request
):
if
'verif_token'
in
request
.
POST
:
if
Verification
.
verif_token
(
request
.
POST
.
get
(
'verif_token'
),
int
(
request
.
POST
.
get
(
'idPartner'
)))
is
True
:
...
...
templates/members_space/index.html
View file @
23109cf5
...
...
@@ -36,16 +36,15 @@
</div>
<div
id=
"selectable_shift_line_template"
>
<div
class=
"d-flex"
>
<div
class=
"d-flex
shift_line_container
"
>
<div
class=
"selectable_shift_line btn--primary"
>
<input
type=
"checkbox"
class=
"checkbox"
>
<div
class=
"selectable_shift_line_text"
>
<span
class=
"shift_line_date"
></span>
-
<span
class=
"shift_line_time"
></span>
</div>
</div>
<div
class=
"affect_associate_registered button--warning"
>
</div>
<div
class=
"affect_associate_registered button--warning"
></div>
<div
class=
"delete_registration_button"
><i
class=
"fas fa-lg fa-trash"
></i></div>
</div>
</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