From a41d8518307b1c0e1613a830616f5541bdd98a62 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Wed, 24 Aug 2016 08:54:02 +0200 Subject: [PATCH 1/3] Fix secondary navigation for experiment level (overview) --- .../shared/_secondary_navigation.html.erb | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/app/views/shared/_secondary_navigation.html.erb b/app/views/shared/_secondary_navigation.html.erb index 7b68c2a2c..5e277ba42 100644 --- a/app/views/shared/_secondary_navigation.html.erb +++ b/app/views/shared/_secondary_navigation.html.erb @@ -99,35 +99,35 @@ <% end %> <% elsif experiment_page? %> - <% if can_view_experiment_samples(@experiment) then %> -
  • "> - "> - - - -
  • - <% end %> - <% if can_view_experiment(@experiment) then %> -
  • "> - "> - - + <% if can_view_experiment_samples(@experiment) then %> +
  • "> + "> + +
  • <% end %> - <% if can_view_reports(@experiment.project) then %> -
  • "> - "> - - - -
  • - <% end %> - <% if can_view_experiment_archive(@experiment) then %> -
  • "> - -
  • - <% end %> + <% if can_view_experiment(@experiment) then %> +
  • "> + "> + + + +
  • + <% end %> + <% if can_view_reports(@experiment.project) then %> +
  • "> + "> + + + +
  • + <% end %> + <% if can_view_experiment_archive(@experiment) then %> +
  • "> + +
  • + <% end %> <% elsif module_page? %> <% if can_view_module_protocols(@my_module) then %> From 0cdb18ffcdc29c8d04299515e7255aa5db07b022 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Wed, 24 Aug 2016 09:05:57 +0200 Subject: [PATCH 2/3] Update experiment links on sidebar between actions --- app/helpers/sidebar_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/sidebar_helper.rb b/app/helpers/sidebar_helper.rb index d1e13ebd2..3b8fd1c11 100644 --- a/app/helpers/sidebar_helper.rb +++ b/app/helpers/sidebar_helper.rb @@ -20,8 +20,14 @@ module SidebarHelper end def experiment_action_to_link_to(experiment) - # TODO - canvas_experiment_path(experiment) + case action_name + when 'samples' + return samples_experiment_path(experiment) + when 'archive' + return module_archive_experiment_url(experiment) + else + return canvas_experiment_path(experiment) + end end def module_action_to_link_to(my_module) From a091571d9cb24c271bc1ae606018a24e231b05c5 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Wed, 24 Aug 2016 09:14:29 +0200 Subject: [PATCH 3/3] Add consistent links for archive for all entities --- app/helpers/sidebar_helper.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/sidebar_helper.rb b/app/helpers/sidebar_helper.rb index 3b8fd1c11..7f2f82b41 100644 --- a/app/helpers/sidebar_helper.rb +++ b/app/helpers/sidebar_helper.rb @@ -10,9 +10,9 @@ module SidebarHelper def project_action_to_link_to(project) case action_name - when "samples" + when 'samples' return samples_project_path(project) - when "archive" + when 'archive', 'module_archive', 'experiment_archive' return experiment_archive_project_url(project) else return project_path(project) @@ -23,7 +23,7 @@ module SidebarHelper case action_name when 'samples' return samples_experiment_path(experiment) - when 'archive' + when 'archive', 'module_archive', 'experiment_archive' return module_archive_experiment_url(experiment) else return canvas_experiment_path(experiment) @@ -32,13 +32,13 @@ module SidebarHelper def module_action_to_link_to(my_module) case action_name - when "results" + when 'results' return results_my_module_url(my_module) - when "activities" + when 'activities' return activities_my_module_url(my_module) - when "samples" + when 'samples' return samples_my_module_url(my_module) - when "archive", "module_archive" + when 'archive', 'module_archive', 'experiment_archive' return archive_my_module_url(my_module) else return protocols_my_module_url(my_module)