history.rhtml
34 lines
| 1.5 KiB
| text/html+ruby
|
RhtmlLexer
|
r330 | <h2><%= @page.pretty_title %></h2> | ||
<h3><%= l(:label_history) %></h3> | ||||
|
r580 | <% form_tag({:action => "diff"}, :method => :get) do %> | ||
|
r330 | <table class="list"> | ||
<thead><tr> | ||||
<th>#</th> | ||||
|
r580 | <th></th> | ||
<th></th> | ||||
|
r330 | <th><%= l(:field_updated_on) %></th> | ||
<th><%= l(:field_author) %></th> | ||||
|
r476 | <th><%= l(:field_comments) %></th> | ||
|
r330 | </tr></thead> | ||
<tbody> | ||||
|
r580 | <% show_diff = @versions.size > 1 %> | ||
<% line_num = 1 %> | ||||
|
r330 | <% @versions.each do |ver| %> | ||
<tr class="<%= cycle("odd", "even") %>"> | ||||
<th align="center"><%= link_to ver.version, :action => 'index', :page => @page.title, :version => ver.version %></th> | ||||
|
r580 | <td align="center" width="1%"><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < @versions.size) %></td> | ||
<td align="center" width="1%"><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true || $('version_from').value > #{ver.version}) {$('cb-#{line_num-1}').checked=true;}") if show_diff && (line_num > 1) %></td> | ||||
|
r330 | <td align="center"><%= format_time(ver.updated_on) %></td> | ||
<td><em><%= ver.author ? ver.author.name : "anonyme" %></em></td> | ||||
|
r476 | <td><%=h ver.comments %></td> | ||
|
r330 | </tr> | ||
|
r580 | <% line_num += 1 %> | ||
|
r330 | <% end %> | ||
</tbody> | ||||
</table> | ||||
|
r580 | <%= submit_tag l(:label_view_diff), :class => 'small' %> | ||
<%= pagination_links_full @version_pages, :page_param => :p %> | ||||
[ <%= @version_pages.current.first_item %> - <%= @version_pages.current.last_item %> / <%= @version_count %> ] | ||||
<% end %> | ||||