<% if @crud_helper.logo_printing_field.present? %>
<% if @crud_helper.logo_printing_field[:field].present? %> <%= render_field_file(@record.send(@crud_helper.logo_printing_field[:field])) %> <% elsif @crud_helper.logo_printing_field[:url].present? %> <%= pdf_image_tag(@crud_helper.logo_printing_field[:url], width: '100px') %> <% end %>
<% end %> <% if @crud_helper.titulo_printing_field.present? %>

<% if @crud_helper.titulo_printing_field[:titulo].present? %> <%= t(@crud_helper.titulo_printing_field[:titulo]) %> <% elsif @crud_helper.titulo_printing_field[:field].present? %> <%= @record.send(@crud_helper.titulo_printing_field[:field]) %> <% else %> <%= Templus.nome_aplicacao %> <% end %>

<% end %>

<%= @crud_helper.title %>
<%= @record.to_s %>

<% @crud_helper.printing_fields.each do |field| %> <% next if field[:sf].present? && !field[:sf][:visible_if].nil? && ((field[:sf][:visible_if].class == Proc && !field[:sf][:visible_if].call(@record)) || (field[:sf][:visible_if].class != Proc && !field[:sf][:visible_if])) %> <% if field[:sf].present? && field[:sf][:label].present? %> <% else %> <% end %> <% if @model.columns_hash[field[:attribute].to_s].present? && [:date, :datetime].include?(@model.columns_hash[field[:attribute].to_s].type) %> <% if field[:date_format].present?%> <% else %> <% end %> <% elsif association?(@model, field[:attribute]) && !belongs_to_association?(@model, field[:attribute]) && !has_one_association?(@model, field[:attribute]) %> <% elsif array?(@record, field[:attribute]) %> <% elsif possui_url?(@record, field[:attribute]) %> <% if deve_renderizar_imagem?(field[:sf]) %> <% else %> <% end %> <% elsif boolean?(@record, field[:attribute]) %> <% else %> <% end %> <% end %>
<%= field[:sf][:label].to_s.mb_chars.upcase.to_s %><%= I18n.t("simple_form.labels.#{@model.name.underscore}.#{field[:attribute]}") %><%= l @record.send(field[:attribute]).strftime(field[:date_format]) if @record.send(field[:attribute]).present? %><%= l @record.send(field[:attribute]) if @record.send(field[:attribute]).present? %> <% @record.send(field[:attribute]).each do |rec| %>
  • <% if field[:sf].present? && field[:sf][:label_method].present? %> <% if possui_url?(rec, field[:sf][:label_method]) %> <% if deve_renderizar_imagem?(field[:sf]) %> <%= render_field_file(rec.send(field[:sf][:label_method])) %> <% else %> <%= rec.send(field[:sf][:label_method]).url %> <% end %> <% else %> <%= rec.send(field[:sf][:label_method]) %> <% end %> <% else %> <% if possui_url?(rec, :itself) && deve_renderizar_imagem?(field[:sf]) %> <%= render_field_file(rec) %> <% else %> <%= rec.to_s %> <% end %> <% end %>
  • <% end %>
    <% @record.send(field[:attribute]).each do |rec| %>
  • <%= rec.to_s %>
  • <% end %>
    <%= render_field_file(@record.send(field[:attribute])) %><%= @record.send(field[:attribute]).url %><%= I18n.t(@record.send(field[:attribute]) ? "shared.sim" : "shared.nao") %> <% if field[:sf].present? && field[:sf][:label_method].present? && @record.send(field[:attribute]).present?%> <%= @record.send(field[:attribute]).send(field[:sf][:label_method]) %> <% else %> <%= @record.send(field[:attribute]) %> <% end %>