mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-12 04:06:53 +08:00
59 lines
2.2 KiB
Text
59 lines
2.2 KiB
Text
<% provide(:head_title, t("repositories.index.head_title")) %>
|
|
|
|
<% if current_team %>
|
|
<%= render partial: "repositories/breadcrumbs.html.erb",
|
|
locals: { teams: @teams, current_team: current_team, type: @type } %>
|
|
|
|
<!-- Nav tabs -->
|
|
<ul class="nav nav-tabs nav-settings" role="tablist" id="repository-tabs">
|
|
<% @repositories.each do |repo| %>
|
|
<li role="presentation">
|
|
<a href="#custom_repo_<%= repo.id %>"
|
|
data-toggle="tab"
|
|
data-repo-table="#repository-table-<%= repo.id %>"
|
|
aria-controls="custom_repo_<%= repo.id %>"
|
|
data-url="<%=team_repository_show_tab_path(current_team, repo)%>"
|
|
title="<%=repo.name%>"><%= truncate(repo.name, length: Constants::NAME_TRUNCATION_LENGTH) %></a>
|
|
</li>
|
|
<% end %>
|
|
|
|
<!-- Add new repository tab -->
|
|
<li role="presentation"
|
|
<% unless can_create_repositories?(current_team) || current_team.repositories.count < Constants::REPOSITORIES_LIMIT %>
|
|
class="disabled"
|
|
<% end %>>
|
|
<a
|
|
<% if can_create_repositories?(current_team) && current_team.repositories.count < Constants::REPOSITORIES_LIMIT %>
|
|
href="<%= create_modal_team_repositories_path %>"
|
|
class='create-repository'
|
|
data-remote='true'
|
|
<% end %>>
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
<span class="hidden-xs"> <%= t('repositories.index.add_new_repository_tab') %></span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<!-- Tab panes -->
|
|
<div class="tab-content">
|
|
<% @repositories.each do |repo| %>
|
|
<div class="tab-pane tab-pane-settings" id="custom_repo_<%= repo.id %>">
|
|
<!-- Tab Content -->
|
|
<div class="container-fluid">
|
|
<div class="tab-content-body"></div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% else %>
|
|
<!-- If member of no teams -->
|
|
<div class="jumbotron">
|
|
<h2><%=t 'repositories.index.no_teams.title' %></h2>
|
|
<p><%=t 'repositories.index.no_teams.text' %></p>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= stylesheet_link_tag 'datatables' %>
|
|
<%= javascript_include_tag 'repositories/repository_datatable' %>
|
|
<%= javascript_include_tag "repositories/index", "data-turbolinks-track" => true %>
|