mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 01:44:34 +08:00
Merge pull request #3041 from okriuchykhin/ok_SCI_5327
Fix links in sidebar navigation [SCI-5327]
This commit is contained in:
commit
4638e74e1e
4 changed files with 3 additions and 34 deletions
|
@ -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
|
|
@ -11,7 +11,7 @@
|
|||
<% my_modules.each do |my_module| %>
|
||||
<li class="sidebar-leaf">
|
||||
<%= link_to my_module.name,
|
||||
module_action_to_link_to(my_module),
|
||||
protocols_my_module_url(my_module),
|
||||
class: 'sidebar-link',
|
||||
data: { module_id: my_module.id } %>
|
||||
</li>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</li>
|
||||
<% project.sorted_experiments(@current_sort, archived).each do |experiment| %>
|
||||
<li class="sidebar-leaf">
|
||||
<%= link_to experiment.name, experiment_action_to_link_to(experiment), class: 'sidebar-link' %>
|
||||
<%= link_to experiment.name, canvas_experiment_path(experiment), class: 'sidebar-link' %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% unless archived %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<% my_modules.each do |my_module| %>
|
||||
<li class="sidebar-leaf">
|
||||
<%= link_to my_module.name,
|
||||
module_action_to_link_to(my_module),
|
||||
protocols_my_module_url(my_module),
|
||||
class: 'sidebar-link',
|
||||
data: { module_id: my_module.id } %>
|
||||
<% if action_name == 'canvas' %>
|
||||
|
|
Loading…
Reference in a new issue