This commit is contained in:
San Wai Lwin
2018-03-13 14:46:07 +06:30
parent 9ec8c4d18c
commit 694feb9c06
9 changed files with 151 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<div class="card">
<div class="body">
<%= simple_form_for([:settings,@settings_shop]) do |f| %>
<%= simple_form_for([:settings,@settings_shop], :html => { :multipart => true }) do |f| %>
<%= f.error_notification %>
<div class="form-group p-l-15">
<%= f.input :name ,:input_html=>{:class=>"col-md-10"},:required=>true%>
@@ -25,7 +25,7 @@
<%= f.input :show_account_info %>
</div>
<label>Shop Image</label>
<label>Shop Logo</label>
<div class="panel padding-10">
<div class="form-group">
<div class="menu-item-img">
@@ -40,6 +40,31 @@
</div>
</div>
<label>Shop Images</label>
<div class="panel padding-10">
<div class="form-group">
<div class="menu-item-img">
<%= f.fields_for :display_images do |p| %>
<div class="field">
<%= p.label :image %><br>
<%= image_tag p.object.image, :class => "img-thumbnail" %>
<%= p.file_field :image, :multiple => true, name: "display_images[image][]" %>
<%= link_to "Destroy", settings_shop_display_image_path(p.object), method: :delete %>
</div>
<% end %>
</div>
</div>
</div>
<!-- <%= f.fields_for :display_images do |p| %>
<div class="field">
<%= p.label :image %><br>
<%= p.file_field :image, :multiple => true, name: "display_images[image][]" %>
</div>
<% end %> -->
<div class="form-actions p-l-15">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>

View File

@@ -99,6 +99,14 @@
<td style="width:20%">Shop Image</td>
<td><%= image_tag @settings_shop.logo, :size => '200x200'%></td>
</tr>
<tr>
<td style="width:20%">Shop Images</td>
<td>
<% @display_images.each do |p| %>
<%= image_tag p.image , :size => '200x200'%><br>
<% end %>
</td>
</tr>
<tr>
<td><%= link_to t("views.btn.edit"), edit_settings_shop_path(@settings_shop),:class => 'btn btn-primary btn-sm waves-effect' %>
</td>