Sha256: 3c64731771686710b3492641e3538774b4e724f20c95483fefd36295ec35b6c7

Contents?: true

Size: 990 Bytes

Versions: 1

Compression:

Stored size: 990 Bytes

Contents

<% title @blob[:name], headline: @repo.name %>

<%= partial :header, locals: { repo: @repo } %>
<%= partial :tree_nav %>

<% raw_blob_url = "#{prefix_url(@repo.param)}/raw/#{params[:tree]}/#{params[:splat].first}" %>

<div class="row">
  <div class="col-md-12">
    <p class="pull-left"><%= file_icon @blob[:filemode] %> <%= @blob[:name] %></p>
    <p class="pull-right"><a href="<%= raw_blob_url %>">Raw</a></p>
  </div>
</div>

<% blob = @repo.find_blob @blob[:oid] %>

<% if blob.binary? %>
  <% if %(gif png jpg jpeg).include? File.extname(@blob[:name])[1..-1].downcase %>
    <a href="<%= raw_blob_url %>">
      <img class="blob-image" src="<%= raw_blob_url %>" alt="<%= @blob[:name] %>">
    </a>
  <% else %>
    <p>Binary file</p>
    <p><img src="/img/download.svg" alt="download" class="icon"> <a href="<%= raw_blob_url %>">Download</a></p>
  <% end %>
<% else %>
  <div class="source-wrapper highlight">
    <%= highlight_source blob.content, @blob[:name] %>
  </div>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ginatra-4.1.0 views/blob.erb