Commit c772725e by Félicie

first commit

parent 2e87daab
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
font-weight: bold; font-weight: bold;
} }
#existing_member_choice, #new_member_choice{ .member_choice{
border: 1px solid black; border: 1px solid black;
width: 40%; width: 40%;
cursor: pointer; cursor: pointer;
...@@ -69,7 +69,8 @@ ...@@ -69,7 +69,8 @@
color: black; color: black;
padding: 1rem 1.5rem; padding: 1rem 1.5rem;
} }
#existing_member_choice:hover, #new_member_choice:hover{
.member_choice:hover, .member_choice:hover{
background-color: #ccc; background-color: #ccc;
} }
...@@ -89,6 +90,10 @@ ...@@ -89,6 +90,10 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
.choice_button_area input[type=radio] {
display: none;
}
#associate_area{ #associate_area{
margin-bottom: 15px; margin-bottom: 15px;
} }
......
...@@ -127,6 +127,7 @@ function create_new_coop() { ...@@ -127,6 +127,7 @@ function create_new_coop() {
$('.chosen_associate_area').hide(); $('.chosen_associate_area').hide();
$('.member_choice').removeClass('choice_active'); $('.member_choice').removeClass('choice_active');
$(".remove_binome_icon").on("click", hide_chosen_associate); $(".remove_binome_icon").on("click", hide_chosen_associate);
$('input[name="binome"]').prop('checked',false);
local_in_process = getLocalInProcess(); local_in_process = getLocalInProcess();
if (getLocalInProcess().length > 0) { if (getLocalInProcess().length > 0) {
empty_waiting_local_processes(); empty_waiting_local_processes();
...@@ -611,8 +612,7 @@ $('#coop_create').submit(store_new_coop); ...@@ -611,8 +612,7 @@ $('#coop_create').submit(store_new_coop);
$('#generate_email').click(generate_email); $('#generate_email').click(generate_email);
$('#odoo_user_connect').click(); $('#odoo_user_connect').click();
$('#add_binome').click(function() { $('#no_binome').click(function() {
if ($('#associate_area').is(':visible')) {
$('#associate_area').hide(); $('#associate_area').hide();
$('#new_member_input').val(''); $('#new_member_input').val('');
$('#associate_area .choice_active').removeClass("choice_active"); $('#associate_area .choice_active').removeClass("choice_active");
...@@ -623,13 +623,16 @@ $('#add_binome').click(function() { ...@@ -623,13 +623,16 @@ $('#add_binome').click(function() {
delete current_coop.is_associated_people; delete current_coop.is_associated_people;
delete current_coop.shift_template; delete current_coop.shift_template;
} }
} else { });
$('#add_binome').click(function() {
$('#associate_area').show(); $('#associate_area').show();
$('input[name="choose_binome"]').prop('required',true);
$('.member_choice').removeClass('choice_active'); $('.member_choice').removeClass('choice_active');
$('#existing_member_choice_action').hide(); $('#existing_member_choice_action').hide();
$('#new_member_choice_action').hide(); $('#new_member_choice_action').hide();
associated_old_choice = null; associated_old_choice = null;
}
}); });
$('.member_choice').on('click', function() { $('.member_choice').on('click', function() {
......
...@@ -80,16 +80,29 @@ ...@@ -80,16 +80,29 @@
{% endif %} {% endif %}
{% if can_create_binome %} {% 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 id="associate_area" style="display:none;">
<div class="choice_button_area d-flex" > <div class="choice_button_area d-flex" >
<div id="existing_member_choice" class="member_choice">
A mettre en binome avec un.e membre existant.e <label class="member_choice" id="existing_member_choice">
</div> <input type="radio" name="choose_binome">
À mettre en binôme avec un.e membre existant.e
</label>
{% if ASSOCIATE_MEMBER_SHIFT %} {% if ASSOCIATE_MEMBER_SHIFT %}
<div id="new_member_choice" class="member_choice"> <label class="member_choice" id="new_member_choice">
A mettre en binome avec un.e nouveau membre <input type="radio" name="choose_binome">
</div> À mettre en binôme avec un nouveau membre
</label>
{% endif %} {% endif %}
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment