diff --git a/multi_op/templates/multi_op/navbar.html b/multi_op/templates/multi_op/navbar.html index d5b6cb51..c5e84c43 100644 --- a/multi_op/templates/multi_op/navbar.html +++ b/multi_op/templates/multi_op/navbar.html @@ -1,2 +1,2 @@ {% load i18n %} -
  • {% trans "Tickets" %}
  • +
  • {% trans "Multi Operators" %}
  • diff --git a/multi_op/views.py b/multi_op/views.py index 41c7e40d..75811a0d 100644 --- a/multi_op/views.py +++ b/multi_op/views.py @@ -161,13 +161,9 @@ def edit_preferences(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""" - return 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 + return ('topologie', render_to_string('multi_op/navbar.html')) def preferences(request): diff --git a/re2o/context_processors.py b/re2o/context_processors.py index 3ee39073..97f2d4f8 100644 --- a/re2o/context_processors.py +++ b/re2o/context_processors.py @@ -62,8 +62,8 @@ def context_optionnal_apps(request): """Fonction de context pour générer la navbar en fonction des apps optionnels""" 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_logout_list = [app.views.navbar_logout(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() for app in optionnal_apps if hasattr(app.views, 'navbar_logout')] return {'optionnal_templates_navbar_user_list':optionnal_templates_navbar_user_list, 'optionnal_templates_navbar_logout_list':optionnal_templates_navbar_logout_list} diff --git a/templates/base.html b/templates/base.html index f116c2be..122c7c3a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -101,9 +101,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  • {% trans "Manage the subscriptions" %}
  • {% acl_end %} - {% for template in optionnal_templates_navbar_user_list%} - {{ template }} - {% endfor %} + {% for app, template in optionnal_templates_navbar_user_list %} + {% if app != 'topologie' %} + {{ template }} + {% endif %} + {% endfor %} {% acl_end %} @@ -114,6 +116,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
  • {% trans "Switches" %}
  • {% trans "Access points" %}
  • {% trans "Rooms" %}
  • + {% for app, template in optionnal_templates_navbar_user_list %} + {% if app == 'topologie' %} + {{ template }} + {% endif %} + {% endfor %} {% acl_end %} diff --git a/tickets/templates/tickets/navbar.html b/tickets/templates/tickets/navbar.html index 3c4318f7..11473229 100644 --- a/tickets/templates/tickets/navbar.html +++ b/tickets/templates/tickets/navbar.html @@ -1,2 +1,2 @@ {% load i18n %} -
  • {% trans "Tickets" %}
  • +
  • {% trans "Tickets" %}
  • diff --git a/tickets/views.py b/tickets/views.py index 7fb96511..b16e4eea 100644 --- a/tickets/views.py +++ b/tickets/views.py @@ -186,12 +186,12 @@ def preferences(request): def contact(request): """View to display a contact address on the contact page 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""" - 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""" return render_to_string('tickets/navbar_logout.html')