mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-02 09:32:26 +00:00
Fix affichage dans le dropdown adapté
This commit is contained in:
parent
6d76d0a5f7
commit
6617d6a000
6 changed files with 20 additions and 17 deletions
|
@ -1,2 +1,2 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<li><a href="{% url 'multi_op:aff-state-global' %}"><i class="fa fa-ticket"></i>{% trans "Tickets" %}</a></li>
|
<li><a href="{% url 'multi_op:aff-state-global' %}"><i class="fa fa-random"></i> {% trans "Multi Operators" %}</a></li>
|
||||||
|
|
|
@ -161,13 +161,9 @@ def edit_preferences(request):
|
||||||
return form({'preferencesform':preferencesform,},'multi_op/form_preferences.html',request)
|
return form({'preferencesform':preferencesform,},'multi_op/form_preferences.html',request)
|
||||||
|
|
||||||
|
|
||||||
def navbar_user(request):
|
def navbar_user():
|
||||||
"""View to display the app in user's dropdown in the navbar"""
|
"""View to display the app in user's dropdown in the navbar"""
|
||||||
return render_to_string('multi_op/navbar.html')
|
return ('topologie', render_to_string('multi_op/navbar.html'))
|
||||||
|
|
||||||
def navbar_logout(request):
|
|
||||||
"""View to display the app in user's dropdown in the navbar"""
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def preferences(request):
|
def preferences(request):
|
||||||
|
|
|
@ -62,8 +62,8 @@ def context_optionnal_apps(request):
|
||||||
"""Fonction de context pour générer la navbar en fonction des
|
"""Fonction de context pour générer la navbar en fonction des
|
||||||
apps optionnels"""
|
apps optionnels"""
|
||||||
optionnal_apps = [import_module(app) for app in OPTIONNAL_APPS_RE2O]
|
optionnal_apps = [import_module(app) for app in OPTIONNAL_APPS_RE2O]
|
||||||
optionnal_templates_navbar_user_list = [app.views.navbar_user(request) for app in optionnal_apps]
|
optionnal_templates_navbar_user_list = [app.views.navbar_user() for app in optionnal_apps if hasattr(app.views, 'navbar_user')]
|
||||||
optionnal_templates_navbar_logout_list = [app.views.navbar_logout(request) for app in optionnal_apps]
|
optionnal_templates_navbar_logout_list = [app.views.navbar_logout() for app in optionnal_apps if hasattr(app.views, 'navbar_logout')]
|
||||||
return {'optionnal_templates_navbar_user_list':optionnal_templates_navbar_user_list,
|
return {'optionnal_templates_navbar_user_list':optionnal_templates_navbar_user_list,
|
||||||
'optionnal_templates_navbar_logout_list':optionnal_templates_navbar_logout_list}
|
'optionnal_templates_navbar_logout_list':optionnal_templates_navbar_logout_list}
|
||||||
|
|
||||||
|
|
|
@ -101,9 +101,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<li><a href="{% url 'cotisations:index' %}"><i class="fa fa-eur"></i> {% trans "Manage the subscriptions" %}</a></li>
|
<li><a href="{% url 'cotisations:index' %}"><i class="fa fa-eur"></i> {% trans "Manage the subscriptions" %}</a></li>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
|
||||||
{% for template in optionnal_templates_navbar_user_list%}
|
{% for app, template in optionnal_templates_navbar_user_list %}
|
||||||
{{ template }}
|
{% if app != 'topologie' %}
|
||||||
{% endfor %}
|
{{ template }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
@ -114,6 +116,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<li><a href="{% url 'topologie:index' %}"><i class="fa fa-microchip"></i> {% trans "Switches" %}</a></li>
|
<li><a href="{% url 'topologie:index' %}"><i class="fa fa-microchip"></i> {% trans "Switches" %}</a></li>
|
||||||
<li><a href="{% url 'topologie:index-ap' %}"><i class="fa fa-wifi"></i> {% trans "Access points" %}</a></li>
|
<li><a href="{% url 'topologie:index-ap' %}"><i class="fa fa-wifi"></i> {% trans "Access points" %}</a></li>
|
||||||
<li><a href="{% url 'topologie:index-room' %}"><i class="fa fa-home"></i> {% trans "Rooms" %}</a></li>
|
<li><a href="{% url 'topologie:index-room' %}"><i class="fa fa-home"></i> {% trans "Rooms" %}</a></li>
|
||||||
|
{% for app, template in optionnal_templates_navbar_user_list %}
|
||||||
|
{% if app == 'topologie' %}
|
||||||
|
{{ template }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<li><a href="{% url 'tickets:aff-tickets' %}"><i class="fa fa-ticket"></i>{% trans "Tickets" %}</a></li>
|
<li><a href="{% url 'tickets:aff-tickets' %}"><i class="fa fa-ticket"></i> {% trans "Tickets" %}</a></li>
|
||||||
|
|
|
@ -186,12 +186,12 @@ def preferences(request):
|
||||||
def contact(request):
|
def contact(request):
|
||||||
"""View to display a contact address on the contact page
|
"""View to display a contact address on the contact page
|
||||||
used here to display a link to open a ticket"""
|
used here to display a link to open a ticket"""
|
||||||
return render_to_string('tickets/contact.html')
|
return ('users', render_to_string('tickets/contact.html'))
|
||||||
|
|
||||||
def navbar_user(request):
|
def navbar_user():
|
||||||
"""View to display the ticket link in thet user's dropdown in the navbar"""
|
"""View to display the ticket link in thet user's dropdown in the navbar"""
|
||||||
return render_to_string('tickets/navbar.html')
|
return ('users', render_to_string('tickets/navbar.html'))
|
||||||
|
|
||||||
def navbar_logout(request):
|
def navbar_logout():
|
||||||
"""View to display the ticket link to log out users"""
|
"""View to display the ticket link to log out users"""
|
||||||
return render_to_string('tickets/navbar_logout.html')
|
return render_to_string('tickets/navbar_logout.html')
|
||||||
|
|
Loading…
Reference in a new issue