Commit b22feabf by Félicie

updated

parent deac8e8a
Pipeline #1842 passed with stage
in 1 minute 30 seconds
......@@ -45,8 +45,4 @@
.search_member_results {
display: flex;
flex-wrap: wrap;
}
.btn_possible_member {
margin: 0.5rem 1rem;
}
\ No newline at end of file
$(document).ready(function() {
if (coop_is_connected()) {
$.ajaxSetup({ headers: { "X-CSRFToken": getCookie('csrftoken') } });
/**
* Load member infos
*/
function load_member_infos() {
$.ajax({
type: 'GET',
url: "/members_space/my_info/" + selected_member.id,
dataType:"json",
traditional: true,
contentType: "application/json; charset=utf-8",
success: function(data) {
incoming_shifts = data;
display_member_infos();
},
error: function(data) {
err = {msg: "erreur serveur lors de la récupération des infos du membre", ctx: 'load_member_infos'};
if (typeof data.responseJSON != 'undefined' && typeof data.responseJSON.error != 'undefined') {
err.msg += ' : ' + data.responseJSON.error;
}
report_JS_error(err, 'members.admin');
$(".page_content").show();
} else {
$(".page_content").hide();
}
closeModal();
alert('Erreur lors de la récupération des infos du membre.');
}
});
}
$('#back_to_admin_index').on('click', function() {
let base_location = window.location.href.split("manage_attached")[0].slice(0, -1);
/**
* Display table of member future shifts
*/
function display_member_shifts() {
window.location.assign(base_location);
});
}
/**
/**
* Display the members from the search result
*/
function display_possible_members() {
......@@ -42,7 +61,7 @@ function display_possible_members() {
for (member of members_search_results) {
if (member.id == $(this).attr('member_id')) {
selected_member = member;
load_member_future_shifts();
load_member_infos();
$('.search_member_results').empty();
$('.search_member_results_area').hide();
$('#search_member_input').val('');
......@@ -61,6 +80,21 @@ function display_possible_members() {
}
}
$(document).ready(function() {
if (coop_is_connected()) {
$.ajaxSetup({ headers: { "X-CSRFToken": getCookie('csrftoken') } });
$(".page_content").show();
} else {
$(".page_content").hide();
}
$('#back_to_admin_index').on('click', function() {
let base_location = window.location.href.split("manage_attached")[0].slice(0, -1);
window.location.assign(base_location);
});
// Set action to search for the member
$('#search_member_form').submit(function() {
let search_str = $('#search_member_input').val();
......
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