diff --git a/app/views/wiki_page_versions/index.html.erb b/app/views/wiki_page_versions/index.html.erb index 258cd755c..43b3b28c1 100644 --- a/app/views/wiki_page_versions/index.html.erb +++ b/app/views/wiki_page_versions/index.html.erb @@ -9,8 +9,11 @@ - - + <% if params[:search] && params[:search][:wiki_page_id] && @wiki_page_versions.length > 1 %> + + + + <% end %> <% if CurrentUser.is_admin? %> @@ -20,18 +23,31 @@ - <% @wiki_page_versions.each do |wiki_page_version| %> + <% @wiki_page_versions.each_with_index do |wiki_page_version, i| %> - - + <% if params[:search] && params[:search][:wiki_page_id] && @wiki_page_versions.length > 1 %> + + + + <% end %> <% if CurrentUser.is_admin? %>
Title
- <% if params[:search] && params[:search][:wiki_page_id] %> - <%= radio_button_tag "thispage", wiki_page_version.id %> - <% end %> - - <% if params[:search] && params[:search][:wiki_page_id] %> - <%= radio_button_tag "otherpage", wiki_page_version.id %> - <% end %> - + <% 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 %> + + <% if i == 1 %> + <%= radio_button_tag "thispage", wiki_page_version.id, :checked => true %> + <% else %> + <%= radio_button_tag "thispage", wiki_page_version.id %> + <% end %> + + <% if i == 0 %> + <%= radio_button_tag "otherpage", wiki_page_version.id, :checked => true %> + <% else %> + <%= radio_button_tag "otherpage", wiki_page_version.id %> + <% end %> + <%= link_to wiki_page_version.title, wiki_page_version_path(wiki_page_version) %> <%= link_to "wiki", wiki_page_path(wiki_page_version.wiki_page_id) %>