Hash :
ca616826
Author :
Thomas de Grivel
Date :
2021-12-13T15:09:08
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
<div class="container-fluid">
<div class="row">
<div class="col col-12 col-sm-7">
<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)) %></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)) %>
<% end %>
</div>
<div class="col col-12 col-sm-5">
<%= if Repository.owner?(@repo, @current_user) do %>
<%= link gettext("Edit"),
to: Routes.repository_path(@conn, :edit, Repository.owner_slug(@repo), Repository.splat(@repo)),
class: "btn btn-primary" %>
<% end %>
<%= if @current_user do %>
<%= link gettext("Fork"), to: Routes.repository_path(@conn, :fork, Repository.owner_slug(@repo), Repository.splat(@repo)), class: "btn btn-primary" %>
<% end %>
</div>
</div>
<div class="row">
<div class="col col-12 col-md-7">
<hr/>
<%= gettext("Branch") %>
<%= select :repository, :branch, @git.branches, selected: @branch_url, onchange: "javascript:document.location = this.value;" %>
<h2><%= @path %></h2>
<%= if @git.content do %>
<hr/>
<h2><%= gettext("Content") %></h2>
<pre><%= @git.content %></pre>
<% else %>
<hr/>
<h2><%= gettext("Files") %></h2>
<ul>
<%= for file <- @git.files do %>
<li>
<%= case file.type do %>
<% "blob" -> %>
<%= link file.name, to: file.url %>
<% "tree" -> %>
<%= link "#{file.name}/", to: file.url %>
<% _ -> %>
<%= "#{file.type} #{file.name}" %>
<% end %>
</li>
<% end %>
</ul>
<% end %>
</div>
<div class="col col-12 col-md-5">
<hr/>
<h2><%= gettext "Properties" %></h2>
<table class="table admin-properties">
<%= 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>
</tr>
<tr>
<th><%= gettext "Public access ?" %></th>
<td>
<%= if @repo.public_access do %>
<%= gettext "public" %>
<% else %>
<%= gettext "private" %>
<% end %>
</td>
</tr>
<tr>
<th><%= gettext "Description" %></th>
<td>
<%= if @repo.description do %>
<%= raw Earmark.as_html!(@repo.description) %>
<% end %>
</td>
</tr>
<tr>
<th>
<%= gettext "Users" %><br/>
<%= if Repository.owner?(@repo, @current_user) do %>
<%= link "-",
to: Routes.repository_path(@conn, :remove_user, @owner.slug.slug, Repository.splat(@repo)),
class: "btn btn-danger btn-sm" %>
<%= link "+",
to: Routes.repository_path(@conn, :add_user, @owner.slug.slug, Repository.splat(@repo)),
class: "btn btn-primary btn-sm" %>
<% end %>
</th>
<td>
<ul>
<%= for user <- @members do %>
<li>
<%= link user.slug.slug, to: Routes.slug_path(@conn, :show, user.slug.slug) %>
</li>
<% end %>
</ul>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<%= Enum.map @git.readme, fn readme -> %>
<hr/>
<h2><%= readme.name %></h2>
<div class="container-fluid file-content">
<%= if readme.html do %>
<%= raw readme.html %>
<% else %>
<pre><%= readme.txt %></pre>
<% end %>
</div>
<% end %>
</div>
</div>