scinote-web/app/views/repositories/_sidebar.html.erb

47 lines
1.7 KiB
Text
Raw Normal View History

<%= content_for :sidebar do %>
<div id="slide-panel" class="visible">
<div id="repo-tree" class="tree">
<ul>
<% if can_create_repositories?(current_team) %>
<li>
<span class="tree-link link-wrap no-indent">
<a class="sidebar-button create-new-repository" data-remote="true"
href="<%= create_modal_team_repositories_path(current_team) %>">
<span class="fas fa-plus"></span>
<%= t('libraries.index.no_libraries.create_new_button') %>
</a>
</span>
</li>
<% end %>
<% repositories.each do |repository| %>
<li class="<%= 'active parent_li' if current_page?(repository_path(repository)) %>" >
<span class="tree-link line-wrap no-indent">
<% if current_page?(repository_path(repository)) %>
<span title="<%= repository.name %>"><%= repository.name %></span>
<% else %>
<%= link_to repository.name,
repository_path(repository),
data: { 'no-turbolink' => 'true' } %>
<% end %>
<% if repository.shared_with?(current_team) %>
<% if repository.shared_with_write?(current_team) %>
<%= draw_custom_icon('shared-edit') %>
2019-07-29 22:39:23 +08:00
<% else %>
<%= draw_custom_icon('shared-read') %>
<% end %>
2019-08-19 21:43:55 +08:00
<% elsif repository.i_shared?(current_team) %>
<%= draw_custom_icon('i-shared') %>
<% end %>
2018-04-12 23:12:45 +08:00
</span>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>
<script>
2018-07-19 23:56:42 +08:00
$('#wrapper').show();
</script>