From c08d72be3625f4b57ea3a40d8128acaa623f967d Mon Sep 17 00:00:00 2001 From: mlorb Date: Tue, 17 Apr 2018 17:00:04 +0200 Subject: [PATCH 1/2] remove breadcrumbs throughout application --- app/assets/javascripts/sidebar_toggle.js.erb | 4 +- app/assets/stylesheets/themes/scinote.scss | 22 +-- app/views/protocols/_breadcrumbs.html.erb | 14 -- app/views/protocols/edit.html.erb | 4 - app/views/protocols/index.html.erb | 1 - app/views/repositories/_breadcrumbs.html.erb | 4 - .../shared/_secondary_navigation.html.erb | 132 ++---------------- config/locales/en.yml | 7 - 8 files changed, 30 insertions(+), 158 deletions(-) delete mode 100644 app/views/protocols/_breadcrumbs.html.erb delete mode 100644 app/views/repositories/_breadcrumbs.html.erb diff --git a/app/assets/javascripts/sidebar_toggle.js.erb b/app/assets/javascripts/sidebar_toggle.js.erb index 6084d4c3d..877d4bf93 100644 --- a/app/assets/javascripts/sidebar_toggle.js.erb +++ b/app/assets/javascripts/sidebar_toggle.js.erb @@ -10,7 +10,7 @@ ); $('#wrapper').css('paddingLeft', '280px'); $('.navbar-secondary').css( - { 'margin-left': '-280px', 'padding-left': '280px' } + { 'margin-left': '-280px', 'padding-left': '295px' } ); } @@ -23,7 +23,7 @@ $('#wrapper').css('paddingLeft', '0'); $('.navbar-secondary').css({ 'margin-left': '0', - 'padding-left': '0' + 'padding-left': '15px' }); } diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss index 7e9b05d18..420b06704 100644 --- a/app/assets/stylesheets/themes/scinote.scss +++ b/app/assets/stylesheets/themes/scinote.scss @@ -222,7 +222,7 @@ a[data-toggle="tooltip"] { #secondary-navigation { white-space: nowrap; - overflow: hidden + overflow: hidden; } .panel-body { @@ -253,6 +253,19 @@ a[data-toggle="tooltip"] { border-right: 0; border-bottom: 4px solid $color-silver; padding-right: 0; + padding-left: 0; + } + + .navbar-toggle { + margin-right: 100px; + } + + #secondary-menu { + padding-left: 0; + } + + .nav-name { + padding: 15px 0; } ul.nav { @@ -409,13 +422,6 @@ a[data-toggle="tooltip"] { } /** Protocols management */ -.breadcrumb-protocols-manager { - overflow: visible; - margin-top: 15px; - margin-bottom: 15px; - background-color: $color-white; -} - .tab-pane-protocols { & > div.protocols-description { margin-bottom: 15px; diff --git a/app/views/protocols/_breadcrumbs.html.erb b/app/views/protocols/_breadcrumbs.html.erb deleted file mode 100644 index b73725550..000000000 --- a/app/views/protocols/_breadcrumbs.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/app/views/protocols/edit.html.erb b/app/views/protocols/edit.html.erb index e92d86ca7..9b45dce38 100644 --- a/app/views/protocols/edit.html.erb +++ b/app/views/protocols/edit.html.erb @@ -1,10 +1,6 @@ <% provide(:head_title, t("protocols.edit.head_title")) %> <%= render partial: 'shared/drag_n_drop_overlay' %> -<%= render partial: "protocols/breadcrumbs.html.erb", - locals: { teams: @teams, - current_team: @protocol.team, - type: @type } %> <%= render partial: "protocols/header.html.erb" %> diff --git a/app/views/protocols/index.html.erb b/app/views/protocols/index.html.erb index 35aa4be91..a70117ff7 100644 --- a/app/views/protocols/index.html.erb +++ b/app/views/protocols/index.html.erb @@ -2,7 +2,6 @@ <% provide(:head_title, t("protocols.index.head_title")) %> <% if current_team %> - <%= render partial: "protocols/breadcrumbs.html.erb", locals: { teams: @teams, current_team: @current_team, type: @type } %> - - + + <% if project_page? %> + <% title_element = @project %> + <% elsif experiment_page? %> + <% title_element = @experiment %> + <% elsif module_page? %> + <% title_element = @my_module %> + <% end %> + + + diff --git a/config/locales/en.yml b/config/locales/en.yml index efb2a7dde..2a61368bc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -917,9 +917,6 @@ en: name_placeholder: "My inventory" submit: "Create inventory" success_flash: "Inventory %{name} successfully created." - nav: - breadcrumbs: - repositories: "Inventories" table: id: 'ID' assigned: "Assigned" @@ -1449,10 +1446,6 @@ en: leave_flash: "Successfuly left team %{team}." protocols: - nav: - breadcrumbs: - manager: "Protocol management" - edit: "Edit protocol" protocols_io_import: title_too_long: "... Text is too long so we had to cut it off." too_long: "... Text is too long so we had to cut it off." From c149b3cc2ae82e2c8ddafc922e51b4b0a73d8053 Mon Sep 17 00:00:00 2001 From: mlorb Date: Thu, 19 Apr 2018 15:12:26 +0200 Subject: [PATCH 2/2] refactoring --- app/helpers/secondary_navigation_helper.rb | 10 ++++++++++ app/views/shared/_secondary_navigation.html.erb | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/helpers/secondary_navigation_helper.rb b/app/helpers/secondary_navigation_helper.rb index e867d3c4a..de5477453 100644 --- a/app/helpers/secondary_navigation_helper.rb +++ b/app/helpers/secondary_navigation_helper.rb @@ -55,4 +55,14 @@ module SecondaryNavigationHelper def is_module_archive? action_name == 'archive' end + + def title_element + if project_page? + @project + elsif experiment_page? + @experiment + elsif module_page? + @my_module + end + end end diff --git a/app/views/shared/_secondary_navigation.html.erb b/app/views/shared/_secondary_navigation.html.erb index dc7c4527c..912521baa 100644 --- a/app/views/shared/_secondary_navigation.html.erb +++ b/app/views/shared/_secondary_navigation.html.erb @@ -161,14 +161,6 @@ - <% if project_page? %> - <% title_element = @project %> - <% elsif experiment_page? %> - <% title_element = @experiment %> - <% elsif module_page? %> - <% title_element = @my_module %> - <% end %> -