<% provide(:page_title, t("action.view") + " #{@model.display_name.capitalize}") -%> <% breadcrumb_add( @model.display_name.capitalize.pluralize, { :controller => params[:controller], :action => "index" } ) %>
<%= content_tag(:i, nil, :class => @model.icon) %>
<%= @model.display_name.humanize %> <%= link_to content_tag(:i, nil, :class => 'icon-pencil'), [:edit, resource], :title => t("action.update") + " #{@model.display_name}" %>
    <% @model.display_attributes.each do |fields| %> <% fields.each do |attribute, properties| %> <% if properties["type"] != "adminpanel_file_field" %>
  • <%= properties["label"] %>
    <% if properties["type"] == "wysiwyg_field" %> <%= resource.send(attribute).html_safe -%> <% elsif properties["type"] == "belongs_to" %> <%= parent_object_name(resource, properties["model"]) %> <% elsif properties["type"] == "has_many" %>
      <% resource.send("#{pluralize_model(properties["model"])}").each do |member| %>
    • <%= member.name %>
    • <% end %>
    <% elsif properties['type'] == 'file_field' %>
      <%= image_tag(resource.send("#{attribute}_url", :thumb)) %>
    <% elsif properties["type"] == "boolean" %> <%= resource.send(attribute) ? I18n.t('action.is_true') : I18n.t('action.is_false') %> <% else %> <%= resource.send(attribute) -%> <% end %>
  • <% end %> <% end %> <% end %>
<% if @model.has_images? %>
<%= content_tag(:i, nil, :class => @model.icon) %>
<%= I18n.t("Gallery") %>: <%= @model.display_name.humanize %> <%= link_to content_tag(:i, nil, :class => 'icon-pencil'), [:edit, resource], :title => t("action.update") + " #{@model.display_name}" %>
<% if @model.act_as_a_gallery?.nil? %>
<% else %>
<% end %>
<% end %>