Update archived experiments navigation (#3053)

This commit is contained in:
aignatov-bio 2021-01-07 14:58:56 +01:00 committed by GitHub
parent 962b3a532e
commit 5aae35d700
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 10 deletions

View file

@ -1,5 +1,5 @@
<% provide(:head_title, t("projects.experiment_archive.head_title", project: h(@project.name)).html_safe) %>
<% provide(:sidebar_title, t("sidebar.experiments.sidebar_title")) %>
<% provide(:sidebar_title, t("sidebar.experiments.sidebar_title_archived")) %>
<% provide(:sidebar_url, project_sidebar_path(@project)) %>
<% provide(:container_class, 'no-second-nav-container') %>
<%= content_for :sidebar do %>

View file

@ -11,11 +11,19 @@
</div>
</div>
<div class="project-name-cell">
<a href="<%= project_url(project) %>">
<h3 class="name" title="<%= project.name %>">
<%= project.name %>
</h3>
</a>
<% if project.archived? %>
<%= link_to experiment_archive_project_url(project) do %>
<h3 class="name" title="<%= project.name %>">
<%= project.name %>
</h3>
<% end %>
<% else %>
<%= link_to project_url(project) do %>
<h3 class="name" title="<%= project.name %>">
<%= project.name %>
</h3>
<% end %>
<% end %>
</div>
<div class="actions actions-cell">
<%= render partial: 'projects/index/project_actions_dropdown.html.erb', locals: { project: project, view: 'cards' } %>

View file

@ -1,9 +1,11 @@
<ul class="sidebar-branch">
<li class="sidebar-leaf">
<% unless archived && !@project.archived? %>
<%= link_to t('sidebar.experiments.back_button'), projects_path, class: 'sidebar-link back-button' %>
<% else %>
<% if @project.archived? %>
<%= link_to t('sidebar.experiments.back_archived_projects'), projects_path(mode: :archived), class: 'sidebar-link back-button' %>
<% elsif 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_sort, archived).each do |experiment| %>

View file

@ -1,7 +1,11 @@
<% records.each do |record| %>
<% if record[:project] %>
<li class="sidebar-leaf">
<%= link_to record[:project].name, project_url(record[:project]), class: 'sidebar-link' %>
<% if record[:project].archived? %>
<%= link_to record[:project].name, experiment_archive_project_url(record[:project]), class: 'sidebar-link' %>
<% else %>
<%= link_to record[:project].name, project_url(record[:project]), class: 'sidebar-link' %>
<% end %>
</li>
<% else %>
<li class="sidebar-leaf">

View file

@ -212,8 +212,10 @@ en:
sidebar_title: "SETTINGS"
experiments:
sidebar_title: "EXPERIMENTS"
sidebar_title_archived: "ARCHIVED EXPERIMENTS"
back_button: "Back to projects"
back_active_experiments: "Back to active experiments"
back_archived_projects: "Back to archived projects"
archived_experiments: "Archived experiments"
my_modules:
sidebar_title: "TASKS"