Hash :
78dee358
Author :
Thomas de Grivel
Date :
2022-06-18T14:48:16
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
<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("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><%= 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>