mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-12 12:16:06 +08:00
89 lines
3.4 KiB
Text
89 lines
3.4 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 } %>
|
|
<%= render partial: "repositories/index/create_new_modal.html.erb" %>
|
|
|
|
<% active_repo = @repositories.find_by_id(params[:repository]) %>
|
|
<% active_repo = @repositories.first if !active_repo %>
|
|
|
|
<!-- Nav tabs -->
|
|
<ul class="nav nav-tabs nav-settings" role="tablist" id="tabs">
|
|
<% @repositories.each do |repo| %>
|
|
<li role="presentation" class="<%= 'active' if repo == active_repo %>">
|
|
<a href="#custom_repo_<%= repo.id %>"
|
|
data-toggle="tab"
|
|
aria-controls="custom_repo_<%= repo.id %>"
|
|
title="<%=repo.name%>"><%= truncate(repo.name, length: Constants::NAME_TRUNCATION_LENGTH) %></a>
|
|
</li>
|
|
<% end %>
|
|
<!-- Add new repository tab -->
|
|
<li role="presentation"
|
|
<% unless can_create_new_repository(current_team) %>
|
|
class="disabled"
|
|
<% end %>>
|
|
<a href='#'
|
|
data-url="<%= create_new_modal_team_repositories_path %>"
|
|
<% if can_create_new_repository(current_team) %>
|
|
id='create-new-repository'
|
|
<% 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 <%= 'active' if repo == active_repo %>" id="custom_repo_<%= repo.id %>">
|
|
|
|
<!-- Tab Content -->
|
|
<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"
|
|
<%= "disabled='disabled'" if !can_edit_and_destroy_repository repo %>>
|
|
<span class="glyphicon glyphicon-cog"></span>
|
|
<span class="caret"></span>
|
|
</div>
|
|
<% if can_edit_and_destroy_repository repo %>
|
|
<ul class="dropdown-menu pull-right">
|
|
<li class="dropdown-header">
|
|
<%= t("repositories.index.options_dropdown.header") %>
|
|
</li>
|
|
<li>
|
|
<%= link_to t('repositories.index.options_dropdown.rename'),
|
|
team_repository_rename_modal_path(repository_id: repo),
|
|
class: "rename-repo-option",
|
|
remote: true %>
|
|
</li>
|
|
<li role="separator" class="divider"></li>
|
|
<li>
|
|
<%= link_to t('repositories.index.modal_delete.delete'),
|
|
team_repository_destroy_modal_path(repository_id: repo),
|
|
class: "delete-repo-option",
|
|
remote: true %>
|
|
</li>
|
|
</ul>
|
|
<% end %>
|
|
</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 %>
|
|
|
|
<%= javascript_include_tag "repositories/index", "data-turbolinks-track" => true %>
|