app/views/partido_steps/_documento_fields.html.erb
<div class="col-xs-4 col-sm-4 col-md-4">
<div class="panel panel-default ">
<div class="panel-heading">
<h3 class="panel-title pull-left" title="<%= f.object.explicacion %>">
<%= f.object.descripcion %>
</h3>
<% if f.object.obligatorio %>
<span class="pull-right" >
<%= icon('exclamation-triangle', id: '', class: 'fa text-danger', :title=>"Este documento es obligatorio.") %>
</span>
<% end %>
<div class="clearfix"></div>
<% if f.object.id.nil? %>
<%= f.input :descripcion %>
<%= f.input :obligatorio %>
<%= f.input :explicacion %>
<% else %>
<%= f.input :descripcion, as: :hidden %>
<% end %>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-3 col-md-3">
<% if f.object.archivo %>
<% has_file = f.object.archivo.url != "/system/resources/missing_32.png" %>
<% if has_file %>
<%= link_to f.object.archivo.url, :target => "_blank" do %>
<%= icono(f.object) %>
<% end %>
<% else %>
<%= icon('file-o', id: '', class: 'fa-3x') %>
<% end %>
<% end %>
</div>
<div class="col-sm-9 col-md-9">
<%=number_to_human_size f.object.archivo.size %>
<p id="file_label_<%= f.object.id.to_s %>"></p>
<% if f.object.id.nil? %>
<%= f.input :archivo, as: :file, label: false, input_html: { id: "hidden_file_input_" + f.object.id.to_s } %>
<% else %>
<%= f.input :archivo, as: :file, label: false, input_html: { class: 'hidden', id: "hidden_file_input_" + f.object.id.to_s } %>
<a class="upload-file btn btn-default" data-file-id="<%= f.object.id.to_s %>"><i class="fa fa-upload"></i> Cargar archivo</a>
<% end %>
</div>
</div>
</div>
<div class="panel-footer normas-internas">
<%= link_to_remove_association f, class: 'btn btn-danger checkForDelete' do %>
<i class="fa fa-trash"></i> Marcar para eliminar
<% end %>
</div>
</div>
</div>