Hash :
9956a71e
Author :
Thomas de Grivel
Date :
2022-01-16T08:57:33
<h3><%= gettext("Content") %></h3>
<div class="file_content">
<%= if @git.content_html do %>
<div class="content_text">
<div class="line_numbers">
<pre><%= for ln <- @git.line_numbers do %><%= link ln, id: ln, to: "##{ln}" %>
<% end %></pre>
</div>
<div class="content_html">
<%= raw @git.content_html %>
</div>
</div>
<% else %>
<%= if String.match?(@git.content_type, ~r(^text/)) do %>
<div class="content_text">
<div class="line_numbers">
<pre><%= for ln <- @git.line_numbers do %><%= link ln, id: ln, to: "##{ln}" %>
<% end %></pre>
</div>
<pre><%= @git.content %></pre>
</div>
<% end %>
<% end %>
<%= if String.match?(@git.content_type, ~r(^image/)) do %>
<img src={"data:#{@git.content_type};base64,#{Base.encode64(@git.content)}"}/>
<% end %>
<%= link gettext("Download"), to: Routes.repository_path(@conn, :show, Repository.owner_slug(@repo), Repository.splat(@repo, ["_blob", @tree | String.split(@path, "/")])), class: "btn btn-primary" %>
</div>