Sha256: 7cde8ba874305a967b719661e554329681a62c3c0858189e861818f01bec4e0e

Contents?: true

Size: 935 Bytes

Versions: 3

Compression:

Stored size: 935 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-fluid">
  <p class="pull-left"><%= file_icon @blob[:filemode] %> <%= @blob[:name] %></p>
  <p class="pull-right"><a href="<%= raw_blob_url %>">Raw</a></p>
</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><span class="icon-download"></span> <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

3 entries across 3 versions & 1 rubygems

Version Path
ginatra-4.0.2 views/blob.erb
ginatra-4.0.1 views/blob.erb
ginatra-4.0.0 views/blob.erb