Commit dee214a1c557b9a87174f6fa7caeb172a457609d

Thomas de Grivel 2024-05-14T15:46:17

more insight on public access

diff --git a/lib/kmxgit_web/templates/organisation/show.html.heex b/lib/kmxgit_web/templates/organisation/show.html.heex
index 970f51c..2b9b49f 100644
--- a/lib/kmxgit_web/templates/organisation/show.html.heex
+++ b/lib/kmxgit_web/templates/organisation/show.html.heex
@@ -23,7 +23,7 @@
           <%= for repo <- @repos do %>
             <li class="list-group-item">
               <%= link to: Routes.repository_path(@conn, :show, @org.slug_, Repository.splat(repo)) do %>
-                <%= if repo.public_access do %>
+                <%= if GitManager.public_access?(Repository.full_slug(repo)) do %>
                   <i class="fa fa-code-fork"></i>
                 <% else %>
                   <i class="fa fa-lock"></i>
diff --git a/lib/kmxgit_web/templates/repository/show_title.html.heex b/lib/kmxgit_web/templates/repository/show_title.html.heex
index 93f08aa..2bfb620 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"><%= 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>
+<h1 id="repo_title"><%= if ! @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)) %>
diff --git a/lib/kmxgit_web/templates/user/show.html.heex b/lib/kmxgit_web/templates/user/show.html.heex
index 538de64..8a7cc0c 100644
--- a/lib/kmxgit_web/templates/user/show.html.heex
+++ b/lib/kmxgit_web/templates/user/show.html.heex
@@ -28,7 +28,7 @@
           <%= for repo <- @repos do %>
             <li class="list-group-item">
               <%= link to: Routes.repository_path(@conn, :show, Repository.owner_slug(repo), Repository.splat(repo)) do %>
-                <%= if repo.public_access do %>
+                <%= if GitManager.public_access?(Repository.full_slug(repo)) do %>
                   <i class="fa fa-code-fork"></i>
                 <% else %>
                   <i class="fa fa-lock"></i>