diff options
Diffstat (limited to 'app/views/repositories')
-rw-r--r-- | app/views/repositories/entry.rhtml | 23 | ||||
-rw-r--r-- | app/views/repositories/revisions.rhtml | 7 |
2 files changed, 29 insertions, 1 deletions
diff --git a/app/views/repositories/entry.rhtml b/app/views/repositories/entry.rhtml new file mode 100644 index 000000000..dfceac2ef --- /dev/null +++ b/app/views/repositories/entry.rhtml @@ -0,0 +1,23 @@ +<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2> + +<table class="list"> + <thead> + <tr> + <th colspan="2" class="list-filename"><%= @path %></th> + </tr> + </thead> + <tbody> + <% line_num = 1 %> + <% @content.each_line do |line| %> + <tr> + <th class="line-num"><%= line_num %></th> + <td class="line-code"><%= h(line).gsub(/\s/, ' ') %></td> + </tr> + <% line_num += 1 %> + <% end %> + <tbody> +</table> + +<% content_for :header_tags do %> +<%= stylesheet_link_tag "scm" %> +<% end %> diff --git a/app/views/repositories/revisions.rhtml b/app/views/repositories/revisions.rhtml index 91ef64ed4..4a5b3766e 100644 --- a/app/views/repositories/revisions.rhtml +++ b/app/views/repositories/revisions.rhtml @@ -9,7 +9,12 @@ <% if @entry && @entry.is_file? %> <h3><%=h @entry.name %></h3> -<p><%= link_to l(:button_download), {:action => 'entry', :id => @project, :path => @path, :rev => @rev, :format => 'raw' }, :class => "icon file" %> (<%= number_to_human_size @entry.size %>)</p> +<p> +<% if @entry.is_text? %> +<%= link_to l(:button_view), {:action => 'entry', :id => @project, :path => @path, :rev => @rev } %> | +<% end %> +<%= link_to l(:button_download), {:action => 'entry', :id => @project, :path => @path, :rev => @rev, :format => 'raw' } %> +(<%= number_to_human_size @entry.size %>)</p> <% end %> <h3><%= l(:label_revision_plural) %></h3> |