Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix centering on side-by-side images.

Matthew Kennedy472e6a6a26ed
diff --git a/backend/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb b/backend/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb
index 5a80118c94..db95d5b3c6 100644
--- a/backend/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb
@@ -1,23 +1,25 @@
<div class="row pb-0">
<div class="col-12 col-md-6 mb-3">
<div class="card p-3">
- <h4 class="text-center pb-2"><%= Spree.t('admin.cms.side_by_side.left_image') %></h4>
- <%= f.field_container :image_one, class: ['form-group'] do %>
- <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
- </figure>
- <% elsif @cms_section.image_one.attached? && @cms_section.image_one.image? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_one) %>
- </figure>
+ <div class="text-center">
+ <h4 class="pb-2"><%= Spree.t('admin.cms.side_by_side.left_image') %></h4>
+ <%= f.field_container :image_one, class: ['form-group'] do %>
+ <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
+ <figure class="admin-img-holder">
+ <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
+ </figure>
+ <% elsif @cms_section.image_one.attached? && @cms_section.image_one.image? %>
+ <figure class="admin-img-holder">
+ <%= image_tag main_app.url_for(@cms_section.image_one) %>
+ </figure>
+ <% end %>
+ <%= f.field_container :image_one, class: ['form-group mb-0'] do %>
+ <%= f.file_field :image_one %>
+ <%= f.error_message_on :image_one %>
+ <% end %>
+ <small class="text-muted"><%= Spree.t('admin.cms.side_by_side.image_info') %></small>
<% end %>
- <%= f.field_container :image_one, class: ['form-group mb-0'] do %>
- <%= f.file_field :image_one %>
- <%= f.error_message_on :image_one %>
- <% end %>
- <small class="text-muted"><%= Spree.t('admin.cms.side_by_side.image_info') %></small>
- <% end %>
+ </div>
<%= f.field_container :title_one, class: ['form-group'] do %>
<%= f.label :title_one, Spree.t('admin.cms.title') %>
@@ -49,23 +51,25 @@
<div class="col-12 col-md-6 mb-3">
<div class="card p-3">
- <h4 class="text-center pb-2"><%= Spree.t('admin.cms.side_by_side.right_image') %></h4>
- <%= f.field_container :image_two, class: ['form-group'] do %>
- <% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_two.variant(resize: '244x104>')) %>
- </figure>
- <% elsif @cms_section.image_two.attached? && @cms_section.image_two.image? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_two) %>
- </figure>
+ <div class="text-center">
+ <h4 class="pb-2"><%= Spree.t('admin.cms.side_by_side.right_image') %></h4>
+ <%= f.field_container :image_two, class: ['form-group'] do %>
+ <% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
+ <figure class="admin-img-holder">
+ <%= image_tag main_app.url_for(@cms_section.image_two.variant(resize: '244x104>')) %>
+ </figure>
+ <% elsif @cms_section.image_two.attached? && @cms_section.image_two.image? %>
+ <figure class="admin-img-holder">
+ <%= image_tag main_app.url_for(@cms_section.image_two) %>
+ </figure>
+ <% end %>
+ <%= f.field_container :image_two, class: ['form-group mb-0'] do %>
+ <%= f.file_field :image_two %>
+ <%= f.error_message_on :image_two %>
+ <% end %>
+ <small class="text-muted"><%= Spree.t('admin.cms.side_by_side.image_info') %></small>
<% end %>
- <%= f.field_container :image_two, class: ['form-group mb-0'] do %>
- <%= f.file_field :image_two %>
- <%= f.error_message_on :image_two %>
- <% end %>
- <small class="text-muted"><%= Spree.t('admin.cms.side_by_side.image_info') %></small>
- <% end %>
+ </div>
<%= f.field_container :title_two, class: ['form-group'] do %>
<%= f.label :title_two, Spree.t('admin.cms.title') %>