Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleanup whitespace in the data box and add a raw link for any item th…

…at is shown
  • Loading branch information...
commit fb6c1658bfef7932021f2ed851a01409aec0b115 1 parent 635f578
@icefox authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 web/app/views/repositories/show.html.erb
View
13 web/app/views/repositories/show.html.erb
@@ -49,14 +49,17 @@ Copyright 2009 Benjamin Meyer
<% end -%>
<% if readmefile -%>
- <div id="filename"><%=h readmefile.name %></div>
+ <div id="filename"><%=h readmefile.name %>
+ (<a href="<%= ('/' + @repository.user.username + '/' + @repository.name + '/raw/' + @branch + '/' + @joinedpath) -%>">raw</a>)
+ </div>
+ <% if readmefile.name.match(/(png$|jpg$|jpeg$|gif$)/) -%>
<div id="data">
- <% if readmefile.name.match(/(png$|jpg$|jpeg$|gif$)/) %>
<img alt="<%= readmefile.name -%>"
src="<%= ('/' + @repository.user.username + '/' + @repository.name + '/raw/' + @branch + '/' + @joinedpath) -%>">
- <% else %>
- <%= h(readmefile.data).gsub(/\n/, '<br/>') %>
- <% end %>
+ </div>
+ <% else -%>
+ <div id="data"><%= h(readmefile.data).gsub(/\n/, '<br/>') -%></div>
+ <% end -%>
</div>
<% end -%>
Please sign in to comment.
Something went wrong with that request. Please try again.