instiki/app/views/wiki/page.rhtml

72 lines
2.4 KiB
Plaintext

<%
@title = @page.plain_name
@title += ' (changes)' if @show_diff
@show_footer = true
%>
<div id="revision">
<%= @show_diff ? @renderer.display_diff : @renderer.display_content %>
</div>
<div class="byline">
<%= @page.revisions? ? "Revised" : "Created" %> on <%= format_date(@page.revised_at) %>
by <%= author_link(@page) %>
<%= "(#{@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" %>
<%= link_to('Edit Page',
{:web => @web.address, :action => 'edit', :id => @page.name},
{:class => 'navlink', :accesskey => 'E', :name => 'edit'})
%>
|
<%= link_to('Edit Web',
{:web => @web.address, :action => 'edit_web'},
{:class => 'navlink', :name => 'edit_web'})
%>
<% else %>
<%= link_to('Edit',
{:web => @web.address, :action => 'edit', :id => @page.name},
{:class => 'navlink', :accesskey => 'E', :name => 'edit'})
%>
<% end %>
<% if @page.revisions.length > 1 %>
|
<%= link_to('Back in time',
{:web => @web.address, :action => 'revision', :id => @page.name,
:rev => @page.revisions.length - 2},
{:class => 'navlink', :accesskey => 'R', :name => 'to_previous_revision'})
%>
<small>(<%= @page.revisions.length - 1 %> revisions)</small>
|
<%= link_to(@show_diff ? 'Hide changes' : 'See changes',
{ :web => @web.address, :action => 'show', :id => @page.name,
:mode => (@show_diff ? nil : 'diff') },
{ :class => 'navlink', :accesskey => 'C', :name => 'see_changes' })
%>
<% end %>
<small>
| Views:
<%= link_to('Print',
{ :web => @web.address, :action => 'print', :id => @page.name },
{ :accesskey => 'p', :name => 'view_print' }) %>
<% if defined? RedClothForTex and RedClothForTex.available? and @web.markup == :textile %>
|
<%= link_to 'TeX', {:web => @web.address, :action => 'tex', :id => @page.name},
{:name => 'view_tex'} %>
|
<%= link_to 'PDF', {:web => @web.address, :action => 'pdf', :id => @page.name},
{:name => 'view_pdf'} %>
<% end %>
</small>
<%= render :partial => 'inbound_links' %>
</div>