aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb1
-rw-r--r--app/helpers/custom_view_helper.rb9
-rw-r--r--app/views/dashboards/_dashboard.html.slim37
-rw-r--r--app/views/layouts/navigation/_main_nav_left.html.slim108
-rw-r--r--app/views/layouts/navigation/_main_nav_left_content.html.slim0
-rw-r--r--app/views/layouts/navigation/_main_nav_left_content_stif.html.slim107
-rw-r--r--app/views/lines/index.html.slim2
-rw-r--r--app/views/referential_companies/index.html.slim2
-rw-r--r--app/views/referential_networks/index.html.slim2
-rw-r--r--app/views/referential_stop_areas/show.html.slim2
-rw-r--r--app/views/routes/show.html.slim2
-rw-r--r--app/views/stop_areas/index.html.slim2
12 files changed, 160 insertions, 114 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 853c2f715..6a9f6942f 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -48,7 +48,6 @@ class ApplicationController < ActionController::Base
current_organisation
end
-
# Overwriting the sign_out redirect path method
def after_sign_out_path_for(resource_or_scope)
new_user_session_path
diff --git a/app/helpers/custom_view_helper.rb b/app/helpers/custom_view_helper.rb
new file mode 100644
index 000000000..7e7291c81
--- /dev/null
+++ b/app/helpers/custom_view_helper.rb
@@ -0,0 +1,9 @@
+module CustomViewHelper
+
+ def render_custom_view(view)
+ view_name = [view, current_organisation.try(:custom_view)].compact.join('_')
+ Rails.logger.debug "Render custom view #{view_name}"
+ render partial: view_name
+ end
+
+end
diff --git a/app/views/dashboards/_dashboard.html.slim b/app/views/dashboards/_dashboard.html.slim
new file mode 100644
index 000000000..0b5deffc6
--- /dev/null
+++ b/app/views/dashboards/_dashboard.html.slim
@@ -0,0 +1,37 @@
+.row
+ .col-lg-6.col-md-6.col-sm-6.col-xs-12
+ - @dashboard.current_organisation.workbenches.each do |workbench|
+ .panel.panel-default
+ .panel-heading
+ h3.panel-title.with_actions
+ div
+ = workbench.name
+ span.badge.ml-xs = workbench.referentials.count if workbench.referentials.present?
+
+ div
+ = link_to '', workbench_path(workbench), class: ' fa fa-chevron-right pull-right', title: t('.offers.see')
+
+ - if workbench.referentials.present?
+ .list-group
+ - workbench.referentials.limit(5).each do |referential|
+ = link_to referential.name, referential_path(referential, workbench_id: referential.workbench_id, current_workbench_id: workbench.id), class: 'list-group-item'
+ - else
+ .panel-body
+ em.small.text-muted = t('.offers.no_content')
+
+ .col-lg-6.col-md-6.col-sm-6.col-xs-12
+ .panel.panel-default
+ .panel-heading
+ h3.panel-title
+ = "Référentiels d'arrêts"
+ .list-group
+ - @dashboard.current_organisation.stop_area_referentials.each do |referential|
+ = link_to referential.name, stop_area_referential_stop_areas_path(referential), class: 'list-group-item'
+
+ .panel.panel-default
+ .panel-heading
+ h3.panel-title
+ = "Référentiels de lignes"
+ .list-group
+ - @dashboard.current_organisation.line_referentials.all.each do |referential|
+ = link_to referential.name, line_referential_lines_path(referential), class: 'list-group-item'
diff --git a/app/views/layouts/navigation/_main_nav_left.html.slim b/app/views/layouts/navigation/_main_nav_left.html.slim
index 837b9cb73..b63c2dd1c 100644
--- a/app/views/layouts/navigation/_main_nav_left.html.slim
+++ b/app/views/layouts/navigation/_main_nav_left.html.slim
@@ -1,5 +1,3 @@
-- @localizationUrl = "#{params[:controller]}##{params[:action]}"
-
.nav-menu#menu_left
.openMenu title='Ouvrir le menu'
@@ -7,108 +5,4 @@
.closeMenu title='Fermer le menu'
.brandname = t('brandname')
- #menu-items.panel-group
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miOne', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- |Offres courantes
-
- #miOne.panel-collapse.collapse
- .list-group
- = link_to root_path, class: "list-group-item #{(@localizationUrl == 'workbenches#index') ? 'active' : ''}" do
- span Tableau de bord
- = link_to '#', class: 'list-group-item' do
- span Offre de mon organisation
- = link_to '#', class: 'list-group-item' do
- span Offre IDF
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miTwo', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- |Espace de travail
-
- #miTwo.panel-collapse.collapse
- .list-group
- - if current_user
- = link_to workbench_path(current_offer_workbench), class: "list-group-item #{params[:controller] == 'workbenches' ? 'active' : ''}" do
- span Jeux de données
- = 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 workbench_compliance_check_sets_path(current_offer_workbench), class: 'list-group-item' do
- span Rapport de contrôle
- = link_to compliance_control_sets_path, class: 'list-group-item' do
- span Jeux de contrôle
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miThree', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- |Données
-
- #miThree.panel-collapse.collapse
- - if @referential.try(:id) && respond_to?(:current_referential)
- .list-group
- .list-group-item
- = (current_referential.name).upcase
- .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')
-
- - else
- .panel-body
- em.text-muted
- = "Sélectionnez un jeu de données pour accéder à plus de fonctionnalités"
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miFour', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- |Synchronisation
-
- #miFour.panel-collapse.collapse
- .list-group
- = link_to line_referential_path(1), class: "list-group-item #{(@localizationUrl == 'line_referentials#show') ? 'active' : ''}" do
- span Synchronisation iLICO
- = link_to stop_area_referential_path(1), class: "list-group-item #{(@localizationUrl == 'stop_area_referentials#show') ? 'active' : ''}" do
- span Synchronisation iCAR
-
- .menu-item.panel
- .panel-heading
- 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
- span
- span.fa.fa-2x.fa-circle
- |Portail (POSTIF)
-
- = link_to Rails.application.config.try(:codifligne_url), target: '_blank', class: 'list-group-item' do
- span
- span.fa.fa-2x.fa-circle
- |iLICO
-
- = link_to Rails.application.config.try(:reflex_url), target: '_blank', class: 'list-group-item' do
- span
- span.fa.fa-2x.fa-circle
- |iCAR
-
- = link_to '#', target: '_blank', class: 'list-group-item' do
- span
- span.fa.fa-2x.fa-circle
- |Support
+ = render_custom_view 'layouts/navigation/main_nav_left_content'
diff --git a/app/views/layouts/navigation/_main_nav_left_content.html.slim b/app/views/layouts/navigation/_main_nav_left_content.html.slim
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/app/views/layouts/navigation/_main_nav_left_content.html.slim
diff --git a/app/views/layouts/navigation/_main_nav_left_content_stif.html.slim b/app/views/layouts/navigation/_main_nav_left_content_stif.html.slim
new file mode 100644
index 000000000..3963d4cd4
--- /dev/null
+++ b/app/views/layouts/navigation/_main_nav_left_content_stif.html.slim
@@ -0,0 +1,107 @@
+- @localizationUrl = "#{params[:controller]}##{params[:action]}"
+
+#menu-items.panel-group
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miOne', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ |Offres courantes
+
+ #miOne.panel-collapse.collapse
+ .list-group
+ = link_to root_path, class: "list-group-item #{(@localizationUrl == 'workbenches#index') ? 'active' : ''}" do
+ span Tableau de bord
+ = link_to '#', class: 'list-group-item' do
+ span Offre de mon organisation
+ = link_to '#', class: 'list-group-item' do
+ span Offre IDF
+
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miTwo', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ |Espace de travail
+
+ #miTwo.panel-collapse.collapse
+ .list-group
+ - if current_user
+ = link_to workbench_path(current_offer_workbench), class: "list-group-item #{params[:controller] == 'workbenches' ? 'active' : ''}" do
+ span Jeux de données
+ = 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 workbench_compliance_check_sets_path(current_offer_workbench), class: 'list-group-item' do
+ span Rapport de contrôle
+ = link_to compliance_control_sets_path, class: 'list-group-item' do
+ span Jeux de contrôle
+
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miThree', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ |Données
+
+ #miThree.panel-collapse.collapse
+ - if @referential.try(:id) && respond_to?(:current_referential)
+ .list-group
+ .list-group-item
+ = (current_referential.name).upcase
+ .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')
+
+ - else
+ .panel-body
+ em.text-muted
+ = "Sélectionnez un jeu de données pour accéder à plus de fonctionnalités"
+
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miFour', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ |Synchronisation
+
+ #miFour.panel-collapse.collapse
+ .list-group
+ = link_to line_referential_path(1), class: "list-group-item #{(@localizationUrl == 'line_referentials#show') ? 'active' : ''}" do
+ span Synchronisation iLICO
+ = link_to stop_area_referential_path(1), class: "list-group-item #{(@localizationUrl == 'stop_area_referentials#show') ? 'active' : ''}" do
+ span Synchronisation iCAR
+
+ .menu-item.panel
+ .panel-heading
+ 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
+ span
+ span.fa.fa-2x.fa-circle
+ |Portail (POSTIF)
+
+ = link_to Rails.application.config.try(:codifligne_url), target: '_blank', class: 'list-group-item' do
+ span
+ span.fa.fa-2x.fa-circle
+ |iLICO
+
+ = link_to Rails.application.config.try(:reflex_url), target: '_blank', class: 'list-group-item' do
+ span
+ span.fa.fa-2x.fa-circle
+ |iCAR
+
+ = link_to '#', target: '_blank', class: 'list-group-item' do
+ span
+ span.fa.fa-2x.fa-circle
+ |Support
diff --git a/app/views/lines/index.html.slim b/app/views/lines/index.html.slim
index c5b2d0f40..911c95e0c 100644
--- a/app/views/lines/index.html.slim
+++ b/app/views/lines/index.html.slim
@@ -20,7 +20,7 @@
= table_builder_2 @lines,
[ \
TableBuilderHelper::Column.new( \
- name: 'ID Codifligne', \
+ name: t('id_codif'), \
attribute: Proc.new { |n| n.get_objectid.short_id }, \
sortable: false \
), \
diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim
index 9f5cd5d62..3348dc722 100644
--- a/app/views/referential_companies/index.html.slim
+++ b/app/views/referential_companies/index.html.slim
@@ -26,7 +26,7 @@
= table_builder_2 @companies,
[ \
TableBuilderHelper::Column.new( \
- name: 'ID Codifligne', \
+ name: t('id_codif'), \
attribute: Proc.new { |n| n.try(:objectid).try(:local_id) }, \
sortable: false \
), \
diff --git a/app/views/referential_networks/index.html.slim b/app/views/referential_networks/index.html.slim
index e29658f2b..6a2df6d16 100644
--- a/app/views/referential_networks/index.html.slim
+++ b/app/views/referential_networks/index.html.slim
@@ -26,7 +26,7 @@
= table_builder_2 @networks,
[ \
TableBuilderHelper::Column.new( \
- name: 'ID Codifligne', \
+ name: t('id_codif'), \
attribute: Proc.new { |n| n.get_objectid.try(:short_id) }, \
sortable: false \
),
diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim
index b9a1c9899..7cc078ee0 100644
--- a/app/views/referential_stop_areas/show.html.slim
+++ b/app/views/referential_stop_areas/show.html.slim
@@ -19,7 +19,7 @@
.row
.col-lg-6.col-md-6.col-sm-12.col-xs-12
= definition_list t('metadatas'),
- { 'ID Reflex' => @stop_area.try(:user_objectid),
+ { t('id_reflex') => @stop_area.try(:user_objectid),
'Activé' => (@stop_area.deleted_at ? t('false') : t('true')),
@stop_area.human_attribute_name(:comment) => @stop_area.try(:comment),
@stop_area.human_attribute_name(:stop_area_type) => t("area_types.label.#{@stop_area.stop_area_type}"),
diff --git a/app/views/routes/show.html.slim b/app/views/routes/show.html.slim
index 329be4b5f..734d6ebf3 100644
--- a/app/views/routes/show.html.slim
+++ b/app/views/routes/show.html.slim
@@ -38,7 +38,7 @@
= table_builder_2 @route_sp,
[ \
TableBuilderHelper::Column.new( \
- name: 'ID Reflex', \
+ name: t('id_reflex'), \
attribute: Proc.new { |s| s.try(:stop_area).try(:user_objectid) } \
), \
TableBuilderHelper::Column.new( \
diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim
index b838859bf..1b28f411e 100644
--- a/app/views/stop_areas/index.html.slim
+++ b/app/views/stop_areas/index.html.slim
@@ -20,7 +20,7 @@
= table_builder_2 @stop_areas,
[ \
TableBuilderHelper::Column.new( \
- name: 'ID Reflex', \
+ name: t('id_reflex'), \
attribute: Proc.new { |n| n.get_objectid.try(:short_id) }, \
sortable: false \
), \