2017-05-22 23:54:30 +08:00
|
|
|
<% provide(:head_title, t("repositories.index.head_title")) %>
|
|
|
|
|
|
|
|
<% if current_team %>
|
2017-06-01 02:28:23 +08:00
|
|
|
<%= render partial: "repositories/breadcrumbs.html.erb",
|
|
|
|
locals: { teams: @teams, current_team: current_team, type: @type } %>
|
2017-05-22 23:54:30 +08:00
|
|
|
|
|
|
|
<!-- Nav tabs -->
|
2017-06-08 17:44:24 +08:00
|
|
|
<ul class="nav nav-tabs nav-settings" role="tablist" id="repository-tabs">
|
2017-05-24 15:29:44 +08:00
|
|
|
<% @repositories.each do |repo| %>
|
2017-06-08 20:17:27 +08:00
|
|
|
<li role="presentation">
|
2017-05-24 15:29:44 +08:00
|
|
|
<a href="#custom_repo_<%= repo.id %>"
|
|
|
|
data-toggle="tab"
|
2017-07-17 21:05:28 +08:00
|
|
|
data-repo-table="#repository-table-<%= repo.id %>"
|
2017-05-24 15:29:44 +08:00
|
|
|
aria-controls="custom_repo_<%= repo.id %>"
|
2017-06-08 17:44:24 +08:00
|
|
|
data-url="<%=team_repository_show_tab_path(current_team, repo)%>"
|
2017-05-24 15:29:44 +08:00
|
|
|
title="<%=repo.name%>"><%= truncate(repo.name, length: Constants::NAME_TRUNCATION_LENGTH) %></a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2017-06-08 17:44:24 +08:00
|
|
|
|
2017-05-24 15:29:44 +08:00
|
|
|
<!-- Add new repository tab -->
|
|
|
|
<li role="presentation"
|
2017-06-06 21:50:43 +08:00
|
|
|
<% unless can_create_repository(current_team) %>
|
2017-05-24 15:29:44 +08:00
|
|
|
class="disabled"
|
|
|
|
<% end %>>
|
2017-06-06 19:18:44 +08:00
|
|
|
<a
|
2017-06-06 21:50:43 +08:00
|
|
|
<% if can_create_repository(current_team) %>
|
|
|
|
href="<%= create_modal_team_repositories_path %>"
|
|
|
|
class='create-repository'
|
2017-06-06 19:18:44 +08:00
|
|
|
data-remote='true'
|
2017-05-24 15:29:44 +08:00
|
|
|
<% end %>>
|
|
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
<span class="hidden-xs"> <%= t('repositories.index.add_new_repository_tab') %></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2017-06-03 01:08:51 +08:00
|
|
|
|
2017-05-24 15:29:44 +08:00
|
|
|
<!-- Tab panes -->
|
|
|
|
<div class="tab-content">
|
|
|
|
<% @repositories.each do |repo| %>
|
2017-06-08 20:17:27 +08:00
|
|
|
<div class="tab-pane tab-pane-settings" id="custom_repo_<%= repo.id %>">
|
2017-05-24 15:29:44 +08:00
|
|
|
<!-- Tab Content -->
|
2017-06-16 17:52:26 +08:00
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="tab-content-body"></div>
|
2017-06-08 21:13:00 +08:00
|
|
|
</div>
|
2017-05-24 15:29:44 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2017-05-22 23:54:30 +08:00
|
|
|
|
|
|
|
<% 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 %>
|
2017-05-30 21:09:09 +08:00
|
|
|
|
2017-07-17 21:05:28 +08:00
|
|
|
<%= stylesheet_link_tag 'datatables' %>
|
|
|
|
<%= javascript_include_tag 'repositories/repository_datatable' %>
|
2017-05-30 21:09:09 +08:00
|
|
|
<%= javascript_include_tag "repositories/index", "data-turbolinks-track" => true %>
|