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
c66994cf
Commit
c66994cf
authored
Apr 15, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2865-email-bdm-deletion' into 'dev_cooperatic'
2865-email-bdm-deletion See merge request
!158
parents
74b6522d
2e1ed9bb
Pipeline
#2125
passed with stage
in 1 minute 46 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
16 deletions
+57
-16
admin.py
members/admin.py
+5
-7
manage_attached.css
members/static/css/admin/manage_attached.css
+17
-3
manage_attached.js
members/static/js/admin/manage_attached.js
+18
-1
manage_attached_delete_pair.html
templates/members/admin/manage_attached_delete_pair.html
+17
-5
No files found.
members/admin.py
View file @
c66994cf
...
@@ -556,8 +556,11 @@ def get_member_info(request, id):
...
@@ -556,8 +556,11 @@ def get_member_info(request, id):
member
=
member
[
0
]
member
=
member
[
0
]
parent
=
None
parent
=
None
if
member
[
'parent_id'
]:
if
member
[
'parent_id'
]:
parent
=
api
.
search_read
(
'res.partner'
,
[[
'id'
,
'='
,
int
(
member
[
'parent_id'
][
0
])]],
[
'barcode_base'
])[
0
]
res_parent
=
api
.
search_read
(
'res.partner'
,
[[
'id'
,
'='
,
int
(
member
[
'parent_id'
][
0
])]],
[
'barcode_base'
,
'email'
])
member
[
'parent_barcode_base'
]
=
parent
[
'barcode_base'
]
if
res_parent
:
parent
=
res_parent
[
0
]
member
[
'parent_barcode_base'
]
=
parent
[
'barcode_base'
]
member
[
'parent_email'
]
=
parent
[
'email'
]
res
[
'member'
]
=
member
res
[
'member'
]
=
member
response
=
JsonResponse
(
res
)
response
=
JsonResponse
(
res
)
else
:
else
:
...
@@ -804,8 +807,3 @@ def delete_pair(request):
...
@@ -804,8 +807,3 @@ def delete_pair(request):
return
response
return
response
else
:
else
:
return
JsonResponse
({
"message"
:
"Method Not Allowed"
},
status
=
405
)
return
JsonResponse
({
"message"
:
"Method Not Allowed"
},
status
=
405
)
def
get_attached_members
(
request
):
""" Récupération des membres qui doivent faire des rattrapages """
res
=
CagetteMembers
.
get_attached_members
()
return
JsonResponse
({
'res'
:
res
})
members/static/css/admin/manage_attached.css
View file @
c66994cf
...
@@ -118,5 +118,19 @@
...
@@ -118,5 +118,19 @@
}
}
/* Modale */
/* Modale */
.attached-members
.member
div
{
width
:
50px
;
display
:
inline-block
;}
.attached-members
.member
div
{
width
:
50px
;
display
:
inline-block
;
margin
:
1rem
0
;}
.attached-members
.member
div
.name
{
width
:
80%
;}
.attached-members
.member
div
.name
{
width
:
100%
;
position
:
relative
;}
\ No newline at end of file
.attached-members
.member
div
.select_after_unattached_state
{
position
:
absolute
;
right
:
5rem
;
top
:
0
;
bottom
:
0
;
margin
:
0
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.attached-members
.member
.after_unattached_state
{
cursor
:
pointer
;
}
\ No newline at end of file
members/static/js/admin/manage_attached.js
View file @
c66994cf
...
@@ -4,6 +4,9 @@ var childId = null;
...
@@ -4,6 +4,9 @@ var childId = null;
var
parentName
=
null
;
var
parentName
=
null
;
var
childName
=
null
;
var
childName
=
null
;
var
parentEmail
=
null
;
var
childEmail
=
null
;
const
possible_cooperative_state
=
{
const
possible_cooperative_state
=
{
suspended
:
"Rattrapage"
,
suspended
:
"Rattrapage"
,
exempted
:
"Exempté.e"
,
exempted
:
"Exempté.e"
,
...
@@ -237,6 +240,14 @@ function confirmDeletion(childId) {
...
@@ -237,6 +240,14 @@ function confirmDeletion(childId) {
modalContent
.
find
(
"#parentName"
).
text
(
parentName
);
modalContent
.
find
(
"#parentName"
).
text
(
parentName
);
modalContent
.
find
(
"#childName"
).
text
(
childName
);
modalContent
.
find
(
"#childName"
).
text
(
childName
);
if
(
parentEmail
!=
false
)
{
modalContent
.
find
(
"#parentEmail"
).
text
(
parentEmail
)
}
if
(
childEmail
!=
false
)
{
modalContent
.
find
(
"#childEmail"
).
text
(
childEmail
)
}
modalContent
=
modalContent
.
html
();
modalContent
=
modalContent
.
html
();
openModal
(
modalContent
,
()
=>
{
openModal
(
modalContent
,
()
=>
{
if
(
is_time_to
(
'delete_pair'
))
{
if
(
is_time_to
(
'delete_pair'
))
{
...
@@ -438,8 +449,14 @@ $(document).ready(function() {
...
@@ -438,8 +449,14 @@ $(document).ready(function() {
traditional
:
true
,
traditional
:
true
,
contentType
:
"application/json; charset=utf-8"
,
contentType
:
"application/json; charset=utf-8"
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
parentName
=
data
.
member
.
parent_barcode_base
+
' - '
+
data
.
member
.
parent_name
;
if
(
data
.
member
.
parent_barcode_base
!==
undefined
)
{
parentName
=
data
.
member
.
parent_barcode_base
+
' - '
+
data
.
member
.
parent_name
;
}
else
{
parentName
=
data
.
member
.
parent_name
;
}
parentEmail
=
data
.
member
.
parent_email
;
childName
=
data
.
member
.
barcode_base
+
' - '
+
data
.
member
.
name
;
childName
=
data
.
member
.
barcode_base
+
' - '
+
data
.
member
.
name
;
childEmail
=
data
.
member
.
email
;
confirmDeletion
(
childId
);
confirmDeletion
(
childId
);
},
},
error
:
function
(
data
)
{
error
:
function
(
data
)
{
...
...
templates/members/admin/manage_attached_delete_pair.html
View file @
c66994cf
...
@@ -18,16 +18,28 @@
...
@@ -18,16 +18,28 @@
<div
id=
"confirmModal"
>
<div
id=
"confirmModal"
>
<h3>
Le binôme est sur le point d'être désolidarisé
</h3>
<h3>
Le binôme est sur le point d'être désolidarisé
</h3>
<br
/>
<br
/>
Êtes-vous sûr.e de vouloir désolidariser :
<div>
<div>
Êtes-vous sur de vouloir désolidariser
<div
class=
"attached-members"
>
<div
class=
"attached-members"
>
<div
class=
"member"
>
<div
class=
"member"
>
<div
class=
"name"
><strong><span
id=
"parentName"
></span></strong>
(titulaire)
</div>
<div
class=
"name"
>
<div><input
type=
"checkbox"
name=
"parent_gone"
class=
"after_unattached_state"
/></div>
<strong><span
id=
"parentName"
></span></strong>
(titulaire)
<br
/>
<i><span
id=
"parentEmail"
></span></i>
<div
class=
"select_after_unattached_state"
>
<input
type=
"checkbox"
name=
"parent_gone"
class=
"after_unattached_state"
/>
</div>
</div>
</div>
</div>
et
<div
class=
"member"
>
<div
class=
"member"
>
<div
class=
"name"
><strong><span
id=
"childName"
></span></strong></div>
<div
class=
"name"
>
<div><input
type=
"checkbox"
name=
"child_gone"
class=
"after_unattached_state"
/></div>
<strong><span
id=
"childName"
></span></strong><br
/>
<i><span
id=
"childEmail"
></span></i>
<div
class=
"select_after_unattached_state"
>
<input
type=
"checkbox"
name=
"child_gone"
class=
"after_unattached_state"
/>
</div>
</div>
</div>
</div>
</div>
</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