2005-04-03 08:19:33 +02:00
|
|
|
<%
|
|
|
|
@title = @page.plain_name
|
|
|
|
@show_footer = true
|
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
|
|
|
|
<div id="revision">
|
2005-09-09 07:31:27 +02:00
|
|
|
<%= @renderer.display_content %>
|
2005-01-24 19:52:04 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2005-05-29 01:37:23 +02:00
|
|
|
<% if @page.revisions.length > 1 %>
|
|
|
|
<div id="changes" style="display: none">
|
|
|
|
<p style="background: #eee; padding: 3px; border: 1px solid silver">
|
|
|
|
<small>
|
2005-08-15 01:22:31 +02:00
|
|
|
Showing changes from revision #<%= @page.revisions.size - 2 %> to #<%= @page.revisions.size - 1 %>:
|
2005-05-29 01:37:23 +02:00
|
|
|
<ins class="diffins">Added</ins> | <del class="diffdel">Removed</del>
|
|
|
|
</small>
|
|
|
|
</p>
|
|
|
|
|
2005-09-09 07:31:27 +02:00
|
|
|
<%= @renderer.display_diff %>
|
2005-05-29 01:37:23 +02:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2005-01-24 19:52:04 +01:00
|
|
|
|
|
|
|
<div class="byline">
|
2005-08-15 01:35:10 +02:00
|
|
|
<%= @page.revisions? ? "Revised" : "Created" %> on <%= format_date(@page.revised_at) %>
|
2005-09-10 13:07:40 +02:00
|
|
|
by <%= author_link(@page) %>
|
2005-01-24 19:52:04 +01:00
|
|
|
<%= "(#{@page.author.ip})" if @page.author.respond_to?(:ip) %>
|
2005-08-09 04:20:28 +02:00
|
|
|
<% if @web.count_pages? %>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% 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-05-18 03:10:49 +02:00
|
|
|
{:class => 'navlink', :accesskey => 'E', :name => 'edit'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
|
|
|
|
|
|
|
|
<%= link_to('Edit Web',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'edit_web'},
|
2005-05-18 03:10:49 +02:00
|
|
|
{:class => 'navlink', :name => 'edit_web'})
|
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('Edit',
|
2005-02-19 03:45:28 +01:00
|
|
|
{:web => @web.address, :action => 'edit', :id => @page.name},
|
2005-05-18 03:10:49 +02:00
|
|
|
{:class => 'navlink', :accesskey => 'E', :name => 'edit'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
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},
|
2005-05-18 03:10:49 +02:00
|
|
|
{:class => 'navlink', :accesskey => 'R', :name => 'to_previous_revision'})
|
2005-02-19 00:19:42 +01:00
|
|
|
%>
|
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">
|
2005-05-18 03:10:49 +02:00
|
|
|
| <a href="#" name="see_changes" onClick="toggleChanges(); return false;">See changes</a>
|
2005-01-24 19:52:04 +01:00
|
|
|
</span>
|
2005-05-18 03:10:49 +02:00
|
|
|
<span id="hide_changes" name="hide_changes" style="display: none">
|
2005-01-24 19:52:04 +01:00
|
|
|
| <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-05-18 03:10:49 +02:00
|
|
|
{:accesskey => 'p', :name => 'view_print'}) %>
|
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-05-18 03:10:49 +02:00
|
|
|
<%= link_to 'TeX', {:web => @web.address, :action => 'tex', :id => @page.name},
|
|
|
|
{:name => 'view_tex'} %>
|
2005-02-19 00:19:42 +01:00
|
|
|
|
|
2005-05-18 03:10:49 +02:00
|
|
|
<%= link_to 'PDF', {:web => @web.address, :action => 'pdf', :id => @page.name},
|
|
|
|
{:name => 'view_pdf'} %>
|
2005-01-24 19:52:04 +01:00
|
|
|
<% end %>
|
|
|
|
</small>
|
|
|
|
|
2005-03-27 20:13:43 +02:00
|
|
|
<% unless @page.linked_from.empty? %>
|
2005-01-24 19:52:04 +01:00
|
|
|
<small>
|
2005-02-19 00:19:42 +01:00
|
|
|
| Linked from:
|
2005-03-27 20:13:43 +02:00
|
|
|
<%= @page.linked_from.collect { |referring_page|
|
2005-02-19 00:19:42 +01:00
|
|
|
link_to_existing_page referring_page
|
|
|
|
}.join(", ")
|
|
|
|
%>
|
2005-01-24 19:52:04 +01:00
|
|
|
</small>
|
|
|
|
<% end %>
|
2005-03-27 20:13:43 +02:00
|
|
|
|
|
|
|
<% if @page.included_from.length > 0 %>
|
|
|
|
<small>
|
|
|
|
| Included from: <%= @page.included_from.collect { |referring_page|
|
|
|
|
link_to_existing_page referring_page
|
|
|
|
}.join(", ")
|
|
|
|
%>
|
|
|
|
</small>
|
|
|
|
<% end %>
|
2005-01-24 19:52:04 +01:00
|
|
|
</div>
|
|
|
|
|
2005-04-28 07:35:58 +02:00
|
|
|
<script language="Javascript" type="text/Javascript">
|
2005-01-24 19:52:04 +01:00
|
|
|
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>
|