Commit a811cd76 by Damien Moulard

Merge branch '2505-inscription-remove-binome-choice' into 'dev_cooperatic'

2505 inscription remove binome choice

See merge request !160
parents c66994cf f2e8644e
Pipeline #2127 passed with stage
in 1 minute 37 seconds
......@@ -77,3 +77,17 @@
#associate_area{
margin-bottom: 15px;
}
.remove_binome_icon {
margin-left: 10px;
color: #e62720;
}
.remove_binome_icon:hover {
cursor: pointer;
}
.chosen_associate_group {
display: flex;
align-items: center;
}
\ No newline at end of file
......@@ -126,6 +126,7 @@ function create_new_coop() {
$('.chosen_associate').html("");
$('.chosen_associate_area').hide();
$('.member_choice').removeClass('choice_active');
$(".remove_binome_icon").on("click", hide_chosen_associate)
local_in_process = getLocalInProcess();
if (getLocalInProcess().length > 0) {
empty_waiting_local_processes();
......@@ -292,7 +293,7 @@ function store_new_coop(event) {
dataType :'json'
}).done(function(rData) {
if (typeof(rData.answer) == 'boolean' && rData.answer == true) {
errors.push("Ce membre à déjà un Binôme majeur");
errors.push("Ce membre a déjà un binôme majeur");
}
if (errors.length == 0) {
_really_save_new_coop(
......@@ -360,11 +361,12 @@ function modify_current_coop() {
$('#new_member_choice_action').hide();
$('#existing_member_choice').addClass('choice_active');
var member_button = '<div>' + current_coop.parent_name + '</div>';
$('.chosen_associate').html(member_button);
$('.chosen_associate_area').show();
associated_old_choice = 'existing_member_choice';
} else {
$('#new_member_choice_action').show();
$('#existing_member_choice_action').hide();
......@@ -383,6 +385,13 @@ function modify_current_coop() {
}
ncoop_view.show();
}
function hide_chosen_associate() {
selected_associate=null;
$(".chosen_associate_area").hide();
$('.chosen_associate').html("");
}
function modify_coop_by_btn_triggered() {
var clicked = $(this);
var coop_id = clicked.find('div').data('id');
......@@ -602,8 +611,9 @@ $('#odoo_user_connect').click();
$('#add_binome').click(function() {
if ($('#associate_area').is(':visible')) {
$('#associate_area').hide();
associated_old_choice = null;
$('#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;
......
......@@ -97,7 +97,10 @@
<div >
<p><i>Binôme choisi : </i></p>
</div>
<div class="chosen_associate"></div>
<div class="chosen_associate_group">
<span class="chosen_associate"></span>
<i class="fas fa-times remove_binome_icon"></i>
</div>
</div>
</div>
<div id="new_member_choice_action" style="display:none;">
......
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