Commit 455757da by François

Merge branch 'evolution_bdm' of…

Merge branch 'evolution_bdm' of https://gl.cooperatic.fr/cooperatic-foodcoops/third-party into evolution_bdm
parents 7b266f4d f84ff8b4
Pipeline #1374 failed with stage
in 1 minute 50 seconds
......@@ -24,6 +24,21 @@ default_msettings = {'msg_accueil': {'title': 'Message borne accueil',
'title': 'Lien vers le calendrier ABCD',
'type': 'text',
'value': ''
},
'forms_link' : {
'title': 'Lien vers la page des formulaires',
'type': 'text',
'value': ''
},
'unsuscribe_form_link' : {
'title': 'Lien vers le formulaire de ré-inscription',
'type': 'text',
'value': ''
},
'member_cant_have_delay_form_link' : {
'title': 'Lien vers le formulaire pour les membres n\'ayant pas rattrapé leur service après 6 mois',
'type': 'text',
'value': ''
}
}
......@@ -200,3 +215,31 @@ def create_envelops(request):
else:
response = JsonResponse(res, status=403)
return response
# # # ADMIN / BDM # # #
def admin(request):
""" Administration des membres """
template = loader.get_template('members/admin/index.html')
context = {'title': 'BDM',
'module': 'Membres'}
return HttpResponse(template.render(context, request))
def get_makeups_members(request):
""" Récupération des membres qui doivent faire des rattrapages """
res = CagetteMembers.get_makeups_members()
return JsonResponse({ 'res' : res })
def update_members_makeups(request):
""" Décrémente les rattrapages des membres passés dans la requête """
res = {}
is_connected_user = CagetteUser.are_credentials_ok(request)
if is_connected_user is True:
members_data = json.loads(request.body.decode())
res["res"] = CagetteMembers.update_members_makeups(members_data)
response = JsonResponse(res)
else:
res["message"] = "Unauthorized"
response = JsonResponse(res, status=403)
return response
......@@ -1015,7 +1015,28 @@ class CagetteMembers(models.Model):
res['error'] = str(e)
return res
@staticmethod
def get_makeups_members():
api = OdooAPI()
cond = [['makeups_to_do','>', 0]]
fields = ['id', 'name', 'makeups_to_do']
res = api.search_read('res.partner', cond, fields)
return res
@staticmethod
def update_members_makeups(members_data):
api = OdooAPI()
res = []
for member_data in members_data:
member_id = int(member_data["member_id"])
f = { 'makeups_to_do': int(member_data["target_makeups_nb"]) }
res_item = api.update('res.partner', [member_id], f)
res.append({
'mid': member_id,
'update': res_item
})
return res
class CagetteServices(models.Model):
"""Class to handle cagette Odoo services."""
......
.page_body{
position: relative;
}
.header {
margin: 1.5rem 0;
}
.login_area {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.tabs {
margin-top: 1em;
margin-bottom: 1em;
overflow: hidden;
}
.tabs .tab {
background-color: #f1f1f1;
border: 1px solid #ccc;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
}
.tabs .tab:hover {
background-color: #ccc;
}
.tabs .active {
background-color: transparent;
border: 1px solid #ccc;
border-width: 1px 0 0 0;
}
.tabs .active:hover {
background-color: white;
}
.tab_content {
animation: fadeEffect 1s; /* Fading effect takes 1 second */
}
/* Go from zero to full opacity */
@keyframes fadeEffect {
from {opacity: 0;}
to {opacity: 1;}
}
#tab_makeups_content {
padding: 2rem 0;
}
#table_top_area {
display: flex;
justify-content: space-between;
}
#decrement_selected_members_makeups {
display: none;
}
.table_area {
margin-top: 20px;
}
.decrement_makeup {
padding: 0.4rem 1.25rem;
margin-left: 10px;
}
.select_member_cb {
cursor: pointer;
}
\ No newline at end of file
......@@ -55,10 +55,10 @@ sync.on('change', function (info) {
update_completed_count();
online = true;
})
.on('denied', function (err) {
.on('denied', function () {
// a document failed to replicate (e.g. due to permissions)
})
.on('complete', function (info) {
.on('complete', function () {
// handle complete
})
.on('error', function (err) {
......@@ -87,9 +87,7 @@ function new_coop_validation() {
coop_list_view.hide();
schoice_view.hide();
ncoop_view.hide();
var barcode_base = current_coop.barcode_base;
var st = get_shift_name(current_coop.shift_template.data);
//coop_registration_details.find('.numbox').text('N° '+ barcode_base);
coop_registration_details.find('.shift_template').text(st);
process_state.html(current_coop.firstname + ' ' +current_coop.lastname);
......@@ -148,12 +146,11 @@ function _really_save_new_coop(email, fname, lname, cap, pm, cn, bc, msex) {
if (email != current_email) {
//delete current_coop after copying revelant data
dbc.remove(current_email, coop._rev, function(err, response) {
dbc.remove(current_email, coop._rev, function(err) {
if (err) {
return console.log(err);
}
//console.log(response);
});
delete coop._rev;
......@@ -461,7 +458,7 @@ function setLocalInProcess(lip) {
localStorage.setItem("in_process", JSON.stringify(lip));
}
function keep_in_process_work(event) {
function keep_in_process_work() {
//If data registration is in process, save it in localStorage
if (current_coop != null && typeof (current_coop.shift_template) == "undefined") {
local_in_process = getLocalInProcess();
......
......@@ -9,7 +9,7 @@ if (coop_is_connected()) {
env_template = $('#templates [data-type="envelops"]');
// PouchDB sync actions listeners
sync.on('change', function (info) {
sync.on('change', function () {
// handle change
......@@ -27,10 +27,10 @@ if (coop_is_connected()) {
//update_completed_count();
online = true;
})
.on('denied', function (err) {
.on('denied', function () {
// a document failed to replicate (e.g. due to permissions)
})
.on('complete', function (info) {
.on('complete', function () {
// handle complete
})
.on('error', function (err) {
......@@ -333,7 +333,7 @@ if (coop_is_connected()) {
dsha1 = sha1(jss),
member = {_id: dsha1, data: data, hash: dsha1 };
dbc.put(member, function callback(err, result) {
dbc.put(member, function callback(err) {
if (!err) {
closeModal();
page_cleaning();
......
......@@ -33,7 +33,6 @@ var shift_members = $('#current_shift_members');
var service_validation = $('#service_validation');
var validation_last_call = 0;
var rattrapage_wanted = $('[data-next="rattrapage_1"]');
var rattrapage_validation = $('#rattrapage_validation');
var webcam_is_attached = false;
var photo_advice = $('#photo_advice');
var photo_studio = $('#photo_studio');
......@@ -637,7 +636,7 @@ shift_members.on("click", '.btn[data-rid]', function() {
});
pages.shopping_entry.on('css', function(e) {
pages.shopping_entry.on('css', function() {
photo_advice.hide();
photo_studio.hide();
search_box_clear_html_elts();
......@@ -645,14 +644,14 @@ pages.shopping_entry.on('css', function(e) {
move_search_box(pages.rattrapage_1, pages.shopping_entry);
});
pages.service_entry.on('css', function(e) {
pages.service_entry.on('css', function() {
photo_advice.hide();
photo_studio.hide();
clean_service_entry();
get_service_entry_data();
});
pages.rattrapage_1.on('css', function(e) {
pages.rattrapage_1.on('css', function() {
search_box_clear_html_elts();
var msg = "Vous venez pour un rattrapage.";
......@@ -682,7 +681,7 @@ function ask_for_easy_shift_validation() {
{
coop_id: operator.id
},
function(err, result) {
function(err) {
if (!err) {
alert("1 point volant vient d'être ajouté.");
clean_search_for_easy_validate_zone();
......@@ -798,7 +797,7 @@ $(document).ready(function() {
display_possible_members();
},
error: function(data) {
error: function() {
err = {
msg: "erreur serveur lors de la recherche de membres",
ctx: 'easy_validate.search_members'
......
var makeups_members_table = null,
makeups_members = null,
selected_rows = []; // Contain members id
function switch_active_tab() {
// Set tabs
$('.tab').removeClass('active');
$(this).addClass('active');
// Tabs content
$('.tab_content').hide();
let tab = $(this).attr('id');
if (tab == 'tab_makeups') {
$('#tab_makeups_content').show();
}
load_tab_data();
}
/**
* Load data for the current tab
*/
function load_tab_data() {
let current_tab = $('.tab .active').attr('id');
if (current_tab === 'tab_makeups' && makeups_members === null) {
load_makeups_members();
}
}
/**
* Load partners who have makeups to do
*/
function load_makeups_members() {
$.ajax({
type: 'GET',
url: "/members/get_makeups_members",
dataType:"json",
traditional: true,
contentType: "application/json; charset=utf-8",
success: function(data) {
makeups_members = data.res;
display_makeups_members();
},
error: function(data) {
err = {msg: "erreur serveur lors de la récupération des membres avec rattrapage", ctx: 'load_makeups_members'};
if (typeof data.responseJSON != 'undefined' && typeof data.responseJSON.error != 'undefined') {
err.msg += ' : ' + data.responseJSON.error;
}
report_JS_error(err, 'orders');
closeModal();
alert('Erreur serveur lors de la récupération des membres avec rattrapage. Ré-essayez plus tard.');
}
});
}
/**
* (Re)Display table of makeup members
*/
function display_makeups_members() {
if (makeups_members_table) {
$('#makeups_members_table').off();
makeups_members_table.clear().destroy();
$('#makeups_members_table').empty();
}
// Remove members with 0 makeups to do
ids_to_remove = [];
for (member_item of makeups_members) {
if (member_item.makeups_to_do == 0) {
ids_to_remove.push(member_item.id);
}
}
makeups_members = makeups_members.filter(m => !ids_to_remove.includes(m.id));
// TODO : select multiple and grouped action
makeups_members_table = $('#makeups_members_table').DataTable({
data: makeups_members,
columns: [
{
data: "id",
title: '',
className: "dt-body-center",
orderable: false,
render: function (data) {
return `<input type="checkbox" class="select_member_cb" id="select_member_${data}" value="${data}">`;
},
width: "3%"
},
{
data: "name",
title: "Nom"
},
{
data: "makeups_to_do",
title: "Nb rattrapages",
className: "dt-body-center",
width: "10%",
render: function (data, type, full) {
return `<b>${data}</b>
<button class="decrement_makeup btn--primary" id="decrement_member_${full.id}">
<i class="fas fa-arrow-down"></i>
</button>`;
}
}
],
aLengthMenu: [
[
25,
50,
-1
],
[
25,
50,
"Tout"
]
],
iDisplayLength: -1,
language: {url : '/static/js/datatables/french.json'}
});
$('#makeups_members_table').on('click', 'tbody td .decrement_makeup', function () {
const button_id = $(this).prop('id')
.split('_');
const member_id = button_id[button_id.length - 1];
const member = makeups_members.find(m => m.id == member_id);
openModal(
`Enlever un rattrapage à ${member.name} ?`,
() => {
decrement_makeups([member_id]);
},
"Confirmer",
false
);
});
$('#makeups_members_table').on('click', 'tbody td .select_member_cb', function () {
$(this).closest('tr')
.toggleClass('selected');
// Save / unsave selected row
const m_id = makeups_members_table.row($(this).closest('tr')).data().id;
const first_select = selected_rows.length === 0;
if (this.checked) {
selected_rows.push(m_id);
} else {
const i = selected_rows.findIndex(id => id == m_id);
selected_rows.splice(i, 1);
}
if (selected_rows.length > 0) {
$("#decrement_selected_members_makeups").show();
if (first_select) {
$("#decrement_selected_members_makeups").on("click", () => {
openModal(
`Enlever un rattrapage aux membres sélectionnés ?`,
() => {
decrement_makeups(selected_rows);
},
"Confirmer",
false
);
});
}
} else {
$("#decrement_selected_members_makeups").off()
.hide();
}
});
}
/**
* Send request to update members nb of makeups to do
* @param {Array} member_ids
*/
function decrement_makeups(member_ids) {
openModal();
data = [];
for (mid of member_ids) {
member_index = makeups_members.findIndex(m => m.id == mid);
makeups_members[member_index].makeups_to_do -= 1;
data.push({
member_id: mid,
target_makeups_nb: makeups_members[member_index].makeups_to_do
});
}
$.ajax({
type: 'POST',
url: "/members/update_members_makeups",
data: JSON.stringify(data),
dataType:"json",
traditional: true,
contentType: "application/json; charset=utf-8",
success: function() {
selected_rows = [];
display_makeups_members();
closeModal();
},
error: function(data) {
err = {msg: "erreur serveur pour décrémenter les rattrapages", ctx: 'load_makeups_members'};
if (typeof data.responseJSON != 'undefined' && typeof data.responseJSON.error != 'undefined') {
err.msg += ' : ' + data.responseJSON.error;
}
report_JS_error(err, 'orders');
closeModal();
alert('Erreur serveur lors de la récupération des membres avec rattrapage. Ré-essayez plus tard.');
}
});
}
$(document).ready(function() {
if (coop_is_connected()) {
$.ajaxSetup({ headers: { "X-CSRFToken": getCookie('csrftoken') } });
$(".page_content").show();
load_makeups_members();
$(".tabs .tab").on('click', switch_active_tab);
} else {
$(".page_content").hide();
}
});
......@@ -46,10 +46,10 @@ sync.on('change', function (info) {
// replicate resumed (e.g. new changes replicating, user went back online)
online = true;
})
.on('denied', function (err) {
.on('denied', function () {
// a document failed to replicate (e.g. due to permissions)
})
.on('complete', function (info) {
.on('complete', function () {
// handle complete
})
.on('error', function (err) {
......@@ -113,7 +113,7 @@ function put_current_coop_in_buffer_db(callback) {
var can_continue = true;
if (typeof current_coop._old_id != "undefined") {
dbc.remove(current_coop._old_id, current_coop._rev, function(err, response) {
dbc.remove(current_coop._old_id, current_coop._rev, function(err) {
if (err) {
console.log(err); can_continue = false;
}
......@@ -131,7 +131,6 @@ function put_current_coop_in_buffer_db(callback) {
function process_new_warning(event) {
event.preventDefault();
var msg = warning_msg.val();
var btn = $(event.target).find('button');
openModal();
if (msg.length > 0) {
......@@ -208,7 +207,7 @@ function submit_full_coop_form() {
}
post_form(
'/members/coop_validated_data', form_data,
function(err, result) {
function(err) {
if (!err) {
setTimeout(after_save, 1500);
} else {
......
......@@ -92,7 +92,7 @@ function process_form_submission(event) {
openModal();
post_form(
'/members/coop_validated_data', form_data,
function(err, result) {
function(err) {
closeModal();
if (!err) {
......@@ -119,7 +119,7 @@ function process_form_submission(event) {
openModal();
post_form(
'/members/coop_warning_msg', data,
function(err, result) {
function(err) {
closeModal();
if (!err) {
$('#main_content').remove();
......
......@@ -49,4 +49,8 @@ urlpatterns = [
url(r'^easy_validate_shift_presence$', views.easy_validate_shift_presence),
# conso / groupe recherche / socio
url(r'^panel_get_purchases$', views.panel_get_purchases),
# BDM - members admin
url(r'^admin$', admin.admin),
url(r'^get_makeups_members$', admin.get_makeups_members),
url(r'^update_members_makeups$', admin.update_members_makeups),
]
......@@ -13,10 +13,25 @@
text-align: center;
}
#shifts_exchange .select_makeups, #shifts_exchange .unsuscribed_form_link {
#shifts_exchange .select_makeups, #shifts_exchange .unsuscribed_form_link, .cant_have_delay_form_link {
margin: 1.5rem 0;
}
/* -- Suspended can't have delay screen */
#suspended_cant_have_delay_content {
align-items: center;
text-align: center;
width: 50%;
}
@media screen and (max-width:768px) {
#suspended_cant_have_delay_content {
align-items: center;
text-align: center;
width: 90%;
}
}
/* -- Calendar screen, area on top of the calendar */
#calendar_top_info {
......
......@@ -19,17 +19,14 @@ body {
flex-direction: column;
align-items: center;
border-radius: 30px;
min-height: 350px;
margin: 1rem 1rem;
box-shadow: 2px 2px 3px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1);
}
.subtile {
.high_tile {
min-height: 350px;
}
.subtile.two {
max-width: 45%;
.small_tile {
min-height: 250px;
}
.full_width_tile {
......@@ -46,12 +43,18 @@ body {
padding: 2rem 0;
width: 80%;
}
@media screen and (max-width: 768px) {
.tile_title {
font-size: 2.5rem;
}
}
.tile_content {
position: relative;
margin: 3rem 0;
width: 80%;
display: flex;
height: 100%;
}
#home_tile_services_exchange .tile_content {
......@@ -64,6 +67,13 @@ body {
#home_tile_my_services .tile_content {
height: 100%;
flex-direction: column;
margin: auto;
padding: 2rem 0;
}
@media screen and (min-width: 769px) {
#home_tile_my_services .tile_content {
width: 50%;
}
}
#home_incoming_services {
......@@ -89,7 +99,7 @@ body {
}
#home_go_to_shift_history {
width: 80%;
width: 100%;
margin-top: 30px;
}
......@@ -108,16 +118,25 @@ body {
height: 100%;
flex-direction: column;
align-items: center;
font-size: 2.3rem;
font-size: 2.2rem;
}
@media screen and (max-width: 768px) {
#home_tile_my_info .tile_content {
font-size: 1.9rem;
}
}
.home_member_info {
font-size: 2rem;
#home .member_info {
font-weight: bold;
}
#member_status_action {
margin-bottom:20px;
margin-bottom: 20px;
}
@media screen and (max-width: 768px) {
#member_status_action {
margin-bottom: 10px;
}
}
.choose_makeups {
......@@ -180,14 +199,95 @@ body {
/* --Shifts exchange tile tile */
#go_to_shifts_calendar_area {
.home_link_button_area {
width: 100%;
display: flex;
justify-content: center;
height: 100%;
}
#go_to_shifts_calendar {
.home_link_button {
width: 80%;
margin-top: 20px;
margin: 30px auto auto auto;
white-space: normal;
}
/* -- I have a question tile */
#go_to_forms {
text-decoration: none;
}
#go_to_forms:hover {
color: white;
}
#go_to_forms.active {
color: white !important;
}
/* -- Shop info tile */
#shop_info_content {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
width: 80%;
margin: auto;
}
.shop_info_item {
width: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 2rem;
flex: 1 0 50%;
}
.shop_info_item h1,h2,h3,h4,h5,h6 {
font-size: 2rem;
}
.opening_hours_title {
margin-bottom: 10px;
font-size: 2.3rem;
font-weight: bold;
}
.shop_message_content {
text-align: center;
}
@media screen and (min-width: 769px) {
.shop_info_item {
padding: 0 4rem;
}
.shop_message {
border-left: 1px solid #e7e9ed;
margin: 3rem 0;
}
}
@media screen and (max-width: 768px) {
#shop_info_content {
flex-direction: column;
}
.shop_info_item {
flex: 1 0 50%;
width: 100%;
font-size: 1.6rem;
padding: 1.5rem 0;
}
.shop_info_item h1,h2,h3,h4,h5,h6 {
font-size: 1.6rem;
}
.opening_hours_title {
font-size: 1.9rem;
}
.shop_message {
border-top: 1px solid #e7e9ed;
}
.shop_message_content {
width: 90%;
}
}
\ No newline at end of file
......@@ -30,7 +30,7 @@ function request_delay() {
verif_token: partner_data.verif_token,
idPartner: partner_data.partner_id,
start_date: delay_start,
duration: diff_days,
duration: diff_days
},
success: function() {
partner_data.cooperative_state = 'delay';
......@@ -43,9 +43,18 @@ function request_delay() {
&& typeof data.responseJSON != 'undefined'
&& data.responseJSON.message === "delays limit reached") {
closeModal();
alert("Vous avez mis plus de 6 mois pour rattraper un service, " +
"vous ne pouvez plus rien faire depuis l'espace membre. " +
"Merci de contacter le BDM.");
let msg_template = $("#cant_have_delay_msg_template");
openModal(
msg_template.html(),
() => {
window.location =member_cant_have_delay_form_link;
},
"J'accède au formulaire",
true,
false
);
} else {
err = {msg: "erreur serveur lors de la création du délai", ctx: 'request_delay'};
if (typeof data.responseJSON != 'undefined' && typeof data.responseJSON.error != 'undefined') {
......@@ -95,6 +104,7 @@ function init_home() {
e.preventDefault();
goto('mes-infos');
});
$("#go_to_forms").prop("href", forms_link);
// Init my info tile
init_my_info_data();
......
......@@ -106,12 +106,6 @@ function init_history() {
responsivePriority: 1
},
{
data: "created_by",
title: "Créé par",
responsivePriority: 20000,
className: "desktop tablet-l"
},
{
data: "shift_name",
title: "Service"
},
......@@ -119,13 +113,6 @@ function init_history() {
data: "name",
title: "Détails",
responsivePriority: 3
},
{
data: "point_qty",
title: (viewportWidth <= 768) ? "Mvmt de points" : "Mouvement de points",
responsivePriority: 2,
width: "10%",
className: (viewportWidth <= 768) ? "dt-body-center" : ''
}
],
iDisplayLength: -1,
......
......@@ -13,12 +13,12 @@ function can_exchange_shifts() {
}
/**
* A partner can add a shift if:
* A partner should select a shift if:
* - s.he has makeups to do
* - s.he's not an associated partner
* @returns boolean
*/
function can_select_makeup() {
function should_select_makeup() {
return partner_data.makeups_to_do > 0 && partner_data.is_associated_people === "False";
}
......@@ -187,8 +187,8 @@ function init_calendar_page() {
template_explanations.html(),
closeModal,
"J'ai compris"
)
})
);
});
} else {
$("#calendar_explaination_button").hide();
$("#calendar_explaination_area").html(template_explanations.html());
......@@ -201,7 +201,7 @@ function init_calendar_page() {
.then(init_shifts_list);
}
if (can_select_makeup()) {
if (should_select_makeup()) {
$(".makeups_nb").text(partner_data.makeups_to_do);
$("#need_to_select_makeups_message").show();
}
......@@ -283,15 +283,17 @@ function init_calendar_page() {
closeModal,
"J'ai compris"
);
} else if (can_select_makeup()) {
} else if (should_select_makeup()) {
/* choose a makeup service */
// Check if selected new shift is in less than 6 months
if (partner_data.date_delay_stop !== 'False') {
date_partner_delay_stop = new Date(partner_data.date_delay_stop);
if ( datetime_new_shift > date_partner_delay_stop ) {
if (datetime_new_shift > date_partner_delay_stop) {
let msg = `Vous avez jusqu'au ${date_partner_delay_stop.toLocaleDateString("fr-fr", date_options)} ` +
`pour sélectionner un rattrapage (soit une période de 6 mois depuis votre absence).`;
alert(msg);
return;
}
}
......@@ -339,6 +341,22 @@ function init_shifts_exchange() {
$(this).removeClass('active');
});
});
} else if (
partner_data.cooperative_state === 'suspended'
&& partner_data.can_have_delay === 'False') {
let msg_template = $("#cant_have_delay_msg_template");
$(".suspended_cant_have_delay_msg").html(msg_template.html());
$("#suspended_cant_have_delay_content").show();
$(".cant_have_delay_form_link")
.show()
.attr('href', member_cant_have_delay_form_link)
.on('click', function() {
setTimeout(500, () => {
$(this).removeClass('active');
});
});
} else if (partner_data.cooperative_state === 'suspended'
&& partner_data.date_delay_stop === 'False') {
$("#suspended_content").show();
......
......@@ -28,8 +28,8 @@ def index(request, exception=None):
context = {
'title': 'Espace Membre',
'unsuscribe_form_link': getattr(settings, 'UNSUBSCRIBED_FORM_LINK', ''),
}
template = loader.get_template('members_space/index.html')
if ('failure' in credentials):
......@@ -89,14 +89,16 @@ def index(request, exception=None):
except:
pass
context['partnerData'] = partnerData
if partnerData["parent_id"] is not False:
partnerData["parent_name"] = partnerData["parent_id"][1]
partnerData["parent_id"] = partnerData["parent_id"][0]
else:
partnerData["parent_name"] = False
partnerData['can_have_delay'] = cs.member_can_have_delay(int(partner_id))
context['partnerData'] = partnerData
# Days to hide in the calendar
days_to_hide = "0"
context['ADDITIONAL_INFO_SHIFT_PAGE'] = getattr(settings, 'ADDITIONAL_INFO_SHIFT_PAGE', '')
......@@ -105,8 +107,16 @@ def index(request, exception=None):
context['daysToHide'] = days_to_hide
msettings = MConfig.get_settings('members')
if 'abcd_calendar_link' in msettings:
context['abcd_calendar_link'] = msettings['abcd_calendar_link']['value']
context['forms_link'] = msettings['forms_link']['value'] if 'forms_link' in msettings else ''
context['unsuscribe_form_link'] = ( msettings['unsuscribe_form_link']['value']
if 'unsuscribe_form_link' in msettings
else '')
context['member_cant_have_delay_form_link'] = ( msettings['member_cant_have_delay_form_link']['value']
if 'member_cant_have_delay_form_link' in msettings
else '')
context['abcd_calendar_link'] = ( msettings['abcd_calendar_link']['value']
if 'abcd_calendar_link' in msettings
else '')
else:
# may arrive when switching database without cleaning cookie
......
{% extends "base.html" %}
{% load static %}
{% block additionnal_css %}
<link rel="stylesheet" href="{% static 'css/datatables/datatables.min.css' %}">
<link rel="stylesheet" href="{% static 'css/members_admin.css' %}">
<link rel="stylesheet" href="{% static 'jquery-ui-1.12.1/jquery-ui.min.css' %}">
{% endblock %}
{% block additionnal_scripts %}
<script type="text/javascript" src="{% static 'jquery-ui-1.12.1/jquery-ui.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/datatables/datatables.min.js' %}"></script>
{% endblock %}
{% block content %}
<div class="page_body">
<div class="login_area">
{% include "common/conn_admin.html" %}
</div>
<div class="header txtcenter">
<h1>Bureau des membres</h1>
</div>
<div class="page_content">
<section class="tabs autogrid">
<div class="button tab active" id="tab_makeups"><h5>Rattrapages</h5></div>
</section>
<div id="tab_makeups_content" class="tab_content">
<div id="table_top_area">
<h3>Liste des membres devant effectuer un rattrapage</h3>
<div class="table_grouped_action">
<button type="button" class="btn--primary" id="decrement_selected_members_makeups">
-1 rattrapage pour les membres sélectionnés
</button>
</div>
</div>
<div class="table_area">
<table id="makeups_members_table" class="display" cellspacing="0" width="100%"></table>
</div>
</div>
</div>
<div id="templates" style="display:none;"></div>
</div>
<script src='{% static "js/all_common.js" %}?v='></script>
<script src='{% static "js/members_admin.js" %}?v='></script>
{% endblock %}
......@@ -3,7 +3,7 @@
<h1>Mon espace membre</h1>
</div>
<div class="tiles_container">
<div class="tile" id="home_tile_my_info">
<div class="tile high_tile" id="home_tile_my_info">
<div class="tile_title">
<i class="fas fa-user tile_icon"></i>
Mes Infos
......@@ -34,7 +34,7 @@
<a href="#" id="see_more_info_link">Voir plus ></a>
</div>
</div>
<div class="tile" id="home_tile_my_services">
<div class="tile high_tile" id="home_tile_my_services">
<div class="tile_title">
<i class="fas fa-clipboard tile_icon"></i>
Mes Services
......@@ -51,39 +51,60 @@
</div>
</div>
</div>
<div class="tile" id="home_tile_services_exchange">
<div class="tile small_tile" id="home_tile_services_exchange">
<div class="tile_title">
<i class="fas fa-exchange-alt tile_icon"></i>
Échange de services
</div>
<div class="tile_content">
<div id="go_to_shifts_calendar_area">
<button type="button" class="btn--primary" id="go_to_shifts_calendar">
<div class="home_link_button_area">
<button type="button" class="btn--primary home_link_button" id="go_to_shifts_calendar">
Accéder au calendrier d'échange de services
</button>
</div>
</div>
</div>
<div class="tile" id="home_tile_help">
<div class="tile small_tile" id="home_tile_help">
<div class="tile_title">
<i class="fas fa-question-circle tile_icon"></i>
J'ai une demande
</div>
<div class="tile_content">
À venir...
<div class="home_link_button_area">
<a
href="javascript:void(0);"
target="_blank"
type="button"
class="btn--primary home_link_button"
id="go_to_forms"
>
Accéder aux formulaires
</a>
</div>
</div>
</div>
<div class="tile" id="home_tile_message">
<div class="tile small_tile" id="home_tile_shop_info">
<div class="tile_title">
<i class="fas fa-newspaper tile_icon"></i>
Informations magasins
</div>
<div class="subtile">
{{msg_accueil|safe}}
<div id="shop_info_content">
<div class="shop_info_item shop_opening_hours">
<div class="shop_info_item_content">
<div class="opening_hours_title">
Horaires du magasin :
</div>
<div class="subtile">
<div class="opening_hours_content">
{{shop_opening_hours|safe}}
</div>
</div>
</div>
<div class="shop_info_item shop_message">
<div class="shop_info_item_content shop_message_content">
{{msg_accueil|safe}}
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -63,19 +63,30 @@
<p>3/12 <i class="arrow_explanation_numbers fas fa-arrow-right"></i> il y a déjà 3 places réservées à ce service sur 12 disponibles.
<b>Plus le chiffre de gauche est petit, plus on a besoin de coopérateurs.rices à ce service !</b></p>
</div>
<div id="cant_have_delay_msg_template">
<h3>Bonjour, tu avais 6 mois pour rattraper tes services manqués et il semblerait que tu ne l'aies pas fait.</h3>
<h3>Tu ne peux plus sélectionner de rattrapages sur ton espace membre pour le moment,
merci de contacter le bureau des membres pour résoudre ce problème en remplissant ce formulaire : </h3>
</div>
</div>
</div>
<script>
var app_env = '{{app_env}}';
var forms_link = '{{forms_link}}';
var unsuscribe_form_link = '{{unsuscribe_form_link}}';
var member_cant_have_delay_form_link = '{{member_cant_have_delay_form_link}}';
var abcd_calendar_link = "{{abcd_calendar_link}}"
var days_to_hide = "{{daysToHide}}"
var partner_data = {
"partner_id":"{{partnerData.id}}",
"name":"{{partnerData.display_name}}",
"in_ftop_team":"{{partnerData.in_ftop_team}}",
"date_delay_stop":"{{partnerData.date_delay_stop}}",
"cooperative_state":"{{partnerData.cooperative_state}}",
"verif_token" : "{{partnerData.verif_token}}",
"regular_shift_name":"{{partnerData.regular_shift_name}}",
"can_have_delay" : "{{partnerData.can_have_delay}}",
"makeups_to_do" : "{{partnerData.makeups_to_do}}",
"barcode_base" : "{{partnerData.barcode_base}}",
"street" : "{{partnerData.street}}",
......@@ -88,9 +99,8 @@
"is_associated_people" : "{{partnerData.is_associated_people}}",
"parent_id" : "{{partnerData.parent_id}}",
"parent_name" : "{{partnerData.parent_name}}",
"verif_token" : "{{partnerData.verif_token}}",
}
var days_to_hide = "{{daysToHide}}"
var abcd_calendar_link = "{{abcd_calendar_link}}"
</script>
<script src="{% static "js/all_common.js" %}?v="></script>
<script src="{% static "js/members-space-home.js" %}?v="></script>
......
......@@ -5,6 +5,12 @@
J'accède au formulaire
</a>
</div>
<div id="suspended_cant_have_delay_content" class="shifts_exchange_page_content">
<div class="suspended_cant_have_delay_msg"></div>
<a href="#" target="_blank" class="btn--warning cant_have_delay_form_link">
J'accède au formulaire
</a>
</div>
<div id="suspended_content" class="shifts_exchange_page_content">
<h3>Je suis suspendu.e, je dois sélectionner mes rattrapages pour pouvoir refaire mes courses.</h3>
<button type="button" class="btn--danger select_makeups">
......
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