Hash :
51ef9943
Author :
Thomas de Grivel
Date :
2024-05-14T16:29:58
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
<div class="container-fluid">
<h1>Repositories</h1>
<%= render(KmxgitWeb.LayoutView, "search.html", assigns) %>
<%= render("pagination.html", assigns) %>
<table class="table admin-index">
<thead>
<tr>
<th><%= link gettext("Id"), to: Routes.admin_repository_path(@conn, :index, search: @search, sort: "id#{if @index.column == "id" && !@index.reverse, do: "-"}") %><%= if @index.column == "id" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
<th><%= link gettext("Owner"), to: Routes.admin_repository_path(@conn, :index, search: @search, sort: "owner#{if @index.column == "owner" && !@index.reverse, do: "-"}") %><%= if @index.column == "owner" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
<th><%= link gettext("Public access ?"), to: Routes.admin_repository_path(@conn, :index, search: @search, sort: "slug#{if @index.column == "public_access" && !@index.reverse, do: "-"}") %><%= if @index.column == "public_access" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
<th><%= link gettext("Slug"), to: Routes.admin_repository_path(@conn, :index, search: @search, sort: "slug#{if @index.column == "slug" && !@index.reverse, do: "-"}") %><%= if @index.column == "slug" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
<th><%= link gettext("Disk usage"), to: Routes.admin_repository_path(@conn, :index, search: @search, sort: "du#{if @index.column != "du" || (@index.column == "du" && !@index.reverse), do: "-"}") %><%= if @index.column == "du" do %><%= if @index.reverse do %> <i class="fa fa-angle-down"></i><% else %> <i class="fa fa-angle-up"></i><% end %><% end %></th>
<th><%= gettext("Actions") %></th>
</tr>
</thead>
<tbody>
<%= Enum.map @pagination.result, fn repo -> %>
<tr>
<td><%= link repo.id, to: Routes.admin_repository_path(@conn, :show, repo) %></td>
<td>
<%= case owner = Repository.owner(repo) do %>
<% %Organisation{} -> %>
<%= link owner.name || owner.slug_, to: Routes.admin_organisation_path(@conn, :show, owner) %>
<% %User{} -> %>
<%= link User.login(owner), to: Routes.admin_user_path(@conn, :show, owner) %>
<% end %>
</td>
<td>
<%= if GitManager.public_access?(Repository.full_slug(repo)) do %>
<i class="fa fa-code-fork"></i>
<% else %>
<i class="fa fa-lock"></i>
<% end %>
</td>
<td><%= link Repository.full_slug(repo), to: Routes.admin_repository_path(@conn, :show, repo) %></td>
<td><%= disk_usage(repo.disk_usage) %></td>
<td>
<%= link gettext("Show"), to: Routes.repository_path(@conn, :show, Repository.owner_slug(repo), Repository.splat(repo)), class: "btn btn-sm btn-primary" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= render("pagination.html", assigns) %>
</div>