universal_table/app/views/admin/universal_tables/_image_field.html.erb

31 lines
1.2 KiB
Plaintext
Raw Normal View History

2015-11-13 13:10:00 +00:00
<div class="control-group">
<%= f.label :image, column.title, :class => "control-label" %>
<div class="controls">
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if image_field.image.file %>" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left">
<% if image_field.image.file %>
<%= image_tag image_field.image %>
<% else %>
<img src="http://www.placehold.it/50x50/EFEFEF/AAAAAA" />
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<span class="fileupload-new"><%= t(:select_image) %></span>
<span class="fileupload-exists"><%= t(:change) %></span>
<%= f.file_field :image %>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn btn-danger fileupload-remove">
<%= f.check_box :remove_image %><%= t(:remove) %>
</label>
</div>
</div>
</div>
<% if !image_field.new_record? %>
<%= f.hidden_field :id %>
<% else %>
<%= f.hidden_field :table_column_id, :value => column.id %>
<% end %>
</div>