From 8f0a3fb61c3526c0f789fc47c55f9d86c87d973a Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Wed, 30 Dec 2020 22:49:02 +0100 Subject: [PATCH] Fix links in sidebar navigation [SCI-5327] --- app/helpers/sidebar_helper.rb | 31 ------------------- .../sidebar/_archived_my_modules.html.erb | 2 +- .../shared/sidebar/_experiments.html.erb | 2 +- app/views/shared/sidebar/_my_modules.html.erb | 2 +- 4 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 app/helpers/sidebar_helper.rb diff --git a/app/helpers/sidebar_helper.rb b/app/helpers/sidebar_helper.rb deleted file mode 100644 index f89d9deba..000000000 --- a/app/helpers/sidebar_helper.rb +++ /dev/null @@ -1,31 +0,0 @@ -module SidebarHelper - def project_action_to_link_to(project) - case action_name - when 'archive', 'module_archive', 'experiment_archive' - return experiment_archive_project_url(project) - else - return project_path(project) - end - end - - def experiment_action_to_link_to(experiment) - case action_name - when 'archive', 'module_archive', 'experiment_archive' - return module_archive_experiment_url(experiment) - else - return canvas_experiment_path(experiment) - end - end - - def module_action_to_link_to(my_module) - if action_name == 'results' - results_my_module_url(my_module) - elsif action_name == 'activities' - activities_my_module_url(my_module) - elsif action_name.in?(%w(archive module_archive experiment_archive)) - archive_my_module_url(my_module) - else - protocols_my_module_url(my_module) - end - end -end diff --git a/app/views/shared/sidebar/_archived_my_modules.html.erb b/app/views/shared/sidebar/_archived_my_modules.html.erb index 3a4e035bc..d0c98307a 100644 --- a/app/views/shared/sidebar/_archived_my_modules.html.erb +++ b/app/views/shared/sidebar/_archived_my_modules.html.erb @@ -11,7 +11,7 @@ <% my_modules.each do |my_module| %> diff --git a/app/views/shared/sidebar/_experiments.html.erb b/app/views/shared/sidebar/_experiments.html.erb index deff28ea5..97872ba99 100644 --- a/app/views/shared/sidebar/_experiments.html.erb +++ b/app/views/shared/sidebar/_experiments.html.erb @@ -8,7 +8,7 @@ <% project.sorted_experiments(@current_sort, archived).each do |experiment| %> <% end %> <% unless archived %> diff --git a/app/views/shared/sidebar/_my_modules.html.erb b/app/views/shared/sidebar/_my_modules.html.erb index 769f758ef..33cddd135 100644 --- a/app/views/shared/sidebar/_my_modules.html.erb +++ b/app/views/shared/sidebar/_my_modules.html.erb @@ -5,7 +5,7 @@ <% my_modules.each do |my_module| %>