This commit is contained in:
Toks
2013-05-19 18:51:04 -04:00
parent 5fa931f148
commit ac0c60d87b

View File

@@ -9,8 +9,11 @@
<table width="100%" class="striped"> <table width="100%" class="striped">
<thead> <thead>
<tr> <tr>
<th width="2%"></th> <% if params[:search] && params[:search][:wiki_page_id] && @wiki_page_versions.length > 1 %>
<th width="2%"></th> <th width="3%"></th>
<th width="2%"></th>
<th width="2%"></th>
<% end %>
<th>Title</th> <th>Title</th>
<th width="5%"></th> <th width="5%"></th>
<% if CurrentUser.is_admin? %> <% if CurrentUser.is_admin? %>
@@ -20,18 +23,31 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @wiki_page_versions.each do |wiki_page_version| %> <% @wiki_page_versions.each_with_index do |wiki_page_version, i| %>
<tr> <tr>
<td> <% if params[:search] && params[:search][:wiki_page_id] && @wiki_page_versions.length > 1 %>
<% if params[:search] && params[:search][:wiki_page_id] %> <td>
<%= radio_button_tag "thispage", wiki_page_version.id %> <% if i < @wiki_page_versions.length - 1 %>
<% end %> <%= link_to "diff", diff_wiki_page_versions_path(:otherpage => wiki_page_version.id, :thispage => @wiki_page_versions[i + 1].id) %>
</td> <% else %>
<td> diff
<% if params[:search] && params[:search][:wiki_page_id] %> <% end %>
<%= radio_button_tag "otherpage", wiki_page_version.id %> </td>
<% end %> <td>
</td> <% if i == 1 %>
<%= radio_button_tag "thispage", wiki_page_version.id, :checked => true %>
<% else %>
<%= radio_button_tag "thispage", wiki_page_version.id %>
<% end %>
</td>
<td>
<% if i == 0 %>
<%= radio_button_tag "otherpage", wiki_page_version.id, :checked => true %>
<% else %>
<%= radio_button_tag "otherpage", wiki_page_version.id %>
<% end %>
</td>
<% end %>
<td><%= link_to wiki_page_version.title, wiki_page_version_path(wiki_page_version) %></td> <td><%= link_to wiki_page_version.title, wiki_page_version_path(wiki_page_version) %></td>
<td><%= link_to "wiki", wiki_page_path(wiki_page_version.wiki_page_id) %></td> <td><%= link_to "wiki", wiki_page_path(wiki_page_version.wiki_page_id) %></td>
<% if CurrentUser.is_admin? %> <% if CurrentUser.is_admin? %>