Commit df17bf60 by Damien Moulard

Merge branch 'ticket_1674' into 'evolution_bdm'

Ticket 1674

See merge request !62
parents 934b8216 5e2cc5c9
Pipeline #1471 passed with stage
in 1 minute 28 seconds
......@@ -44,13 +44,114 @@ default_msettings = {'msg_accueil': {'title': 'Message borne accueil',
'class': 'link',
'sort_order': 6
},
'request_form_link': {
'title': 'Faire une demande au Bureau Des Membres',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 7
},
'late_service_form_link': {
'title': 'Retard à mon service ou oubli validation',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 8
},
'change_template_form_link': {
'title': 'Demande de changement de créneau',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 9
},
#TODO vérifier le nom d'un "binome"
'associated_subscribe_form_link': {
'title': 'Demande de création de binôme',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 10
},
#TODO vérifier le nom d'un "binome"
'associated_unsubscribe_form_link': {
'title': 'Se désolidariser de son binôme',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 11
},
'template_unsubscribe_form_link': {
'title': 'Se désinscrire de son créneau',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 12
},
'change_email_form_link': {
'title': 'Changer d\'adresse mail',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 13
},
'coop_unsubscribe_form_link': {
'title': 'Demande de démission de la coopérative et/ou de remboursement de mes parts sociales',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 14
},
'sick_leave_form_link': {
'title': 'Demande de congé maladie ou parental',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 15
},
'underage_subscribe_form_link': {
'title': 'Demande de création d’un compte mineur rattaché',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 16
},
'helper_subscribe_form_link': {
'title': 'Rejoindre la Brigade Solidaire',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 17
},
'helper_unsubscribe_form_link': {
'title': 'Se désinscrire de la brigade solidaire',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 18
},
'covid_form_link': {
'title': 'J\'ai le Covid-19 !',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 19
},
'covid_end_form_link': {
'title': 'Fin d\'exemption: reprise de mes services',
'type': 'text',
'value': '',
'class': 'link',
'sort_order': 20
},
'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': '',
'class': 'link',
'sort_order': 7
'sort_order': 21
}
}
def config(request):
......@@ -244,7 +345,7 @@ def get_makeups_members(request):
return JsonResponse({ 'res' : res })
def update_members_makeups(request):
""" Met à jour les rattrapages des membres passés dans la requête """
""" 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:
......
#faqBDM {
font-size: 1.8rem;
}
#faqBDM .block {
width: 100%;
}
.info_slots_shifts {
margin: 2rem 0;
}
.grp_text{
margin-top: 25px;
}
.param {margin-bottom: 15px;}
.param label {font-weight: bold;}
input.link {min-width: 50em;}
.submit_button {margin-bottom: 10px;}
/* Style the buttons that are used to open and close the accordion panel */
.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
text-align: left;
border: none;
outline: none;
transition: 0.4s;
}
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
.active, .accordion:hover {
background-color: #ccc;
}
/* Style the accordion panel. Note: hidden by default */
.panel {
padding: 0 18px;
padding-bottom: 10px;
background-color: white;
display: none;
overflow: hidden;
border-left: 1px solid #E5E5E5;
border-right: 1px solid #E5E5E5;
border-bottom: 1px solid #E5E5E5;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
}
button.accordion::after {
content: '\002B';
color: #777;
font-weight: bold;
float: right;
margin-left: 5px;
}
button.accordion.active::after {
content: "\2212";
}
.btn_faq{
white-space: normal;
border-radius: 5px;
margin-top: 3px;
padding-right: 25px;
display: flex;
align-items: flex-end;
}
.full_width{
width: 100%;
}
.faq_link_button_area {
margin-top: 10px;
height: 100%;
}
.faq_link_button {
white-space: normal;
border-radius: 5px;
}
.faq_link_button:hover {
color: #fff;
text-decoration: none;
}
.faq_intro_texts {
margin-bottom: 30px;
}
\ No newline at end of file
function init_faq() {
$("#unsuscribe_form_link_btn").prop("href", unsuscribe_form_link);
$("#unsuscribe_form_link_btn2").prop("href", unsuscribe_form_link);
$("#change_template_form_link_btn").prop("href", change_template_form_link);
$("#template_unsubscribe_form_link_btn").prop("href", template_unsubscribe_form_link);
$("#late_service_form_link_btn").prop("href", late_service_form_link);
$("#sick_leave_form_link_btn").prop("href", sick_leave_form_link);
$("#associated_subscribe_form_link_btn").prop("href", associated_subscribe_form_link);
$("#associated_unsubscribe_form_link_btn").prop("href", associated_unsubscribe_form_link);
$("#covid_form_link_btn").prop("href", covid_form_link);
$("#covid_end_form_link_btn").prop("href", covid_end_form_link);
$("#underage_subscribe_form_link_btn").prop("href", underage_subscribe_form_link);
$("#change_email_form_link_btn").prop("href", change_email_form_link);
$("#coop_unsubscribe_form_link_btn").prop("href", coop_unsubscribe_form_link);
$("#helper_subscribe_form_link_btn").prop("href", helper_subscribe_form_link);
$("#helper_unsubscribe_form_link_btn").prop("href", helper_unsubscribe_form_link);
$("#request_form_link_btn2").prop("href", request_form_link);
$("#request_form_link_btn").prop("href", request_form_link);
}
$(document).on('click', '.accordion', function() {
/* Toggle between adding and removing the "active" class,
to highlight the button that controls the panel */
this.classList.toggle("active");
/* Toggle between hiding and showing the active panel */
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none";
} else {
panel.style.display = "block";
}
$("#shift_exchange_btn").on("click", () => {
goto('echange-de-services');
})
});
\ No newline at end of file
......@@ -36,6 +36,13 @@ $(document).ready(function() {
}
toggleHeader();
});
$('#nav_faq').on('click', (e) => {
e.preventDefault();
if (current_location !== "faq") {
goto('faq');
}
toggleHeader();
});
$('#nav_shifts_exchange').on('click', (e) => {
e.preventDefault();
if (current_location !== "shifts_exchange") {
......
......@@ -55,7 +55,7 @@ function load_partner_shifts(partner_id) {
/* - Navigation */
/**
* @param {String} page home | mes-infos | mes-services | echange-de-services
* @param {String} page home | mes-infos | mes-services | echange-de-services | faq
*/
function goto(page) {
if (window.location.pathname === base_location) {
......@@ -88,6 +88,10 @@ function update_dom() {
current_location = "my_shifts";
$("#main_content").load("/members_space/my_shifts", update_content);
$("#nav_my_shifts").addClass("active");
} else if (window.location.pathname === base_location + "faq") {
current_location = "faq";
$("#main_content").load("/members_space/faqBDM", update_content);
$("#nav_faq").addClass("active");
} else if (window.location.pathname === base_location + "echange-de-services") {
current_location = "shifts_exchange";
$("#main_content").load("/members_space/shifts_exchange", update_content);
......@@ -112,6 +116,9 @@ function update_content() {
case 'my_shifts':
init_my_shifts();
break;
case 'faq':
init_faq();
break;
case 'shifts_exchange':
init_shifts_exchange();
break;
......
......@@ -9,6 +9,7 @@ urlpatterns = [
url(r'^my_info$', views.my_info),
url(r'^my_shifts$', views.my_shifts),
url(r'^shifts_exchange$', views.shifts_exchange),
url(r'^faqBDM$', views.faqBDM),
url(r'^no_content$', views.no_content),
url(r'^get_shifts_history$', views.get_shifts_history),
url('/*$', views.index), # Urls unknown from the server will redirect to index
......
......@@ -130,7 +130,20 @@ def index(request, exception=None):
context['abcd_calendar_link'] = ( msettings['abcd_calendar_link']['value']
if 'abcd_calendar_link' in msettings
else '')
context['request_form_link'] = msettings['request_form_link']['value'] if 'request_form_link' in msettings else ''
context['late_service_form_link'] = msettings['late_service_form_link']['value'] if 'late_service_form_link' in msettings else ''
context['change_template_form_link'] = msettings['change_template_form_link']['value'] if 'change_template_form_link' in msettings else ''
context['associated_subscribe_form_link'] = msettings['associated_subscribe_form_link']['value'] if 'associated_subscribe_form_link' in msettings else ''
context['associated_unsubscribe_form_link'] = msettings['associated_unsubscribe_form_link']['value'] if 'associated_unsubscribe_form_link' in msettings else ''
context['template_unsubscribe_form_link'] = msettings['template_unsubscribe_form_link']['value'] if 'template_unsubscribe_form_link' in msettings else ''
context['change_email_form_link'] = msettings['change_email_form_link']['value'] if 'change_email_form_link' in msettings else ''
context['coop_unsubscribe_form_link'] = msettings['coop_unsubscribe_form_link']['value'] if 'coop_unsubscribe_form_link' in msettings else ''
context['sick_leave_form_link'] = msettings['sick_leave_form_link']['value'] if 'sick_leave_form_link' in msettings else ''
context['underage_subscribe_form_link'] = msettings['underage_subscribe_form_link']['value'] if 'underage_subscribe_form_link' in msettings else ''
context['helper_subscribe_form_link'] = msettings['helper_subscribe_form_link']['value'] if 'helper_subscribe_form_link' in msettings else ''
context['helper_unsubscribe_form_link'] = msettings['helper_unsubscribe_form_link']['value'] if 'helper_unsubscribe_form_link' in msettings else ''
context['covid_form_link'] = msettings['covid_form_link']['value'] if 'covid_form_link' in msettings else ''
context['covid_end_form_link'] = msettings['covid_end_form_link']['value'] if 'covid_end_form_link' in msettings else ''
else:
# may arrive when switching database without cleaning cookie
return redirect('/website/deconnect')
......@@ -180,6 +193,16 @@ def shifts_exchange(request):
}
return HttpResponse(template.render(context, request))
def faqBDM(request):
template = loader.get_template('members_space/faq.html')
context = {
'title': 'foire aux questions',
}
msettings = MConfig.get_settings('members')
return HttpResponse(template.render(context, request))
def no_content(request):
""" Endpoint the front-end will call to load the "No content" page. """
template = loader.get_template('members_space/no_content.html')
......
......@@ -133,7 +133,6 @@ function get_module_settings() {
})
if (added_elts.length > 0) {
submit_btn.prependTo(main_content);
submit_btn.clone().appendTo(main_content);
}
submit_btn.click(save_module_settings);
quill_containers.forEach(function(params){
......
......@@ -6,10 +6,12 @@
{% block content %}
<div class="topnav" id="topnav">
<a href="#" class="nav_item active" id="nav_home">Espace Membre</a>
<a href="#" class="nav_item" id="nav_my_info">Mes Infos</a>
<a href="#" class="nav_item" id="nav_my_shifts">Mes Services</a>
<a href="#" class="nav_item" id="nav_shifts_exchange">Échange de services</a>
<a href="javascript:void(0);" class="nav_item active" id="nav_home">Espace Membre</a>
<a href="javascript:void(0);" class="nav_item" id="nav_my_info">Mes Infos</a>
<a href="javascript:void(0);" class="nav_item" id="nav_my_shifts">Mes Services</a>
<a href="javascript:void(0);" class="nav_item" id="nav_shifts_exchange">Échange de services</a>
<a href="javascript:void(0);" class="nav_item" id="nav_faq">Problèmes & Demandes</a>
<a
href="javascript:void(0);"
target="_blank"
......@@ -18,6 +20,7 @@
>
Calendrier ABCD
</a>
{# Disconnection button must have this id (logic in all_common.js) #}
<a href="javascript:void(0);" id="deconnect">Déconnexion</a>
<a href="javascript:void(0);" class="icon" onclick="toggleHeader()">
......
......@@ -4,9 +4,10 @@
{% block additionnal_css %}
<link rel="stylesheet" href="{% static 'css/datatables/jquery.dataTables.css' %}">
<link rel="stylesheet" href="{% static 'css/datatables/responsive.dataTables.min.css' %}">
<link rel="stylesheet" href="{% static 'fullcalendar-5.9.0/lib/main.min.css' %}"></script>
<link rel="stylesheet" href="{% static 'fullcalendar-5.9.0/lib/main.min.css' %}">
<link rel="stylesheet" href="{% static "css/members-space.css" %}?v=">
<link rel="stylesheet" href="{% static "css/members-space-my-shifts.css" %}?v=">
<link rel="stylesheet" href="{% static "css/members-space-faq.css" %}?v=">
<link rel="stylesheet" href="{% static "css/members-space-my-info.css" %}?v=">
<link rel="stylesheet" href="{% static "css/members-space-shifts-exchange.css" %}?v=">
{% endblock %}
......@@ -76,6 +77,20 @@
var app_env = '{{app_env}}';
var forms_link = '{{forms_link}}';
var unsuscribe_form_link = '{{unsuscribe_form_link}}';
var request_form_link = '{{request_form_link}}';
var late_service_form_link = '{{late_service_form_link}}';
var change_template_form_link = '{{change_template_form_link}}';
var associated_subscribe_form_link = '{{associated_subscribe_form_link}}';
var associated_unsubscribe_form_link = '{{associated_unsubscribe_form_link}}';
var template_unsubscribe_form_link = '{{template_unsubscribe_form_link}}';
var change_email_form_link = '{{change_email_form_link}}';
var coop_unsubscribe_form_link = '{{coop_unsubscribe_form_link}}';
var sick_leave_form_link = '{{sick_leave_form_link}}';
var underage_subscribe_form_link = '{{underage_subscribe_form_link}}';
var helper_subscribe_form_link = '{{helper_subscribe_form_link}}';
var helper_unsubscribe_form_link = '{{helper_unsubscribe_form_link}}';
var covid_form_link = '{{covid_form_link}}';
var covid_end_form_link = '{{covid_end_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}}"
......@@ -108,6 +123,7 @@
<script src="{% static "js/members-space-home.js" %}?v="></script>
<script src="{% static "js/members-space-my-info.js" %}?v="></script>
<script src="{% static "js/members-space-my-shifts.js" %}?v="></script>
<script src="{% static "js/members-space-faq.js" %}?v="></script>
<script src="{% static "js/members-space-shifts-exchange.js" %}?v="></script>
<script src="{% static "js/members-space.js" %}?v="></script>
{% endblock %}
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