<% @overview = "This page displays the history of changes of #{@page.presentation_name} in Wiki #{@wiki.title}" %>

<div id="menu">
    <%= link_to('Edit', {:controller => 'pages', :action=> 'checkout', :id=> @page.id, :site_id => @wiki.id}) %>
    <% if session['user'] %>
    | <%= link_to_notification_toggle(@page, Page.name) %>
    <% end %>
    <% if @versions && @versions.size > 1 && !@page.checkedout? %>
	| <%= link_to_function("Rollback") do |page| 
			page.visual_effect :toggle_appear, "rollback_form"  
		end %>
    <% end %>
</div>
<br>
<% if @versions && @versions.size > 1 %>
<div id="rollback_form" style="display: none;">
<% @table_heading = "Rollback" %>
<% tabular_form_for :version, @versions.first, :url => { :action => 'rollback' } do |f| %>
    <tr>
        <th>Back to Version</th>
        <td><%= f.select :version_id, (@versions - [@versions.last]).collect {|version| [version.version_text, version.id]} %></td></tr> 
    </tr>
    <tr><th></th><td><%= submit_tag 'Submit' %></td></tr>    
<% end %>
</div>
<% end %>

<%= render :partial => 'versions/versions_list' %>
<%= render :partial => 'relationships' %>

