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

60 lines
2.2 KiB
Text
Raw Normal View History

<% 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 -->
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"
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"
2018-01-05 22:15:50 +08:00
<% unless can_create_repositories?(current_team) || current_team.repositories.count < Constants::REPOSITORIES_LIMIT %>
2017-05-24 15:29:44 +08:00
class="disabled"
<% end %>>
2017-06-06 19:18:44 +08:00
<a
2018-01-05 22:15:50 +08:00
<% if can_create_repositories?(current_team) && current_team.repositories.count < Constants::REPOSITORIES_LIMIT %>
2017-06-06 21:50:43 +08:00
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">&nbsp;<%= t('repositories.index.add_new_repository_tab') %></span>
</a>
</li>
</ul>
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>
</div>
2017-05-24 15:29:44 +08:00
</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 %>