mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
More fixes on secondary navigation
This commit is contained in:
parent
bed8687dbd
commit
8a2b54819a
4 changed files with 40 additions and 7 deletions
|
@ -29,7 +29,7 @@ module SamplesHelper
|
|||
def form_submit_link
|
||||
if module_page?
|
||||
assign_samples_my_module_path(@my_module)
|
||||
elsif is_project_page?
|
||||
elsif project_page?
|
||||
delete_samples_project_path(@project)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,8 +4,8 @@ module SecondaryNavigationHelper
|
|||
action_name == "show"
|
||||
end
|
||||
|
||||
def is_project_canvas?
|
||||
action_name == "canvas"
|
||||
def is_project_show?
|
||||
action_name == "show"
|
||||
end
|
||||
|
||||
def is_project_samples?
|
||||
|
@ -17,6 +17,14 @@ module SecondaryNavigationHelper
|
|||
end
|
||||
|
||||
def is_project_archive?
|
||||
action_name == "experiment_archive"
|
||||
end
|
||||
|
||||
def is_experiment_canvas?
|
||||
action_name == "canvas"
|
||||
end
|
||||
|
||||
def is_experiment_archive?
|
||||
action_name == "module_archive"
|
||||
end
|
||||
|
||||
|
|
|
@ -70,9 +70,9 @@
|
|||
<ul class="nav navbar-nav navbar-right" style="vertical-align: bottom">
|
||||
<% if project_page? %>
|
||||
<% if can_view_project(@project) then %>
|
||||
<li id="canvas-nav-tab" class="<%= "active" if is_project_canvas? %>">
|
||||
<a href="<%= project_url(@project) %>" title="<%=t "nav2.projects.canvas" %>">
|
||||
<span class="hidden-sm hidden-md"><%=t "nav2.projects.canvas" %></span>
|
||||
<li id="canvas-nav-tab" class="<%= "active" if is_project_show? %>">
|
||||
<a href="<%= project_url(@project) %>" title="<%=t "nav2.projects.show" %>">
|
||||
<span class="hidden-sm hidden-md"><%=t "nav2.projects.show" %></span>
|
||||
<span class="hidden-xs hidden-lg glyphicon glyphicon-blackboard"></span>
|
||||
</a>
|
||||
</li>
|
||||
|
@ -99,6 +99,29 @@
|
|||
</li>
|
||||
<% end %>
|
||||
|
||||
<% elsif experiment_page? %>
|
||||
<% if can_view_experiment(@experiment) then %>
|
||||
<li id="canvas-nav-tab" class="<%= "active" if is_experiment_canvas? %>">
|
||||
<a href="<%= project_url(@project) %>" title="<%=t "nav2.experiments.canvas" %>">
|
||||
<span class="hidden-sm hidden-md"><%=t "nav2.experiments.canvas" %></span>
|
||||
<span class="hidden-xs hidden-lg glyphicon glyphicon-blackboard"></span>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can_view_reports(@experiment.project) then %>
|
||||
<li id="reports-nav-tab" class="<%= "active" if is_project_reports? %>">
|
||||
<a href="<%= project_reports_url(@experiment.project) %>" title="<%=t "nav2.projects.reports" %>">
|
||||
<span class="hidden-sm hidden-md"><%=t "nav2.projects.reports" %></span>
|
||||
<span class="hidden-xs hidden-lg glyphicon glyphicon-list-alt"></span>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can_view_experiment_archive(@experiment) then %>
|
||||
<li id="project-archive-nav-tab" class="<%= "active" if is_experiment_archive? %>">
|
||||
<a href="<%= module_archive_experiment_url(@experiment) %>"><span class="glyphicon glyphicon-briefcase"></span></a>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% elsif module_page? %>
|
||||
<% if can_view_module_protocols(@my_module) then %>
|
||||
<li id="steps-nav-tab" class="<%= "active" if is_module_protocols? %>">
|
||||
|
|
|
@ -80,10 +80,12 @@ en:
|
|||
|
||||
nav2:
|
||||
projects:
|
||||
canvas: "Overview"
|
||||
show: "Overview"
|
||||
samples: "Samples"
|
||||
activities: "Activity"
|
||||
reports: "Reports"
|
||||
experiments:
|
||||
canvas: "Overview"
|
||||
modules:
|
||||
steps: "Protocols"
|
||||
results: "Results"
|
||||
|
|
Loading…
Reference in a new issue