Noosfero/noosfero

View on GitHub
app/views/content_viewer/_article_title.html.erb

Summary

Maintainability
Test Coverage
<% if @page.belongs_to_blog? || @page.belongs_to_forum?%>
  <h1 class="title">
    <% if no_link %>
      <%= h(@page.title) %>
    <% else %>
      <%= link_to(@page.name, @page.url) %>
    <% end %>
  </h1>
  <%= path_to_parents @page %>
  <%= render :partial => "publishing_info", :locals => {:article => @page }%>
  <% if @page.display_preview? %>
    <div class="preview">
      <%= @page.lead.html_safe %>
    </div>
  <% end %>
<% elsif @page.custom_title %>
  <%= render :partial => "content_viewer/#{@page.type.demodulize.underscore}_custom_title",
               :locals => {:article => @page }%>
<% else %>
  <h1 class="title">
    <%= h(@page.title) %>
  </h1>
  <%= path_to_parents @page %>
  <%= render :partial => "publishing_info", :locals => {:article => @page }%>
<% end %>