summaryrefslogtreecommitdiffstats
path: root/app/views/wiki
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-20 19:10:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-20 19:10:24 +0000
commit31c6ebb31046470d41a625195662dfccdff116c4 (patch)
treeab099bc278f30009158a7afe93a1ca46e9594ef9 /app/views/wiki
parent3d5381b24bb488e4e9edd5a9eec2ba8be4de5c63 (diff)
downloadredmine-31c6ebb31046470d41a625195662dfccdff116c4.tar.gz
redmine-31c6ebb31046470d41a625195662dfccdff116c4.zip
Added wiki annotate view. It's accessible for each version from the page history view.
Slight style change: pre-wrap added on file/diff contents. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1020 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/wiki')
-rw-r--r--app/views/wiki/annotate.rhtml32
-rw-r--r--app/views/wiki/history.rhtml2
2 files changed, 34 insertions, 0 deletions
diff --git a/app/views/wiki/annotate.rhtml b/app/views/wiki/annotate.rhtml
new file mode 100644
index 000000000..1c683404b
--- /dev/null
+++ b/app/views/wiki/annotate.rhtml
@@ -0,0 +1,32 @@
+<div class="contextual">
+<%= link_to(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit') %>
+<%= link_to(l(:label_history), {:action => 'history', :page => @page.title}, :class => 'icon icon-history') %>
+</div>
+
+<h2><%= @page.pretty_title %></h2>
+
+<p>
+<%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'index', :page => @page.title, :version => @annotate.content.version %>
+<em>(<%= @annotate.content.author ? @annotate.content.author.name : "anonyme" %>, <%= format_time(@annotate.content.updated_on) %>)</em>
+</p>
+
+<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
+
+<table class="filecontent annotate CodeRay ">
+<tbody>
+<% line_num = 1 %>
+<% @annotate.lines.each do |line| -%>
+<tr class="bloc-<%= colors[line[0]] %>">
+ <th class="line-num"><%= line_num %></th>
+ <td class="revision"><%= link_to line[0], :controller => 'wiki', :action => 'index', :id => @project, :page => @page.title, :version => line[0] %></td>
+ <td class="author"><%= h(line[1]) %></td>
+ <td class="line-code"><pre><%= line[2] %></pre></td>
+</tr>
+<% line_num += 1 %>
+<% end -%>
+</tbody>
+</table>
+
+<% content_for :header_tags do %>
+<%= stylesheet_link_tag 'scm' %>
+<% end %>
diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml
index b2a467752..fc77e7fb5 100644
--- a/app/views/wiki/history.rhtml
+++ b/app/views/wiki/history.rhtml
@@ -11,6 +11,7 @@
<th><%= l(:field_updated_on) %></th>
<th><%= l(:field_author) %></th>
<th><%= l(:field_comments) %></th>
+ <th></th>
</tr></thead>
<tbody>
<% show_diff = @versions.size > 1 %>
@@ -23,6 +24,7 @@
<td align="center"><%= format_time(ver.updated_on) %></td>
<td><em><%= ver.author ? ver.author.name : "anonyme" %></em></td>
<td><%=h ver.comments %></td>
+ <td align="center"><%= link_to l(:button_annotate), :action => 'annotate', :page => @page.title, :version => ver.version %></td>
</tr>
<% line_num += 1 %>
<% end %>