2005-01-24 19:52:04 +01:00
|
|
|
<% @title = @page.plain_name %>
|
|
|
|
|
|
|
|
<div id="revision">
|
|
|
|
<%= @page.display_content %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="changes" style="display: none">
|
|
|
|
<p style="background: #eee; padding: 3px; border: 1px solid silver">
|
|
|
|
<small>
|
|
|
|
Showing changes from revision #<%= @page.number - 1 %> to #<%= @page.number %>:
|
|
|
|
<ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
|
|
|
|
</small>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<%= @page.display_diff %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="byline">
|
|
|
|
<%= @page.revisions? ? "Revised" : "Created" %> on <%= @page.pretty_created_at %>
|
|
|
|
by <%= @page.author_link %>
|
|
|
|
<%= "(#{@page.author.ip})" if @page.author.respond_to?(:ip) %>
|
|
|
|
<% if @web.count_pages %>
|
|
|
|
<% total_chars = @page.content.length %>
|
|
|
|
(<%= total_chars %> characters / <%= sprintf("%-.1f", (total_chars / 2275 rescue 0)) %> pages)
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="navigation">
|
|
|
|
<% if @page.name == "HomePage" %>
|
2005-02-19 00:19:42 +01:00
|
|
|
<%= link_to('Edit Page',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'edit', :id => @page.name},
|
2005-02-19 00:19:42 +01:00
|
|
|
{:class => 'navlink', :accesskey => 'E'})
|
|
|
|
%>
|
|
|
|
|
|
|
|
|
<%= link_to('Edit Web',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'edit_web'},
|
2005-02-19 00:19:42 +01:00
|
|
|
{:class => 'navlink'})
|
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% else %>
|
2005-02-19 00:19:42 +01:00
|
|
|
<%= link_to('Edit',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'edit', :id => @page.name},
|
2005-02-19 00:19:42 +01:00
|
|
|
{:class => 'navlink', :accesskey => 'E'})
|
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @page.revisions.length > 1 %>
|
2005-02-19 00:19:42 +01:00
|
|
|
|
|
|
|
|
<%= link_to('Back in time',
|
2005-02-19 15:38:10 +01:00
|
|
|
{:web => @web.address, :action => 'revision', :id => @page.name,
|
2005-02-19 00:19:42 +01:00
|
|
|
:rev => @page.revisions.length - 2},
|
|
|
|
{:class => 'navlink', :accesskey => 'R'})
|
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
<small>(<%= @page.revisions.length - 1 %> revisions)</small>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @page.revisions.length > 1 %>
|
|
|
|
<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 %>
|
|
|
|
|
|
|
|
<small>
|
2005-02-19 00:19:42 +01:00
|
|
|
| Views:
|
|
|
|
<%= link_to('Print',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'print', :id => @page.name},
|
2005-02-19 00:19:42 +01:00
|
|
|
{:accesskey => 'p'}) %>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% if defined? RedClothForTex and RedClothForTex.available? and @web.markup == :textile %>
|
2005-02-19 00:19:42 +01:00
|
|
|
|
|
2005-02-19 03:45:28 +01:00
|
|
|
<%= link_to 'TeX', :web => @web.address, :action => 'tex', :id => @page.name %>
|
2005-02-19 00:19:42 +01:00
|
|
|
|
|
2005-02-19 03:45:28 +01:00
|
|
|
<%= link_to 'PDF', :web => @web.address, :action => 'pdf', :id => @page.name %>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% end %>
|
|
|
|
</small>
|
|
|
|
|
|
|
|
<% if @page.references.length > 0 %>
|
|
|
|
<small>
|
2005-02-19 00:19:42 +01:00
|
|
|
| Linked from:
|
|
|
|
<%= @page.references.collect { |referring_page|
|
|
|
|
link_to_existing_page referring_page
|
|
|
|
}.join(", ")
|
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
</small>
|
|
|
|
<% 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>
|