Extract the inbound links list from page.rhtml and revision.rhtml into a partial

instiki-ar
Alexey Verkhovsky 2005-11-04 06:19:10 +00:00
parent 4779a4fa4e
commit c7295287a4
3 changed files with 18 additions and 31 deletions

View File

@ -0,0 +1,13 @@
<% unless @page.linked_from.empty? %>
<small>
| Linked from:
<%= @page.linked_from.collect { |referring_page| link_to_existing_page referring_page }.join(", ") %>
</small>
<% end %>
<% unless @page.included_from.empty? %>
<small>
| Included from:
<%= @page.included_from.collect { |referring_page| link_to_existing_page referring_page }.join(", ") %>
</small>
<% end %>

View File

@ -71,8 +71,8 @@
<small>
| Views:
<%= link_to('Print',
{:web => @web.address, :action => 'print', :id => @page.name},
{:accesskey => 'p', :name => 'view_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},
@ -83,24 +83,7 @@
<% end %>
</small>
<% unless @page.linked_from.empty? %>
<small>
| Linked from:
<%= @page.linked_from.collect { |referring_page|
link_to_existing_page referring_page
}.join(", ")
%>
</small>
<% end %>
<% if @page.included_from.length > 0 %>
<small>
| Included from: <%= @page.included_from.collect { |referring_page|
link_to_existing_page referring_page
}.join(", ")
%>
</small>
<% end %>
<%= render :partial => 'inbound_links' %>
</div>
<script language="Javascript" type="text/Javascript">

View File

@ -72,18 +72,9 @@
{:web => @web.address, :action => 'rollback', :id => @page.name, :rev => @revision_number},
{:class => 'navlink', :name => 'rollback'})
%>
<%= render :partial => 'inbound_links' %>
<% if @page.references.length > 0 %>
<small>
| Linked from:
<%= @page.references.collect { |ref|
link_to ref.name, :web => @web.address, :action => 'show', :id => ref.name
}.join(", ")
%>
</small>
<% else %>
Orphan page
<% end %>
</div>
<script language="Javascript">