Commit c30baa4e3f3f8880181202e3c2eccbfb15a5b8db

Thomas de Grivel 2023-01-02T04:14:41

display lock on private repos

diff --git a/lib/kmxgit_web/templates/organisation/show.html.heex b/lib/kmxgit_web/templates/organisation/show.html.heex
index e881157..e0582f0 100644
--- a/lib/kmxgit_web/templates/organisation/show.html.heex
+++ b/lib/kmxgit_web/templates/organisation/show.html.heex
@@ -23,7 +23,11 @@
           <%= for repo <- @repos do %>
             <li class="list-group-item">
               <%= link to: Routes.repository_path(@conn, :show, @org.slug_, Repository.splat(repo)) do %>
-                <i class="fa fa-code-fork"></i>
+                <%= if repo.public_access do %>
+                  <i class="fa fa-code-fork"></i>
+                <% else %>
+                  <i class="fa fa-lock"></i>
+                <% end %>
                 <%= Repository.full_slug(repo) %>
               <% end %>
             </li>
diff --git a/lib/kmxgit_web/templates/user/show.html.heex b/lib/kmxgit_web/templates/user/show.html.heex
index 7e51c51..29a96ce 100644
--- a/lib/kmxgit_web/templates/user/show.html.heex
+++ b/lib/kmxgit_web/templates/user/show.html.heex
@@ -28,7 +28,11 @@
           <%= for repo <- @repos do %>
             <li class="list-group-item">
               <%= link to: Routes.repository_path(@conn, :show, Repository.owner_slug(repo), Repository.splat(repo)) do %>
-                <i class="fa fa-code-fork"></i>&nbsp;
+                <%= if repo.public_access do %>
+                  <i class="fa fa-code-fork"></i>
+                <% else %>
+                  <i class="fa fa-lock"></i>
+                <% end %>
                 <%= Repository.full_slug(repo) %>
               <% end %>
             </li>