scinote-web/app/views/my_modules/_repositories_dropdown.html.erb

42 lines
1.8 KiB
Text
Raw Normal View History

<% Repository.accessible_by_teams(current_team).order(created_at: :asc).each do |repository| %>
<li>
<a class="dropdown-item <%= "active-item" if @repository == repository %> help_tooltips"
data-tooltiplink="<%= I18n.t('tooltips.link.protocol.inventories') %>"
data-tooltipcontent="<%= I18n.t('tooltips.text.protocol.inventories') %>"
href="<%= repository_my_module_url(id: @my_module, repository_id: repository) %>"
title="<%= repository.name %>">
<% if enable_counters %>
<% cache [repository, @my_module] do %>
<%= truncate(repository.name) %>
<span class="assigned-items-counter"><%= "(#{@my_module.repository_rows_count(repository)})" %></span>
<% end %>
<% else %>
<%= truncate(repository.name) %>
<span class="assigned-items-counter"><i class="fas fa-spinner fa-spin"></i></span>
<% end %>
<%= inventory_shared_status_icon(repository, current_team) %>
</a>
</li>
<% end %>
<% Repository.used_on_task_but_unshared(@my_module, current_team).each do |repository| %>
<li>
2019-09-05 20:03:08 +08:00
<a class="muted dropdown-item help_tooltips"
data-tooltipcontent="<%= I18n.t('tooltips.text.protocol.unshared_inventory') + repository.team.name %>"
2019-09-05 20:03:08 +08:00
title="<%= repository.name %>"
2019-09-06 19:47:06 +08:00
href="<%= unshared_inventory_my_module_path(inventory_id: repository.id)%>">
2019-09-05 20:03:08 +08:00
<% if enable_counters %>
<% cache [repository, @my_module] do %>
<%= truncate(repository.name) %>
<span class="assigned-items-counter"><%= "(#{@my_module.repository_rows_count(repository)})" %></span>
<% end %>
<% else %>
<%= truncate(repository.name) %>
<span class="assigned-items-counter"><i class="fas fa-spinner fa-spin"></i></span>
<% end %>
</a>
</li>
<% end %>