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">
<thead>
<tr>
<th width="2%"></th>
<th width="2%"></th>
<% if params[:search] && params[:search][:wiki_page_id] && @wiki_page_versions.length > 1 %>
<th width="3%"></th>
<th width="2%"></th>
<th width="2%"></th>
<% end %>
<th>Title</th>
<th width="5%"></th>
<% if CurrentUser.is_admin? %>
@@ -20,18 +23,31 @@
</tr>
</thead>
<tbody>
<% @wiki_page_versions.each do |wiki_page_version| %>
<% @wiki_page_versions.each_with_index do |wiki_page_version, i| %>
<tr>
<td>
<% if params[:search] && params[:search][:wiki_page_id] %>
<%= radio_button_tag "thispage", wiki_page_version.id %>
<% end %>
</td>
<td>
<% if params[:search] && params[:search][:wiki_page_id] %>
<%= radio_button_tag "otherpage", wiki_page_version.id %>
<% end %>
</td>
<% if params[:search] && params[:search][:wiki_page_id] && @wiki_page_versions.length > 1 %>
<td>
<% if i < @wiki_page_versions.length - 1 %>
<%= link_to "diff", diff_wiki_page_versions_path(:otherpage => wiki_page_version.id, :thispage => @wiki_page_versions[i + 1].id) %>
<% else %>
diff
<% 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", wiki_page_path(wiki_page_version.wiki_page_id) %></td>
<% if CurrentUser.is_admin? %>