Commit 0f43c8c3 by Etienne Freiss

création faq BDM. Reste bug static

parent ace150b0
...@@ -169,7 +169,6 @@ def get_settings(request): ...@@ -169,7 +169,6 @@ def get_settings(request):
if is_connected_user is True: if is_connected_user is True:
try: try:
msettings = MConfig.get_settings('members') msettings = MConfig.get_settings('members')
print(msettings)
if len(msettings) == 0: if len(msettings) == 0:
msettings = default_msettings msettings = default_msettings
# take care that every params will be shown (consider newly added params) # take care that every params will be shown (consider newly added params)
...@@ -346,7 +345,7 @@ def get_makeups_members(request): ...@@ -346,7 +345,7 @@ def get_makeups_members(request):
return JsonResponse({ 'res' : res }) return JsonResponse({ 'res' : res })
def update_members_makeups(request): 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 = {} res = {}
is_connected_user = CagetteUser.are_credentials_ok(request) is_connected_user = CagetteUser.are_credentials_ok(request)
if is_connected_user is True: if is_connected_user is True:
......
#faq {
font-size: 1.8rem;
}
.btn_faq{
white-space: normal;
}
.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";
}
.faq_link_button_area {
margin-top: 10px;
height: 100%;
}
.faq_link_button {
/* margin: 30px auto auto auto; */
white-space: normal;
border-radius: 5px;
}
\ 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";
}
});
\ No newline at end of file
...@@ -36,6 +36,13 @@ $(document).ready(function() { ...@@ -36,6 +36,13 @@ $(document).ready(function() {
} }
toggleHeader(); toggleHeader();
}); });
$('#faq').on('click', (e) => {
e.preventDefault();
if (current_location !== "faq") {
goto('faq');
}
toggleHeader();
});
$('#nav_shifts_exchange').on('click', (e) => { $('#nav_shifts_exchange').on('click', (e) => {
e.preventDefault(); e.preventDefault();
if (current_location !== "shifts_exchange") { if (current_location !== "shifts_exchange") {
......
...@@ -84,6 +84,10 @@ function update_dom() { ...@@ -84,6 +84,10 @@ function update_dom() {
current_location = "my_shifts"; current_location = "my_shifts";
$("#main_content").load("/members_space/my_shifts", update_content); $("#main_content").load("/members_space/my_shifts", update_content);
$("#nav_my_shifts").addClass("active"); $("#nav_my_shifts").addClass("active");
} else if (window.location.pathname === base_location + "faq") {
current_location = "faq";
$("#main_content").load("/members_space/faq", update_content);
$("#faq").addClass("active");
} else if (window.location.pathname === base_location + "echange-de-services") { } else if (window.location.pathname === base_location + "echange-de-services") {
current_location = "shifts_exchange"; current_location = "shifts_exchange";
$("#main_content").load("/members_space/shifts_exchange", update_content); $("#main_content").load("/members_space/shifts_exchange", update_content);
...@@ -108,6 +112,9 @@ function update_content() { ...@@ -108,6 +112,9 @@ function update_content() {
case 'my_shifts': case 'my_shifts':
init_my_shifts(); init_my_shifts();
break; break;
case 'faq':
init_faq();
break;
case 'shifts_exchange': case 'shifts_exchange':
init_shifts_exchange(); init_shifts_exchange();
break; break;
......
...@@ -9,6 +9,7 @@ urlpatterns = [ ...@@ -9,6 +9,7 @@ urlpatterns = [
url(r'^my_info$', views.my_info), url(r'^my_info$', views.my_info),
url(r'^my_shifts$', views.my_shifts), url(r'^my_shifts$', views.my_shifts),
url(r'^shifts_exchange$', views.shifts_exchange), url(r'^shifts_exchange$', views.shifts_exchange),
url(r'^faq$', views.faq),
url(r'^no_content$', views.no_content), url(r'^no_content$', views.no_content),
url(r'^get_shifts_history$', views.get_shifts_history), url(r'^get_shifts_history$', views.get_shifts_history),
url('/*$', views.index), url('/*$', views.index),
......
...@@ -117,7 +117,20 @@ def index(request, exception=None): ...@@ -117,7 +117,20 @@ def index(request, exception=None):
context['abcd_calendar_link'] = ( msettings['abcd_calendar_link']['value'] context['abcd_calendar_link'] = ( msettings['abcd_calendar_link']['value']
if 'abcd_calendar_link' in msettings if 'abcd_calendar_link' in msettings
else '') 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: else:
# may arrive when switching database without cleaning cookie # may arrive when switching database without cleaning cookie
return redirect('/website/deconnect') return redirect('/website/deconnect')
...@@ -158,6 +171,16 @@ def shifts_exchange(request): ...@@ -158,6 +171,16 @@ def shifts_exchange(request):
} }
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def faq(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): def no_content(request):
template = loader.get_template('members_space/no_content.html') template = loader.get_template('members_space/no_content.html')
context = { context = {
......
...@@ -133,7 +133,6 @@ function get_module_settings() { ...@@ -133,7 +133,6 @@ function get_module_settings() {
}) })
if (added_elts.length > 0) { if (added_elts.length > 0) {
submit_btn.prependTo(main_content); submit_btn.prependTo(main_content);
submit_btn.clone().appendTo(main_content);
} }
submit_btn.click(save_module_settings); submit_btn.click(save_module_settings);
quill_containers.forEach(function(params){ quill_containers.forEach(function(params){
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<a href="#" class="nav_item active" id="nav_home">Espace Membre</a> <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_info">Mes Infos</a>
<a href="#" class="nav_item" id="nav_my_shifts">Mes Services</a> <a href="#" class="nav_item" id="nav_my_shifts">Mes Services</a>
<a href="#" class="nav_item" id="faq">FAQ</a>
<a href="#" class="nav_item" id="nav_shifts_exchange">Échange de services</a> <a href="#" class="nav_item" id="nav_shifts_exchange">Échange de services</a>
<a <a
href="javascript:void(0);" href="javascript:void(0);"
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
{% block additionnal_css %} {% block additionnal_css %}
<link rel="stylesheet" href="{% static 'css/datatables/jquery.dataTables.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 '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.css" %}?v=">
<link rel="stylesheet" href="{% static "css/members-space-my-shifts.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-my-info.css" %}?v=">
<link rel="stylesheet" href="{% static "css/members-space-shifts-exchange.css" %}?v="> <link rel="stylesheet" href="{% static "css/members-space-shifts-exchange.css" %}?v=">
{% endblock %} {% endblock %}
...@@ -76,6 +77,20 @@ ...@@ -76,6 +77,20 @@
var app_env = '{{app_env}}'; var app_env = '{{app_env}}';
var forms_link = '{{forms_link}}'; var forms_link = '{{forms_link}}';
var unsuscribe_form_link = '{{unsuscribe_form_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 member_cant_have_delay_form_link = '{{member_cant_have_delay_form_link}}';
var abcd_calendar_link = "{{abcd_calendar_link}}" var abcd_calendar_link = "{{abcd_calendar_link}}"
var days_to_hide = "{{daysToHide}}" var days_to_hide = "{{daysToHide}}"
...@@ -106,6 +121,7 @@ ...@@ -106,6 +121,7 @@
<script src="{% static "js/members-space-home.js" %}?v="></script> <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-info.js" %}?v="></script>
<script src="{% static "js/members-space-my-shifts.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-shifts-exchange.js" %}?v="></script>
<script src="{% static "js/members-space.js" %}?v="></script> <script src="{% static "js/members-space.js" %}?v="></script>
{% endblock %} {% 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