Merge pull request #91 from jbargu/jg_exp_navigation_sci_352

Fix experiment navigation (sidebar and secondary navigation)

SCI-352 #close
This commit is contained in:
jbargu 2016-08-24 11:50:04 +02:00 committed by GitHub
commit 3997ad7114
2 changed files with 40 additions and 34 deletions

View file

@ -10,9 +10,9 @@ module SidebarHelper
def project_action_to_link_to(project) def project_action_to_link_to(project)
case action_name case action_name
when "samples" when 'samples'
return samples_project_path(project) return samples_project_path(project)
when "archive" when 'archive', 'module_archive', 'experiment_archive'
return experiment_archive_project_url(project) return experiment_archive_project_url(project)
else else
return project_path(project) return project_path(project)
@ -20,19 +20,25 @@ module SidebarHelper
end end
def experiment_action_to_link_to(experiment) def experiment_action_to_link_to(experiment)
# TODO case action_name
canvas_experiment_path(experiment) when 'samples'
return samples_experiment_path(experiment)
when 'archive', 'module_archive', 'experiment_archive'
return module_archive_experiment_url(experiment)
else
return canvas_experiment_path(experiment)
end
end end
def module_action_to_link_to(my_module) def module_action_to_link_to(my_module)
case action_name case action_name
when "results" when 'results'
return results_my_module_url(my_module) return results_my_module_url(my_module)
when "activities" when 'activities'
return activities_my_module_url(my_module) return activities_my_module_url(my_module)
when "samples" when 'samples'
return samples_my_module_url(my_module) return samples_my_module_url(my_module)
when "archive", "module_archive" when 'archive', 'module_archive', 'experiment_archive'
return archive_my_module_url(my_module) return archive_my_module_url(my_module)
else else
return protocols_my_module_url(my_module) return protocols_my_module_url(my_module)

View file

@ -109,7 +109,7 @@
<% end %> <% end %>
<% if can_view_experiment(@experiment) then %> <% if can_view_experiment(@experiment) then %>
<li id="canvas-nav-tab" class="<%= "active" if is_experiment_canvas? %>"> <li id="canvas-nav-tab" class="<%= "active" if is_experiment_canvas? %>">
<a href="<%= project_url(@project) %>" title="<%=t "nav2.experiments.canvas" %>"> <a href="<%= canvas_experiment_url(@experiment) %>" title="<%=t "nav2.experiments.canvas" %>">
<span class="hidden-sm hidden-md"><%=t "nav2.experiments.canvas" %></span> <span class="hidden-sm hidden-md"><%=t "nav2.experiments.canvas" %></span>
<span class="hidden-xs hidden-lg glyphicon glyphicon-blackboard"></span> <span class="hidden-xs hidden-lg glyphicon glyphicon-blackboard"></span>
</a> </a>