2005-08-15 00:26:54 +02:00
|
|
|
<% @title = "#{@page.plain_name} (Rev ##{@revision_number})" %>
|
2005-01-24 19:52:04 +01:00
|
|
|
|
|
|
|
<div id="revision">
|
|
|
|
<%= @revision.display_content %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="changes" style="display: none">
|
|
|
|
<p style="background: #eee; padding: 3px; border: 1px solid silver">
|
|
|
|
<small>
|
2005-08-15 00:26:54 +02:00
|
|
|
Showing changes from revision #<%= @revision_number - 1 %> to #<%= @revision_number %>:
|
2005-01-24 19:52:04 +01:00
|
|
|
<ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
|
|
|
|
</small>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<%= @revision.display_diff %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="byline">
|
2005-08-15 01:35:10 +02:00
|
|
|
<%= "Revision from #{format_date(@revision.revised_at)} by" %>
|
2005-02-13 19:53:49 +01:00
|
|
|
<%= link_to_page @revision.author %>
|
2005-01-24 19:52:04 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="navigation">
|
|
|
|
|
2005-08-15 00:26:54 +02:00
|
|
|
<% if @revision_number < @page.revisions.length - 1 %>
|
|
|
|
<% if @revision_number < @page.revisions.length - 2 %>
|
2005-02-19 00:19:42 +01:00
|
|
|
<%= link_to('Forward in time',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'revision', :id => @page.name,
|
2005-08-15 00:26:54 +02:00
|
|
|
:rev => @revision_number + 1},
|
2005-05-18 04:07:48 +02:00
|
|
|
{:class => 'navlink', :name => 'to_next_revision'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% else %>
|
2005-02-19 00:19:42 +01:00
|
|
|
<%= link_to('Forward in time',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'show', :id => @page.name},
|
2005-05-18 04:07:48 +02:00
|
|
|
{:class => 'navlink', :name => 'to_next_revision'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% end %>
|
2005-08-15 00:26:54 +02:00
|
|
|
<small>(<%= @revision.page.revisions.length - @revision_number - 1 %> more)</small>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% end %>
|
|
|
|
|
2005-08-15 00:26:54 +02:00
|
|
|
<% if @revision_number > 0 && @revision_number < @page.revisions.size - 1 %>
|
2005-01-24 19:52:04 +01:00
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
2005-08-15 00:26:54 +02:00
|
|
|
<% if @revision_number > 0 %>
|
2005-02-19 00:19:42 +01:00
|
|
|
<%= link_to('Back in time',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'revision', :id => @page.name,
|
2005-08-15 00:26:54 +02:00
|
|
|
:rev => @revision_number - 1},
|
2005-05-18 04:07:48 +02:00
|
|
|
{:class => 'navlink', :name => 'to_previous_revision'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
2005-08-15 00:26:54 +02:00
|
|
|
<small>(<%= @revision_number %> more)</small>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% end %>
|
|
|
|
|
2005-02-19 00:19:42 +01:00
|
|
|
|
|
2005-02-19 03:45:28 +01:00
|
|
|
<%= link_to('See current', {:web => @web.address, :action => 'show', :id => @page.name},
|
2005-05-18 04:07:48 +02:00
|
|
|
{:class => 'navlink', :name => 'to_current_revision'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
|
2005-08-15 00:26:54 +02:00
|
|
|
<% if @revision_number > 0 %>
|
2005-01-24 19:52:04 +01:00
|
|
|
<span id="show_changes">
|
|
|
|
| <a href="#" onClick="toggleChanges(); return false;">See changes</a>
|
|
|
|
</span>
|
|
|
|
<span id="hide_changes" style="display: none">
|
|
|
|
| <a href="#" onClick="toggleChanges(); return false;">Hide changes</a>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
|
2005-02-19 00:19:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
<%= link_to('Rollback',
|
2005-08-15 00:26:54 +02:00
|
|
|
{:web => @web.address, :action => 'rollback', :id => @page.name, :rev => @revision_number},
|
2005-05-18 04:07:48 +02:00
|
|
|
{:class => 'navlink', :name => 'rollback'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
|
|
|
|
<% if @page.references.length > 0 %>
|
|
|
|
<small>
|
2005-02-19 00:19:42 +01:00
|
|
|
| Linked from:
|
|
|
|
<%= @page.references.collect { |ref|
|
2005-02-19 03:45:28 +01:00
|
|
|
link_to ref.name, :web => @web.address, :action => 'show', :id => ref.name
|
2005-02-19 00:19:42 +01:00
|
|
|
}.join(", ")
|
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
</small>
|
2005-02-19 00:19:42 +01:00
|
|
|
<% else %>
|
|
|
|
Orphan page
|
2005-01-24 19:52:04 +01:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script language="Javascript">
|
|
|
|
function toggleChanges() {
|
|
|
|
if (document.getElementById("changes").style.display == "none") {
|
|
|
|
document.getElementById("changes").style.display = "block";
|
|
|
|
document.getElementById("revision").style.display = "none";
|
|
|
|
document.getElementById("show_changes").style.display = "none";
|
|
|
|
document.getElementById("hide_changes").style.display = "inline";
|
|
|
|
} else {
|
|
|
|
document.getElementById("changes").style.display = "none";
|
|
|
|
document.getElementById("revision").style.display = "block";
|
|
|
|
document.getElementById("show_changes").style.display = "inline";
|
|
|
|
document.getElementById("hide_changes").style.display = "none";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|