Hash :
970b811c
Author :
Thomas de Grivel
Date :
2021-12-07T11:44:43
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
<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), String.split(@repo.slug, "/")) %></h1>
</div>
<div class="col col-12 col-sm-4">
<%= 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 %>
<%= link gettext("Fork"), to: Routes.repository_path(@conn, :fork, Repository.owner_slug(@repo), Repository.splat(@repo)), class: "btn btn-primary" %>
</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 %>
<%= 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 class="col col-12 col-md-4">
<hr/>
<h2><%= gettext "Properties" %></h2>
<table class="table admin-properties">
<tr>
<th><%= gettext "SSH" %></th>
<td><%= Repository.ssh_url(@repo) %></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>