Update archive navigation for tasks page [SCI-5347] (#3052)

* Update archive navigation for tasks page [SCI-5347]
This commit is contained in:
aignatov-bio 2021-01-07 17:18:52 +01:00 committed by GitHub
parent 0d7da90b15
commit 276d6abe19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 7 deletions

View file

@ -57,6 +57,7 @@ class ExperimentsController < ApplicationController
end
def canvas
redirect_to module_archive_experiment_path(@experiment) if @experiment.archived_branch?
@project = @experiment.project
@active_modules = @experiment.my_modules.active.includes(:tags, :inputs, :outputs)
current_team_switch(@project.team)

View file

@ -1,5 +1,5 @@
<% provide(:head_title, t("experiments.module_archive.head_title", experiment: h(@experiment.name)).html_safe) %>
<% provide(:sidebar_title, t("sidebar.my_modules.sidebar_title")) %>
<% provide(:sidebar_title, t("sidebar.my_modules.sidebar_title_archived")) %>
<% provide(:sidebar_url, experiment_sidebar_path(@experiment)) %>
<%= content_for :sidebar do %>

View file

@ -26,7 +26,13 @@
<% end %>
<% end %>
<% end %>
<div class="panel-title"><%= link_to experiment.name, canvas_experiment_path(experiment) %></div>
<div class="panel-title">
<% if experiment.archived_branch? %>
<%= link_to experiment.name, module_archive_experiment_path(experiment) %>
<% else %>
<%= link_to experiment.name, canvas_experiment_path(experiment) %>
<% end %>
</div>
<% if experiment.archived? %>
<div class="panel-date">

View file

@ -10,7 +10,11 @@
</li>
<% project.sorted_experiments(@current_sort, archived).each do |experiment| %>
<li class="sidebar-leaf">
<%= link_to experiment.name, canvas_experiment_path(experiment), class: 'sidebar-link' %>
<% if archived %>
<%= link_to experiment.name, module_archive_experiment_path(experiment), class: 'sidebar-link' %>
<% else %>
<%= link_to experiment.name, canvas_experiment_path(experiment), class: 'sidebar-link' %>
<% end %>
</li>
<% end %>
<% unless archived %>

View file

@ -14,7 +14,9 @@
</li>
<% end %>
<li class="sidebar-leaf">
<i class="fas fa-archive"></i>&nbsp;
<%= link_to t('sidebar.my_modules.archived_button'), module_archive_experiment_url(experiment), class: 'sidebar-link' %>
<%= link_to module_archive_experiment_url(experiment), class: 'sidebar-link' do %>
<i class="fas fa-archive"></i>&nbsp;
<%= t('sidebar.my_modules.archived_button') %>
<% end%>
</li>
</ul>

View file

@ -219,6 +219,7 @@ en:
archived_experiments: "Archived experiments"
my_modules:
sidebar_title: "TASKS"
sidebar_title_archived: "ARCHIVED TASKS"
back_button: "Back to experiments"
back_to_archived_button: "Back to archived experiments"
archived_button: "Archived tasks"
@ -227,7 +228,7 @@ en:
sidebar_title: "TASK"
back_button: "Back to all tasks"
back_button_archived: "Back to all archived tasks"
steps: "Protocols"
steps: "Protocol"
results: "Results"
activities: "Activity"
archive: "Archived results"
@ -245,7 +246,7 @@ en:
reports: "Reports"
archive: "Archived experiments"
modules:
steps: "Protocols"
steps: "Protocol"
results: "Results"
activities: "Activity"
archive: "Archived results"