aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Donnet2018-04-18 15:55:19 +0200
committerLuc Donnet2018-04-19 09:31:18 +0200
commit14f30a9b84da9d93219aa9e9759f93ef71ab3c7f (patch)
treef531d2478a62233581b26dfa2ac57fea384bd01b
parente5b11ab69698502c1642652e3c1249c2abd573b2 (diff)
downloadchouette-core-14f30a9b84da9d93219aa9e9759f93ef71ab3c7f.tar.bz2
Add layout for devise views, Fix i18n on menu, Delete unused elements Refs #6545 @1
-rw-r--r--app/controllers/application_controller.rb12
-rw-r--r--app/views/layouts/application.html.slim6
-rw-r--r--app/views/layouts/devise.html.slim28
-rw-r--r--app/views/layouts/navigation/_main_nav.html.slim6
-rw-r--r--app/views/layouts/navigation/_main_nav_left_content.html.slim137
-rw-r--r--app/views/layouts/navigation/_main_nav_left_content_stif.html.slim220
-rw-r--r--config/locales/layouts.en.yml2
-rw-r--r--config/locales/merges.en.yml23
-rw-r--r--config/locales/merges.fr.yml (renamed from config/locales/merges.yml)0
9 files changed, 221 insertions, 213 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 8b66e6097..7f071a6a4 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -12,6 +12,7 @@ class ApplicationController < ActionController::Base
# Load helpers in rails engine
helper LanguageEngine::Engine.helpers
+ layout :layout_by_resource
def set_locale
# I18n.locale = session[:language] || I18n.default_locale
@@ -56,4 +57,15 @@ class ApplicationController < ActionController::Base
def after_sign_out_path_for(resource_or_scope)
new_user_session_path
end
+
+ private
+
+ def layout_by_resource
+ if devise_controller?
+ "devise"
+ else
+ "application"
+ end
+ end
+
end
diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim
index 3921c8701..abf39c089 100644
--- a/app/views/layouts/application.html.slim
+++ b/app/views/layouts/application.html.slim
@@ -17,7 +17,11 @@ html lang=I18n.locale
| I18n.locale = '#{I18n.locale}'
body
- = render 'layouts/navigation/main_nav'
+ nav#main_nav
+ // Left menu content
+ = render 'layouts/navigation/main_nav_left'
+ // Top menu content
+ = render 'layouts/navigation/main_nav_top'
= render 'layouts/flash_messages', flash: flash
= render 'layouts/navigation/page_header'
= yield
diff --git a/app/views/layouts/devise.html.slim b/app/views/layouts/devise.html.slim
new file mode 100644
index 000000000..34a3a3f11
--- /dev/null
+++ b/app/views/layouts/devise.html.slim
@@ -0,0 +1,28 @@
+doctype html
+html lang=I18n.locale
+ head
+ meta charset="utf-8"
+ meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
+
+ = csrf_meta_tag
+
+ title = t('brandname')
+
+ = stylesheet_link_tag 'base'
+ = stylesheet_link_tag 'application'
+
+ = javascript_pack_tag 'application'
+ = javascript_include_tag 'application'
+ = javascript_tag do
+ | I18n.locale = '#{I18n.locale}'
+
+ body
+ nav#main_nav
+ // Top menu content
+ = render 'layouts/navigation/main_nav_top'
+ = render 'layouts/flash_messages', flash: flash
+ = render 'layouts/navigation/page_header'
+ = yield
+
+ = render 'shared/development_toolbar'
+ = yield :javascript
diff --git a/app/views/layouts/navigation/_main_nav.html.slim b/app/views/layouts/navigation/_main_nav.html.slim
deleted file mode 100644
index 806290223..000000000
--- a/app/views/layouts/navigation/_main_nav.html.slim
+++ /dev/null
@@ -1,6 +0,0 @@
-nav#main_nav
- // Left menu content
- = render 'layouts/navigation/main_nav_left'
-
- // Top menu content
- = render 'layouts/navigation/main_nav_top'
diff --git a/app/views/layouts/navigation/_main_nav_left_content.html.slim b/app/views/layouts/navigation/_main_nav_left_content.html.slim
index f04d05700..0b55578a7 100644
--- a/app/views/layouts/navigation/_main_nav_left_content.html.slim
+++ b/app/views/layouts/navigation/_main_nav_left_content.html.slim
@@ -1,87 +1,64 @@
-- if current_organisation
- - current_organisation.workbenches.each do |workbench|
- #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
- = t('layouts.navbar.current_offer.other')
- #miOne.panel-collapse.collapse
- .list-group
- = link_to root_path, class: "list-group-item" do
- span = t('layouts.navbar.dashboard')
- = link_to workbench_output_path(workbench), class: 'list-group-item' do
- span = t('layouts.navbar.workbench_outputs.organisation')
- = link_to '#', class: 'list-group-item disabled' do
- span = t('layouts.navbar.workbench_outputs.workgroup')
+- current_organisation.workbenches.each do |workbench|
+ #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
+ = t('layouts.navbar.current_offer.other')
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miTwo', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- - t('activerecord.models.workbench.one').capitalize
+ #miOne.panel-collapse.collapse
+ .list-group
+ = link_to root_path, class: "list-group-item" do
+ span = t('layouts.navbar.dashboard')
+ = link_to workbench_output_path(workbench), class: 'list-group-item' do
+ span = t('layouts.navbar.workbench_outputs.organisation')
+ = link_to '#', class: 'list-group-item disabled' do
+ span = t('layouts.navbar.workbench_outputs.workgroup')
- #miTwo.panel-collapse.collapse
- .list-group
- = link_to workbench_path(workbench), class: "list-group-item" do
- span = t('activerecord.models.referential.other').capitalize
- = link_to workbench_imports_path(workbench), class: "list-group-item" do
- span = t('activerecord.models.import.other').capitalize
- = link_to workbench_exports_path(workbench), class: "list-group-item" do
- span = t('activerecord.models.export.other').capitalize
- = link_to workgroup_calendars_path(workbench.workgroup), class: 'list-group-item' do
- span = t('activerecord.models.calendar.other').capitalize
- = link_to workbench_compliance_check_sets_path(workbench), class: 'list-group-item' do
- span = t('activerecord.models.compliance_check_set.other').capitalize
- = link_to compliance_control_sets_path, class: 'list-group-item' do
- span = t('activerecord.models.compliance_control_set.other').capitalize
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miTwo', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ - t('activerecord.models.workbench.one').capitalize
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miThree', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- = t('layouts.navbar.referential_datas')
+ #miTwo.panel-collapse.collapse
+ .list-group
+ = link_to workbench_path(workbench), class: "list-group-item" do
+ span = t('activerecord.models.referential.other').capitalize
+ = link_to workbench_imports_path(workbench), class: "list-group-item" do
+ span = t('activerecord.models.import.other').capitalize
+ = link_to workbench_exports_path(workbench), class: "list-group-item" do
+ span = t('activerecord.models.export.other').capitalize
+ = link_to workgroup_calendars_path(workbench.workgroup), class: 'list-group-item' do
+ span = t('activerecord.models.calendar.other').capitalize
+ = link_to workbench_compliance_check_sets_path(workbench), class: 'list-group-item' do
+ span = t('activerecord.models.compliance_check_set.other').capitalize
+ = link_to compliance_control_sets_path, class: 'list-group-item' do
+ span = t('activerecord.models.compliance_control_set.other').capitalize
+
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miFour', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ = t('layouts.navbar.line_referential')
- #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_time_tables_path(current_referential), class: 'list-group-item' do
- span = t('time_tables.index.title').capitalize
- - if has_feature?(:purchase_windows)
- = link_to referential_purchase_windows_path(current_referential), class: 'list-group-item' do
- span = t('purchase_windows.index.title').capitalize
+ #miFour.panel-collapse.collapse
+ .list-group
+ = link_to line_referential_lines_path(workbench.line_referential), class: "list-group-item" do
+ span = Chouette::Line.t.capitalize
+ = link_to line_referential_networks_path(workbench.line_referential), class: "list-group-item" do
+ span = Chouette::Network.t.capitalize
+ = link_to line_referential_companies_path(workbench.line_referential), class: "list-group-item" do
+ span = Chouette::Company.t.capitalize
- - else
- .panel-body
- em.text-muted
- = t('layouts.navbar.select_referential_for_more_features')
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miFive', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ = t('layouts.navbar.stop_area_referential')
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miFour', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- = t('layouts.navbar.line_referential')
-
- #miFour.panel-collapse.collapse
- .list-group
- = link_to line_referential_lines_path(workbench.line_referential), class: "list-group-item" do
- span = Chouette::Line.t.capitalize
- = link_to line_referential_networks_path(workbench.line_referential), class: "list-group-item" do
- span = Chouette::Network.t.capitalize
- = link_to line_referential_companies_path(workbench.line_referential), class: "list-group-item" do
- span = Chouette::Company.t.capitalize
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miFive', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- = t('layouts.navbar.stop_area_referential')
-
- #miFive.panel-collapse.collapse
- .list-group
- = link_to stop_area_referential_stop_areas_path(workbench.stop_area_referential), class: "list-group-item" do
- span = Chouette::StopArea.t.capitalize
+ #miFive.panel-collapse.collapse
+ .list-group
+ = link_to stop_area_referential_stop_areas_path(workbench.stop_area_referential), class: "list-group-item" do
+ span = Chouette::StopArea.t.capitalize
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
index 589f99ae3..9404eeae6 100644
--- a/app/views/layouts/navigation/_main_nav_left_content_stif.html.slim
+++ b/app/views/layouts/navigation/_main_nav_left_content_stif.html.slim
@@ -1,125 +1,95 @@
-- if current_organisation
- - current_organisation.workbenches.each do |workbench|
- #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
- = t('layouts.navbar.current_offer.other')
-
- #miOne.panel-collapse.collapse
- .list-group
- = link_to root_path, class: "list-group-item" do
- span = t('layouts.navbar.dashboard')
- = link_to workbench_output_path(workbench), class: 'list-group-item' do
- span = t('layouts.navbar.workbench_outputs.organisation')
- = link_to '#', class: 'list-group-item disabled' do
- span = t('layouts.navbar.workbench_outputs.workgroup')
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miTwo', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- - t('activerecord.models.workbench.one').capitalize
-
- #miTwo.panel-collapse.collapse
- .list-group
- = link_to workbench_path(workbench), class: "list-group-item" do
- span = t('activerecord.models.referential.other').capitalize
- = link_to workbench_imports_path(workbench), class: "list-group-item" do
- span = t('activerecord.models.import.other').capitalize
- = link_to workbench_exports_path(workbench), class: "list-group-item" do
- span = t('activerecord.models.export.other').capitalize
- = link_to workgroup_calendars_path(workbench.workgroup), class: 'list-group-item' do
- span = t('activerecord.models.calendar.other').capitalize
- = link_to workbench_compliance_check_sets_path(workbench), class: 'list-group-item' do
- span = t('activerecord.models.compliance_check_set.other').capitalize
- = link_to compliance_control_sets_path, class: 'list-group-item' do
- span = t('activerecord.models.compliance_control_set.other').capitalize
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miThree', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- = Referential.ts.capitalize
-
- #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 = t('layouts.navbar.shapes')
-
- = 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
- = t('layouts.navbar.select_referential_for_more_features')
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miFour', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- = t('layouts.navbar.line_referential')
-
- #miFour.panel-collapse.collapse
- .list-group
- = link_to line_referential_path(workbench.line_referential), class: "list-group-item" do
- span = t('layouts.navbar.sync_ilico')
- = link_to line_referential_lines_path(workbench.line_referential), class: "list-group-item" do
- span = Chouette::Line.t.capitalize
- = link_to line_referential_networks_path(workbench.line_referential), class: "list-group-item" do
- span = Chouette::Network.t.capitalize
- = link_to line_referential_companies_path(workbench.line_referential), class: "list-group-item" do
- span = Chouette::Company.t.capitalize
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miFive', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- = t('layouts.navbar.stop_area_referential')
-
- #miFive.panel-collapse.collapse
- .list-group
- = link_to stop_area_referential_path(workbench.stop_area_referential), class: "list-group-item" do
- span = t('layouts.navbar.sync_icar')
- = link_to stop_area_referential_stop_areas_path(workbench.stop_area_referential), class: "list-group-item" do
- span = Chouette::StopArea.t.capitalize
-
- .menu-item.panel
- .panel-heading
- h4.panel-title
- = link_to '#miSix', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
- = t('layouts.navbar.tools')
-
- #miSix.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
- = t('layouts.navbar.portal')
-
- = link_to Rails.application.config.try(:codifligne_url), target: '_blank', class: 'list-group-item' do
- span
- span.fa.fa-2x.fa-circle
- = t('layouts.navbar.ilico')
-
- = link_to Rails.application.config.try(:reflex_url), target: '_blank', class: 'list-group-item' do
- span
- span.fa.fa-2x.fa-circle
- = t('layouts.navbar.icar')
-
- = link_to '#', target: '_blank', class: 'list-group-item' do
- span
- span.fa.fa-2x.fa-circle
- = t('layouts.navbar.support')
+- current_organisation.workbenches.each do |workbench|
+ #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
+ = t('layouts.navbar.current_offer.other')
+
+ #miOne.panel-collapse.collapse
+ .list-group
+ = link_to root_path, class: "list-group-item" do
+ span = t('layouts.navbar.dashboard')
+ = link_to workbench_output_path(workbench), class: 'list-group-item' do
+ span = t('layouts.navbar.workbench_outputs.organisation')
+ = link_to '#', class: 'list-group-item disabled' do
+ span = t('layouts.navbar.workbench_outputs.workgroup')
+
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miTwo', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ - t('activerecord.models.workbench.one').capitalize
+
+ #miTwo.panel-collapse.collapse
+ .list-group
+ = link_to workbench_path(workbench), class: "list-group-item" do
+ span = t('activerecord.models.referential.other').capitalize
+ = link_to workbench_imports_path(workbench), class: "list-group-item" do
+ span = t('activerecord.models.import.other').capitalize
+ = link_to workbench_exports_path(workbench), class: "list-group-item" do
+ span = t('activerecord.models.export.other').capitalize
+ = link_to workgroup_calendars_path(workbench.workgroup), class: 'list-group-item' do
+ span = t('activerecord.models.calendar.other').capitalize
+ = link_to workbench_compliance_check_sets_path(workbench), class: 'list-group-item' do
+ span = t('activerecord.models.compliance_check_set.other').capitalize
+ = link_to compliance_control_sets_path, class: 'list-group-item' do
+ span = t('activerecord.models.compliance_control_set.other').capitalize
+
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miFour', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ = t('layouts.navbar.line_referential')
+
+ #miFour.panel-collapse.collapse
+ .list-group
+ = link_to line_referential_path(workbench.line_referential), class: "list-group-item" do
+ span = t('layouts.navbar.sync_ilico')
+ = link_to line_referential_lines_path(workbench.line_referential), class: "list-group-item" do
+ span = Chouette::Line.t.capitalize
+ = link_to line_referential_networks_path(workbench.line_referential), class: "list-group-item" do
+ span = Chouette::Network.t.capitalize
+ = link_to line_referential_companies_path(workbench.line_referential), class: "list-group-item" do
+ span = Chouette::Company.t.capitalize
+
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miFive', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ = t('layouts.navbar.stop_area_referential')
+
+ #miFive.panel-collapse.collapse
+ .list-group
+ = link_to stop_area_referential_path(workbench.stop_area_referential), class: "list-group-item" do
+ span = t('layouts.navbar.sync_icar')
+ = link_to stop_area_referential_stop_areas_path(workbench.stop_area_referential), class: "list-group-item" do
+ span = Chouette::StopArea.t.capitalize
+
+ .menu-item.panel
+ .panel-heading
+ h4.panel-title
+ = link_to '#miSix', data: {toggle: 'collapse', parent: '#menu-items'}, 'aria-expanded' => 'false' do
+ = t('layouts.navbar.tools')
+
+ #miSix.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
+ = t('layouts.navbar.portal')
+
+ = link_to Rails.application.config.try(:codifligne_url), target: '_blank', class: 'list-group-item' do
+ span
+ span.fa.fa-2x.fa-circle
+ = t('layouts.navbar.ilico')
+
+ = link_to Rails.application.config.try(:reflex_url), target: '_blank', class: 'list-group-item' do
+ span
+ span.fa.fa-2x.fa-circle
+ = t('layouts.navbar.icar')
+
+ = link_to '#', target: '_blank', class: 'list-group-item' do
+ span
+ span.fa.fa-2x.fa-circle
+ = t('layouts.navbar.support')
diff --git a/config/locales/layouts.en.yml b/config/locales/layouts.en.yml
index 76a4d65d1..31bff403c 100644
--- a/config/locales/layouts.en.yml
+++ b/config/locales/layouts.en.yml
@@ -22,7 +22,7 @@ en:
other: Current offers
workbench_output:
organisation: Organisation offers
- idf: IDF offers
+ workgroup: Workgroup offers
tools: Tools
sync: Synchronization
sync_icar: iCAR synchronization
diff --git a/config/locales/merges.en.yml b/config/locales/merges.en.yml
new file mode 100644
index 000000000..f9e90f1ef
--- /dev/null
+++ b/config/locales/merges.en.yml
@@ -0,0 +1,23 @@
+fr:
+ merges:
+ referential_name: "Merged offer %{date}"
+ index:
+ title: "Merged offers"
+ new:
+ title: "New merged offer"
+ show:
+ title: "Merged offer %{name}"
+ actions:
+ create: Merge data spaces
+ activerecord:
+ models:
+ merge: "Merged offer"
+ attributes:
+ merge:
+ created_at: "Created at"
+ started_at: Started at
+ name: Name
+ ended_at: Ended at
+ status: "Status"
+ creator: "Creator"
+ referentials: "Data spaces"
diff --git a/config/locales/merges.yml b/config/locales/merges.fr.yml
index 345727b74..345727b74 100644
--- a/config/locales/merges.yml
+++ b/config/locales/merges.fr.yml