Sha256: 70a2e8124d15390a0e7f4e0ea9712b1c44e617f4d652224cc6f9e2786b46ee79

Contents?: true

Size: 1.3 KB

Versions: 5

Compression:

Stored size: 1.3 KB

Contents

<%
  page_title = _("Show %{resource}", :resource => @resource.model_name.human)
  title(page_title)
%>

<% content_for :sidebar, build_sidebar %>

<h2>
  <%= page_title %>
  <small></small>
</h2>

<%= display_flash_message %>
<%= typus_block %>

<dl>
<%- @fields.each do |field| -%>
  <dt><%=h @resource.human_attribute_name(field.first) %></dt>
  <%-
    data_type = field.last
    raw_data = @item.send(field.first)
    data = case data_type
           when :boolean
             boolean_hash = @resource.typus_boolean(field.first)
             !raw_data.nil? ? boolean_hash["#{raw_data}".to_sym] : @resource.typus_options_for(:nil)
           when :belongs_to
             if !raw_data.nil?
               controller = raw_data.class.to_resource
               action = raw_data.class.typus_options_for(:default_action_on_item)
               options = { :controller => controller, :action => action, :id => raw_data }
               link_to raw_data.to_label, options
             else
               nil
             end
           when :file
             typus_preview(@item, field.first)
           when :selector
             @item.mapping(field.first)
           else
             raw_data
           end
  -%>
  <dd><%= data.blank? ? "&#151;".html_safe : data %></dd>
<%- end -%>
</dl>

<%= raw typus_relationships %>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
typus-1.0.0.pre5 app/views/admin/resources/show.html.erb
typus-1.0.0.pre4 app/views/admin/resources/show.html.erb
typus-1.0.0.pre3 app/views/admin/resources/show.html.erb
typus-1.0.0.pre2 app/views/admin/resources/show.html.erb
typus-1.0.0.pre app/views/admin/resources/show.html.erb