diff options
| author | Luc Donnet | 2017-09-07 09:36:02 +0200 | 
|---|---|---|
| committer | Luc Donnet | 2017-09-07 09:36:02 +0200 | 
| commit | bc97ec2588530195075df25ad81f3fd338cef90f (patch) | |
| tree | eaf8e9a8f542bf235fbe537b9238719b02d16f1e | |
| parent | cb87df36c48482b1eb08972be7adcf1a0811cc64 (diff) | |
| download | chouette-core-bc97ec2588530195075df25ad81f3fd338cef90f.tar.bz2 | |
Update links in nav left
| -rw-r--r-- | app/controllers/application_controller.rb | 5 | ||||
| -rw-r--r-- | app/views/layouts/navigation/_main_nav_left.html.slim | 18 | 
2 files changed, 11 insertions, 12 deletions
| diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cc1c30703..8cb5726c4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -33,6 +33,11 @@ class ApplicationController < ActionController::Base    end    helper_method :current_organisation +  def current_offer_workbench +    current_organisation.workbenches.where(name: "Gestion de l'offre") +  end +  helper_method :current_offer_workbench +    def current_functional_scope      functional_scope = current_organisation.sso_attributes.try(:[], "functional_scope") if current_organisation      JSON.parse(functional_scope) if functional_scope diff --git a/app/views/layouts/navigation/_main_nav_left.html.slim b/app/views/layouts/navigation/_main_nav_left.html.slim index 74442692d..4560f5fa0 100644 --- a/app/views/layouts/navigation/_main_nav_left.html.slim +++ b/app/views/layouts/navigation/_main_nav_left.html.slim @@ -31,16 +31,10 @@          #miTwo.panel-collapse.collapse            .list-group -            = link_to '#', class: "list-group-item #{params[:controller] == 'workbenches' ? 'active' : ''}" do +            = link_to workbench_path(current_offer_workbench), class: "list-group-item #{params[:controller] == 'workbenches' ? 'active' : ''}" do                span Jeux de données - -            - if @workbench -              = link_to workbench_imports_path(@workbench), class: "list-group-item #{(params[:controller] == 'imports') ? 'active' : ''}" do -                span Import -            - else -              = link_to '#', class: 'list-group-item disabled' do +            = link_to workbench_imports_path(current_offer_workbench), class: "list-group-item #{(params[:controller] == 'imports') ? 'active' : ''}" do                  span Import -              = link_to calendars_path, class: 'list-group-item' do                span Modèles de calendrier              = link_to '#', class: 'list-group-item' do @@ -62,13 +56,13 @@                  .list-group                    = link_to referential_networks_path(current_referential), class: 'list-group-item' do                      span = t('networks.index.title') -           +                    = link_to referential_companies_path(current_referential), class: 'list-group-item' do                      span = t('companies.index.title') -           +                    = link_to '#', class: 'list-group-item disabled' do                      span Tracés -           +                    = link_to referential_time_tables_path(current_referential), class: 'list-group-item' do                      span = t('time_tables.index.title') @@ -95,7 +89,7 @@            h4.panel-title              = link_to '#miFive', data: { toggle: 'collapse', parent: '#menu-items' }, 'aria-expanded' => 'false' do                |Outils -               +          #miFive.panel-collapse.collapse            .list-group              = link_to Rails.application.config.try(:portal_url), target: '_blank', class: 'list-group-item' do | 
