2017-05-22 23:54:30 +08:00
|
|
|
<% 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 -->
|
|
|
|
<% if @repositories.present? %>
|
|
|
|
<ul class="nav nav-tabs nav-settings" role="tablist" id="tabs">
|
|
|
|
<% @repositories.each.with_index do |repo, i| %>
|
|
|
|
<li role="presentation" class="<%= 'active' if i == 0 %>">
|
|
|
|
<a class="repository-nav-tab"
|
2017-05-25 16:06:48 +08:00
|
|
|
href="#custom_repo_<%= repo.id %>"
|
2017-05-22 23:54:30 +08:00
|
|
|
data-toggle="tab"
|
2017-05-25 16:06:48 +08:00
|
|
|
aria-controls="custom_repo_<%= repo.id %>"
|
2017-05-25 17:01:24 +08:00
|
|
|
title="<%=repo.name%>"><%= truncate(repo.name, length: Constants::NAME_TRUNCATION_LENGTH) %></a>
|
2017-05-22 23:54:30 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<!-- Tab panes -->
|
|
|
|
<div class="tab-content">
|
|
|
|
<% @repositories.each.with_index do |repo, i| %>
|
2017-05-25 16:06:48 +08:00
|
|
|
<div class="tab-pane tab-pane-settings <%= 'active' if i == 0 %>" id="custom_repo_<%= repo.id %>">
|
2017-05-22 23:54:30 +08:00
|
|
|
<!-- Tab Content -->
|
2017-05-29 19:35:44 +08:00
|
|
|
|
|
|
|
<div id="repository-toolbar">
|
|
|
|
<div class="dropdown text-right">
|
|
|
|
<div class="btn btn-default btn-xs"
|
|
|
|
type="button"
|
|
|
|
data-toggle="dropdown"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="true">
|
|
|
|
<span class="glyphicon glyphicon-cog"></span>
|
|
|
|
<span class="caret"></span>
|
|
|
|
</div>
|
|
|
|
<ul class="dropdown-menu pull-right">
|
|
|
|
<li class="dropdown-header">
|
|
|
|
<%= t("repositories.index.options_dropdown.header") %>
|
|
|
|
</li>
|
|
|
|
<li>
|
2017-06-01 01:24:38 +08:00
|
|
|
<%= link_to t('repositories.index.options_dropdown.rename'),
|
|
|
|
team_repository_rename_modal_path(repository_id: repo),
|
2017-06-01 02:18:32 +08:00
|
|
|
class: "rename-repo-option",
|
|
|
|
remote: true %>
|
2017-05-29 19:35:44 +08:00
|
|
|
</li>
|
|
|
|
<li>
|
2017-06-01 02:18:32 +08:00
|
|
|
<!-- TODO -->
|
2017-05-29 19:35:44 +08:00
|
|
|
<a href="#">
|
|
|
|
<%= t("repositories.index.options_dropdown.copy") %>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li role="separator" class="divider"></li>
|
2017-05-30 21:09:09 +08:00
|
|
|
<li>
|
2017-05-30 21:11:28 +08:00
|
|
|
<%= link_to t('repositories.index.modal_delete.delete'),
|
|
|
|
team_repository_destroy_modal_path(repository_id: repo),
|
2017-06-01 02:18:32 +08:00
|
|
|
class: "delete-repo-option",
|
|
|
|
remote: true %>
|
2017-05-29 19:35:44 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-05-22 23:54:30 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<p><em><%=t 'repositories.index.no_repositories' %></em></p>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% 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
|
|
|
|
|
|
|
<%= javascript_include_tag "repositories/index", "data-turbolinks-track" => true %>
|