summaryrefslogtreecommitdiffstats
path: root/app/views/repositories
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-08 15:49:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-08 15:49:20 +0000
commit8614c00c8a3e34e6b081ba2dc1be7985acc4bd4b (patch)
tree983e866e4ec21a84783a9063059957728f4d0d43 /app/views/repositories
parentdf0a49ff14474dd2230a823f57e95aa9d3b1cd71 (diff)
downloadredmine-8614c00c8a3e34e6b081ba2dc1be7985acc4bd4b.tar.gz
redmine-8614c00c8a3e34e6b081ba2dc1be7985acc4bd4b.zip
Text files can now be viewed online when browsing the repository.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@521 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/repositories')
-rw-r--r--app/views/repositories/entry.rhtml23
-rw-r--r--app/views/repositories/revisions.rhtml7
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/, '&nbsp;') %></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>