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
f54ca15d
Commit
f54ca15d
authored
Oct 06, 2022
by
Félicie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
radio button added
parent
2e87daab
Pipeline
#2409
passed with stage
in 1 minute 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
21 deletions
+54
-21
inscriptions.js
members/static/js/inscriptions.js
+41
-18
inscriptions.html
templates/members/inscriptions.html
+13
-3
No files found.
members/static/js/inscriptions.js
View file @
f54ca15d
...
...
@@ -127,6 +127,7 @@ function create_new_coop() {
$
(
'.chosen_associate_area'
).
hide
();
$
(
'.member_choice'
).
removeClass
(
'choice_active'
);
$
(
".remove_binome_icon"
).
on
(
"click"
,
hide_chosen_associate
);
$
(
'input[name="binome"]'
).
prop
(
'checked'
,
false
);
local_in_process
=
getLocalInProcess
();
if
(
getLocalInProcess
().
length
>
0
)
{
empty_waiting_local_processes
();
...
...
@@ -243,6 +244,7 @@ function store_new_coop(event) {
var
errors
=
[],
bc
=
''
,
// barcode may not be present
msex
=
''
,
// sex may not be present
associated_area_actived
=
$
(
'#associate_area'
);
// need to ckeck if type of association is choosen
active_asso_area
=
$
(
'#associate_area .choice_active'
);
// need to ckeck if associated data are available
// 1- Un coop avec le meme mail ne doit pas exister dans odoo (dans base intermediaire, le cas est géré par l'erreur à l'enregistrement)
let
email
=
$
(
'input[name="email"]'
).
val
()
...
...
@@ -268,6 +270,21 @@ function store_new_coop(event) {
}
}
if
(
associated_area_actived
.
show
())
{
// If user choose yes for binome, a type of association must be selected
let
associated_data_selected
=
false
;
if
(
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
"new_member_choice"
)
||
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
"existing_member_choice"
)
)
{
associated_data_selected
=
true
;
}
if
(
associated_data_selected
===
false
)
errors
.
push
(
"Un des deux choix doit être sélectionné"
);
}
if
(
active_asso_area
.
length
>
0
)
{
// If user click as if a "binôme" is beeing created, data about parent member must exist
let
associated_data_ok
=
false
;
...
...
@@ -279,10 +296,15 @@ function store_new_coop(event) {
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
"existing_member_choice"
&&
$
(
'#existing_member_choice_action .chosen_associate div.member'
).
length
>
0
)
)
{
associated_data_ok
=
true
;
}
else
if
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
""
)
{
associated_data_ok
=
false
;
errors
.
push
(
"Un des deux choix doit être sélectionné"
);
}
if
(
associated_data_ok
===
false
)
errors
.
push
(
"Le membre 'titulaire' du binôme n'est pas défini"
);
}
console
.
log
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
))
$
.
ajax
({
url
:
'/members/exists/'
+
email
,
dataType
:
'json'
})
...
...
@@ -611,27 +633,28 @@ $('#coop_create').submit(store_new_coop);
$
(
'#generate_email'
).
click
(
generate_email
);
$
(
'#odoo_user_connect'
).
click
();
$
(
'#add_binome'
).
click
(
function
()
{
if
(
$
(
'#associate_area'
).
is
(
':visible'
))
{
$
(
'#associate_area'
).
hide
();
$
(
'#new_member_input'
).
val
(
''
);
$
(
'#associate_area .choice_active'
).
removeClass
(
"choice_active"
);
associated_old_choice
=
null
;
if
(
current_coop
!=
null
)
{
delete
current_coop
.
parent_name
;
delete
current_coop
.
parent_id
;
delete
current_coop
.
is_associated_people
;
delete
current_coop
.
shift_template
;
}
}
else
{
$
(
'#associate_area'
).
show
();
$
(
'.member_choice'
).
removeClass
(
'choice_active'
);
$
(
'#existing_member_choice_action'
).
hide
();
$
(
'#new_member_choice_action'
).
hide
();
associated_old_choice
=
null
;
$
(
'#no_binome'
).
click
(
function
()
{
$
(
'#associate_area'
).
hide
();
$
(
'#new_member_input'
).
val
(
''
);
$
(
'#associate_area .choice_active'
).
removeClass
(
"choice_active"
);
associated_old_choice
=
null
;
if
(
current_coop
!=
null
)
{
delete
current_coop
.
parent_name
;
delete
current_coop
.
parent_id
;
delete
current_coop
.
is_associated_people
;
delete
current_coop
.
shift_template
;
}
});
$
(
'#add_binome'
).
click
(
function
()
{
$
(
'#associate_area'
).
show
();
$
(
'.member_choice'
).
removeClass
(
'choice_active'
);
$
(
'#existing_member_choice_action'
).
hide
();
$
(
'#new_member_choice_action'
).
hide
();
associated_old_choice
=
null
;
});
$
(
'.member_choice'
).
on
(
'click'
,
function
()
{
if
(
associated_old_choice
!=
null
&&
associated_old_choice
!=
$
(
this
).
attr
(
'id'
))
{
...
...
templates/members/inscriptions.html
View file @
f54ca15d
...
...
@@ -80,15 +80,25 @@
{% endif %}
{% if can_create_binome %}
<p
id=
"add_binome"
>
+ Binomes (facultatif)
</p>
<div>
Voulez-vous mettre la personne en binôme ?
</div>
<label>
<input
type=
"radio"
name=
"binome"
id=
"no_binome"
required
>
Non
</label><br>
<label>
<input
type=
"radio"
name=
"binome"
id=
"add_binome"
required
>
Oui
</label><br>
<div
id=
"associate_area"
style=
"display:none;"
>
<div
class=
"choice_button_area d-flex"
>
<div
id=
"existing_member_choice"
class=
"member_choice"
>
A mettre en bin
o
me avec un.e membre existant.e
A mettre en bin
ô
me avec un.e membre existant.e
</div>
{% if ASSOCIATE_MEMBER_SHIFT %}
<div
id=
"new_member_choice"
class=
"member_choice"
>
A mettre en bin
ome avec un.e
nouveau membre
A mettre en bin
ôme avec un
nouveau membre
</div>
{% endif %}
</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