scinote-web/app/views/shared/sidebar/_experiments.html.erb
ajugo 67dcbb0fa6
Open the correct experiment view [SCI-7662][SCI-7741] (#4798)
* Fix experiment view loading [SCI-7662]

* Fix experiment view loading [SCI-7662]
2023-01-12 11:31:04 +01:00

28 lines
1.3 KiB
Text

<ul class="sidebar-branch">
<li class="sidebar-leaf">
<% if @project.archived? %>
<%= link_to t('sidebar.experiments.back_archived_projects'), projects_path(view_mode: :archived), class: 'sidebar-link back-button' %>
<% elsif view_mode == 'archived' %>
<%= link_to t('sidebar.experiments.back_active_experiments'), project_url(@project), class: 'sidebar-link back-button' %>
<% else %>
<%= link_to t('sidebar.experiments.back_button'), projects_path, class: 'sidebar-link back-button' %>
<% end %>
</li>
<% project.sorted_experiments(current_user, @current_sort, view_mode == 'archived').each do |experiment| %>
<li class="sidebar-leaf">
<% if view_mode == 'archived' %>
<%= link_to experiment.name, my_modules_experiment_path(experiment, view_mode: :archived), title: experiment.name, class: 'sidebar-link' %>
<% else %>
<%= link_to experiment.name, my_modules_experiment_path(experiment), title: experiment.name, class: 'sidebar-link' %>
<% end %>
</li>
<% end %>
<% if view_mode == 'active' %>
<li class="sidebar-leaf">
<%= link_to project_path(@project, view_mode: 'archived'), class: 'sidebar-link' do %>
<i class="fas fa-archive"></i>
<%= t('sidebar.experiments.archived_experiments') %>
<% end %>
</li>
<% end %>
</ul>