mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 02:04:33 +08:00
Merge pull request #46 from ZmagoD/zd_SCI_303
update sidebar v2 [fixes SCI-303]
This commit is contained in:
commit
4bd489d29c
5 changed files with 63 additions and 47 deletions
|
@ -133,6 +133,14 @@ $toggle-btn-size: 50px;
|
|||
}
|
||||
}
|
||||
|
||||
.my-module-group-element::before {
|
||||
border-left: 1px dotted $color-emperor;
|
||||
bottom: 20px;
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
@include sidebar-shown;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
}
|
||||
|
||||
&.leaf {
|
||||
padding-left: 30px;
|
||||
padding-left: 10px;
|
||||
.tree-link::before {
|
||||
content: "\25B8";
|
||||
}
|
||||
|
|
|
@ -13,19 +13,23 @@
|
|||
</div>
|
||||
|
||||
<div class="tree">
|
||||
<% if !project_page? %>
|
||||
<ul>
|
||||
<li class="<%= "active" if project_page? %>">
|
||||
<li class="active">
|
||||
<span class="tree-link line-wrap">
|
||||
<i></i>
|
||||
<% if !project_page? %>
|
||||
<%= link_to @project.name, project_action_to_link_to(@project), title: @project.name %>
|
||||
<% else %>
|
||||
<span title="<%= @project.name %>"><%= @project.name %></span>
|
||||
<% end %>
|
||||
<%= link_to @project.name,
|
||||
project_action_to_link_to(@project),
|
||||
title: @project.name %>
|
||||
</span>
|
||||
<%= render partial: 'shared/sidebar/experiments', locals: { project: @project } %>
|
||||
<%= render partial: 'shared/sidebar/experiments',
|
||||
locals: { project: @project } %>
|
||||
</li>
|
||||
</ul>
|
||||
<% else %>
|
||||
<%= render partial: 'shared/sidebar/experiments',
|
||||
locals: { project: @project } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -1,17 +1,31 @@
|
|||
<ul>
|
||||
<% if project.active_experiments.present? then %>
|
||||
<% project.active_experiments.each do |experiment| %>
|
||||
<li class="<%= "active" if experiment_page? %>">
|
||||
<% if experiment_page? %>
|
||||
<li>
|
||||
<span class="tree-link line-wrap">
|
||||
<i></i>
|
||||
<% if !experiment_page? %>
|
||||
<%= link_to experiment.name, experiment_action_to_link_to(experiment), title: experiment.name %>
|
||||
<% else %>
|
||||
<span title="<%= experiment.name %>"><%= experiment.name %></span>
|
||||
<% end %>
|
||||
<span title="<%= @experiment.name %>"><%= @experiment.name %></span>
|
||||
</span>
|
||||
<%= render partial: 'shared/sidebar/my_modules', locals: { experiment: experiment } %>
|
||||
<%= render partial: 'shared/sidebar/my_modules', locals: { experiment: @experiment } %>
|
||||
</li>
|
||||
<% else %>
|
||||
<% project.active_experiments.each do |experiment| %>
|
||||
<li>
|
||||
<span class="tree-link line-wrap">
|
||||
<i></i>
|
||||
<% if can_view_experiment(experiment) %>
|
||||
<%= link_to experiment.name,
|
||||
experiment_action_to_link_to(experiment),
|
||||
title: experiment.name,
|
||||
class: 'overview_exp_label'
|
||||
%>
|
||||
<% else %>
|
||||
<%= experiment.name %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= render partial: 'shared/sidebar/my_modules', locals: { experiment: experiment } %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -2,35 +2,28 @@
|
|||
<ul>
|
||||
<% experiment.active_module_groups.each do |my_module_group| %>
|
||||
<li data-module-group="<%= my_module_group.id %>">
|
||||
<span>
|
||||
<i></i>
|
||||
<span class="line-wrap short" title="<%= my_module_group.name %>">
|
||||
<%= my_module_group.name %>
|
||||
</span>
|
||||
<% if is_canvas? %>
|
||||
<a href="" class="canvas-center-on"><span class="glyphicon glyphicon-map-marker"></span></a>
|
||||
<% end %>
|
||||
</span>
|
||||
<% if my_module_group.my_modules.present? then %>
|
||||
<ul>
|
||||
<% my_module_group.my_modules.sort_by{|m| m.workflow_order}.each do |my_module| %>
|
||||
<li class="leaf <%= "active" if currently_active? my_module %>" data-module-id="<%= my_module.id %>">
|
||||
<span class="tree-link">
|
||||
<% if currently_active? my_module %>
|
||||
<%= my_module.name %>
|
||||
<% else %>
|
||||
<% if can_view_module(my_module) then %>
|
||||
<%= link_to my_module.name, module_action_to_link_to(my_module), class: "module-link" %>
|
||||
<% else %>
|
||||
<span class="my-module-group-element">
|
||||
<% my_module_group.my_modules.sort_by{|m| m.workflow_order}.each do |my_module| %>
|
||||
<li class="leaf <%= "active" if currently_active? my_module %>" data-module-id="<%= my_module.id %>">
|
||||
<span class="tree-link">
|
||||
<% if currently_active? my_module %>
|
||||
<%= my_module.name %>
|
||||
<% else %>
|
||||
<% if can_view_module(my_module) then %>
|
||||
<%= link_to my_module.name, module_action_to_link_to(my_module), class: "module-link" %>
|
||||
<% else %>
|
||||
<%= my_module.name %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if is_canvas? %>
|
||||
<a href="#" class="canvas-center-on"><span class="glyphicon glyphicon-map-marker"></span></a>
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if is_canvas? %>
|
||||
<a href="#" class="canvas-center-on"><span class="glyphicon glyphicon-map-marker"></span></a>
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</span>
|
||||
</ul>
|
||||
<% end %>
|
||||
</li>
|
||||
|
@ -38,13 +31,10 @@
|
|||
<% modules_without_group = experiment.modules_without_group %>
|
||||
<% if modules_without_group.present? then %>
|
||||
<li>
|
||||
<span>
|
||||
<i></i>
|
||||
<span class='sidebar-no-module-group'><%= t("sidebar.no_module_group") %></span>
|
||||
</span>
|
||||
<ul>
|
||||
<% modules_without_group.each do |my_module| %>
|
||||
<li class="leaf <%= "active" if currently_active? my_module %>" data-module-id="<%= my_module.id %>">
|
||||
<li class="leaf <%= "active" if currently_active? my_module %>"
|
||||
data-module-id="<%= my_module.id %>">
|
||||
<span class="tree-link">
|
||||
<% if currently_active? my_module %>
|
||||
<%= my_module.name %>
|
||||
|
@ -61,4 +51,4 @@
|
|||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in a new issue