improves admin image partial

This commit is contained in:
decabeza
2017-12-15 17:52:23 +01:00
parent 8ef4ba94bd
commit 67df3947bf
2 changed files with 8 additions and 6 deletions

View File

@@ -32,7 +32,9 @@
</div>
<div class="row">
<%= render 'images/admin_image', imageable: @poll, f: f %>
<div class="small-12 column">
<%= render 'images/admin_image', imageable: @poll, f: f %>
</div>
</div>
<div class="row">

View File

@@ -1,7 +1,7 @@
<div class="images small-12 column">
<div class="images">
<div>
<%= f.label :image, t("images.form.admin_title") %>
<%= link_to_add_association t('images.form.add_new_image'), f, :image,
force_non_association_create: true,
partial: "images/image_fields",
@@ -14,12 +14,12 @@
association_insertion_node: "#nested-image",
association_insertion_method: "append"
} %>
<%= render_image(f.object.image, :thumb, false) if f.object.image %>
<div id="nested-image">
<%= f.fields_for :image do |image_builder| %>
<div id="<%= dom_id(image_builder.object) %>" class="image direct-upload nested-fields">
<%= image_builder.hidden_field :id %>
<%= image_builder.hidden_field :user_id, value: current_user.id %>
@@ -33,7 +33,7 @@
</div>
</div>
</div>
<% end %>
</div>
</div>