<% each_model do -%> <% name_attribute = model.name_attribute description_attribute = model.primary_content_attribute creator_attribute = model.creator_attribute primary_collection = model.view_hints.primary_children if creator_attribute creator_refl = model.reflections[creator_attribute] creator_link = creator_refl && linkable?(creator_refl.klass, :show) end show_link = linkable?(:show) edit_link = !show_link && linkable?(:edit) delete_button = !show_link && !edit_link && linkable?(:destroy, :method => :delete) has_actions = edit_link || delete_button has_body = (!show_link && description_attribute) || creator_link || creator_attribute || primary_collection show_title = !show_link && (name_attribute || !has_body) model_key = model.name.pluralize.underscore -%> <% if name_attribute || show_link || has_actions || !has_body -%> <% if show_link || show_title -%>

<% if show_link %><% else %><% end %>

<% end -%> <% if has_actions -%>
<% if edit_link -%> Edit <% end -%> <% if delete_button -%> <% end -%>
<% end -%>
<% end -%> <% if has_body -%> <% if !show_link && description_attribute -%> param="description"/> <% end -%> <% if creator_link -%> param="creator-link"/> <% elsif creator_attribute -%> param="creator"/> <% end -%> <% if primary_collection -%> param/> <% end -%> <% end -%>
<% end -%>