Commit 36f271a692507f9d9434c0788c2ae85565e3547b

Thomas de Grivel 2023-01-02T20:15:13

show lock on private repos title

1
2
3
4
5
6
7
8
9
10
diff --git a/lib/kmxgit_web/templates/repository/show_title.html.heex b/lib/kmxgit_web/templates/repository/show_title.html.heex
index 2eaf828..93f08aa 100644
--- a/lib/kmxgit_web/templates/repository/show_title.html.heex
+++ b/lib/kmxgit_web/templates/repository/show_title.html.heex
@@ -1,4 +1,4 @@
-<h1 id="repo_title"><%= link Repository.owner_slug(@repo), to: Routes.slug_path(@conn, :show, Repository.owner_slug(@repo)) %>/<%= link @repo.slug, to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo)) %><%= if @path do %>/<%= link @path, to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_tree", @tree] ++ String.split(@path, "/"))) %><% end %></h1>
+<h1 id="repo_title"><%= if ! @repo.public_access do %><i class="fa fa-lock"></i> <% end %><%= link Repository.owner_slug(@repo), to: Routes.slug_path(@conn, :show, Repository.owner_slug(@repo)) %>/<%= link @repo.slug, to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo)) %><%= if @path do %>/<%= link @path, to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_tree", @tree] ++ String.split(@path, "/"))) %><% end %></h1>
 <%= if @repo.forked_from do %>
   <%= gettext("Forked from") %>
   <%= link Repository.full_slug(@repo.forked_from), to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo.forked_from), Repository.splat(@repo.forked_from)) %>