scinote-web/app/views/global_activities/references/_protocol.html.erb

30 lines
1.2 KiB
Plaintext
Raw Normal View History

<% if subject.in_repository? %>
<%= render partial: "global_activities/references/team.html.erb",
locals: { subject: subject&.team, breadcrumbs: breadcrumbs } %>
<% else %>
<%= render partial: "global_activities/references/my_module.html.erb",
locals: { subject: subject&.my_module, breadcrumbs: breadcrumbs } %>
<% end %>
2019-03-25 16:39:17 +08:00
<div class="ga-breadcrumb">
<span class="fas fa-edit"></span>
<% if subject %>
<% if subject.in_repository? %>
<%= route_to_other_team protocols_path(team: subject.team),
subject.team,
subject.name&.truncate(Constants::NAME_TRUNCATION_LENGTH),
title: subject.name %>
<% elsif subject.my_module.navigable? %>
<%= link_to subject.name&.truncate(Constants::NAME_TRUNCATION_LENGTH),
protocols_my_module_path(subject.my_module), title: subject.name %>
<% else %>
<span title="<%= subject.name %>">
<%= subject.name&.truncate(Constants::NAME_TRUNCATION_LENGTH) %>
</span>
<% end %>
<% else %>
<span title="<%= breadcrumbs[:protocol] %>">
2019-03-19 21:12:39 +08:00
<%= breadcrumbs[:protocol]&.truncate(Constants::NAME_TRUNCATION_LENGTH) %>
</span>
<% end %>
</div>