Add view dropdown to experiment screen

This commit is contained in:
Anton 2022-11-08 16:39:52 +01:00
parent 46ebeeb558
commit a17cd78c20
3 changed files with 41 additions and 6 deletions

View file

@ -90,6 +90,21 @@
&:hover {
background: $color-concrete;
}
a {
display: inline-block;
margin: -1em;
padding: 1em;
width: calc(100% + 2em);
&.selected::after {
@include font-awesome;
content: $font-fas-check;
margin-left: auto;
position: absolute;
right: 1em;
}
}
}
}

View file

@ -20,12 +20,28 @@
<% end %>
</h1>
<div class="header-actions experiment-header">
<span class="dropdown actions-button">
<button class="btn btn-light dropdown-toggle" type="button" id="exViewMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span><%= t('experiments.canvas.view') %></span>
<span class="caret"></span>
</button>
</span>
<%= render layout: 'shared/view_switch', locals: { disabled: false } do %>
<li>
<%= link_to canvas_experiment_path(@experiment), class: ('selected' if action_name == 'canvas') do %>
<i class="fas fa-dice-four button-icon"></i>
<%= t('experiments.table.view.canvas') %>
<% end %>
</li>
<li>
<%= link_to table_experiment_path(@experiment), class: ('selected' if action_name == 'table') do %>
<i class="fas fa-list button-icon"></i>
<%= t('experiments.table.view.table') %>
<% end %>
</li>
<div role="separator" class="divider"></div>
<li>
<%= link_to module_archive_experiment_path(@experiment) do %>
<i class="fas fa-archive button-icon"></i>
<%= t('experiments.table.view.archived_tasks') %>
<% end %>
</li>
<% end %>
<% if can_manage_experiment?(@experiment) || can_clone_experiment?(@experiment) %>
<!-- experiment actions -->
<span class="dropdown actions-button">

View file

@ -1312,6 +1312,10 @@ en:
duplicate: 'Duplicate'
manage_access: 'Manage access'
task_data: 'Task data display'
view:
canvas: 'Canvas'
table: 'Table'
archived_tasks: 'Go to Archived tasks'
add_tag: '+ Add tag'
canvas:
archive_confirm: "Are you sure to archive this experiment?"