Commit ca61682654fea55e28d27d76a5413e211913fe1e

Thomas de Grivel 2021-12-13T15:09:08

only show http url if public access is on.

diff --git a/lib/kmxgit_web/templates/admin/repository/show.html.heex b/lib/kmxgit_web/templates/admin/repository/show.html.heex
index eebb3a6..b687c44 100644
--- a/lib/kmxgit_web/templates/admin/repository/show.html.heex
+++ b/lib/kmxgit_web/templates/admin/repository/show.html.heex
@@ -23,10 +23,12 @@
       <th><%= gettext "Slug" %></th>
       <td><%= link Repository.full_slug(@repo), to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo)) %></td>
     </tr>
-    <tr>
-      <th><%= gettext "Git HTTP" %></th>
-      <td><%= Repository.http_url(@repo) %></td>
-    </tr>
+    <%= if @repo.public_access do %>
+      <tr>
+        <th><%= gettext "Git HTTP" %></th>
+        <td><%= Repository.http_url(@repo) %></td>
+      </tr>
+    <% end %>
     <tr>
       <th><%= gettext "Git SSH" %></th>
       <td><%= Repository.ssh_url(@repo) %></td>
diff --git a/lib/kmxgit_web/templates/repository/show.html.heex b/lib/kmxgit_web/templates/repository/show.html.heex
index 78d61bb..4912277 100644
--- a/lib/kmxgit_web/templates/repository/show.html.heex
+++ b/lib/kmxgit_web/templates/repository/show.html.heex
@@ -53,10 +53,12 @@
       <hr/>
       <h2><%= gettext "Properties" %></h2>
       <table class="table admin-properties">
-        <tr>
-          <th><%= gettext "Git HTTP" %></th>
-          <td><%= Repository.http_url(@repo) %></td>
-        </tr>
+        <%= if @repo.public_access do %>
+          <tr>
+            <th><%= gettext "Git HTTP" %></th>
+            <td><%= Repository.http_url(@repo) %></td>
+          </tr>
+        <% end %>
         <tr>
           <th><%= gettext "Git SSH" %></th>
           <td><%= Repository.ssh_url(@repo) %></td>