2005-01-24 19:52:04 +01:00
|
|
|
<% @title = "#{@page.plain_name} (Rev ##{@revision.number})" %>
|
|
|
|
|
|
|
|
<div id="revision">
|
|
|
|
<%= @revision.display_content %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="changes" style="display: none">
|
|
|
|
<p style="background: #eee; padding: 3px; border: 1px solid silver">
|
|
|
|
<small>
|
|
|
|
Showing changes from revision #<%= @revision.number - 1 %> to #<%= @revision.number %>:
|
|
|
|
<ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
|
|
|
|
</small>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<%= @revision.display_diff %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="byline">
|
|
|
|
<%= "Revision from #{@revision.pretty_created_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">
|
|
|
|
|
|
|
|
<% if @revision.next_revision %>
|
|
|
|
<% if @revision.next_revision.number < (@page.revisions.length - 1) %>
|
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-02-19 00:19:42 +01:00
|
|
|
:rev => @revision.next_revision.number},
|
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-05-18 03:47:07 +02:00
|
|
|
<small>(<%= @revision.page.revisions.length - @revision.next_revision.number %> more)</small>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @revision.next_revision && @revision.previous_revision %>
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @revision.previous_revision %>
|
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-02-19 00:19:42 +01:00
|
|
|
:rev => @revision.previous_revision.number},
|
2005-05-18 04:07:48 +02:00
|
|
|
{:class => 'navlink', :name => 'to_previous_revision'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
2005-05-18 03:47:07 +02:00
|
|
|
<small>(<%= @revision.previous_revision.number + 1 %> 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
|
|
|
|
|
|
|
<% if @revision.previous_revision %>
|
|
|
|
<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-02-19 03:45:28 +01: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>
|