Extract the inbound links list from page.rhtml and revision.rhtml into a partial
This commit is contained in:
parent
4779a4fa4e
commit
c7295287a4
3 changed files with 18 additions and 31 deletions
13
app/views/wiki/_inbound_links.rhtml
Normal file
13
app/views/wiki/_inbound_links.rhtml
Normal 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 %>
|
|
@ -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">
|
||||
|
|
|
@ -73,17 +73,8 @@
|
|||
{:class => 'navlink', :name => 'rollback'})
|
||||
%>
|
||||
|
||||
<% 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 %>
|
||||
<%= render :partial => 'inbound_links' %>
|
||||
|
||||
</div>
|
||||
|
||||
<script language="Javascript">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue