Commit 0af19c9f by François C.

#1613 Allow settings to select whether FAQ is shown or not in Members_space

parent a13e7d36
Pipeline #1782 passed with stage
in 1 minute 40 seconds
...@@ -111,6 +111,7 @@ def index(request, exception=None): ...@@ -111,6 +111,7 @@ def index(request, exception=None):
partnerData['can_have_delay'] = cs.member_can_have_delay(int(partner_id)) partnerData['can_have_delay'] = cs.member_can_have_delay(int(partner_id))
m = CagetteMembersSpace() m = CagetteMembersSpace()
context['show_faq'] = getattr(settings, 'MEMBERS_SPACE_FAQ_TEMPLATE', 'members_space/faq.html')
partnerData["comite"] = m.is_comite(partner_id) partnerData["comite"] = m.is_comite(partner_id)
context['partnerData'] = partnerData context['partnerData'] = partnerData
...@@ -197,14 +198,16 @@ def shifts_exchange(request): ...@@ -197,14 +198,16 @@ def shifts_exchange(request):
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
def faqBDM(request): def faqBDM(request):
template = loader.get_template('members_space/faq.html') template_path = getattr(settings, 'MEMBERS_SPACE_FAQ_TEMPLATE', 'members_space/faq.html')
context = { content = ''
'title': 'foire aux questions', if template_path:
} template = loader.get_template(template_path)
context = {
msettings = MConfig.get_settings('members') 'title': 'foire aux questions',
}
return HttpResponse(template.render(context, request)) content = template.render(context, request)
return HttpResponse(content)
def no_content(request): def no_content(request):
""" Endpoint the front-end will call to load the "No content" page. """ """ Endpoint the front-end will call to load the "No content" page. """
......
...@@ -311,6 +311,10 @@ ...@@ -311,6 +311,10 @@
Message shown to people when they connect to the Member Space Message shown to people when they connect to the Member Space
- MEMBERS_SPACE_FAQ_TEMPLATE = None
If set to None, "FAQ menu" will not be shown. To use a custom content add a template and set it's relative path
### Reception ### Reception
- RECEPTION_ADD_ADMIN_MODE = True - RECEPTION_ADD_ADMIN_MODE = True
......
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
<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_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_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_shifts_exchange">Échange de services</a>
{% if show_faq %}
<a href="javascript:void(0);" class="nav_item" id="nav_faq">Problèmes et Demandes</a> <a href="javascript:void(0);" class="nav_item" id="nav_faq">Problèmes et Demandes</a>
{% endif %}
<a <a
href="javascript:void(0);" href="javascript:void(0);"
target="_blank" target="_blank"
......
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