Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

Update Bootstrap to version 4 #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/views/spree/addresses/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= t(:edit_shipping_address, scope: :address_book) %></h3>
<div class="col-lg-6 offset-lg-3">
<div class="card mb-3">
<div class="card-header">
<h3 class="card-title mb-0 h5"><%= t(:edit_shipping_address, scope: :address_book) %></h3>
</div>
<div class="panel-body">
<div class="card-body">
<%= render 'spree/shared/error_messages', target: @address %>
<%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
<fieldset>
Expand Down
10 changes: 5 additions & 5 deletions app/views/spree/addresses/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= t(:new_shipping_address, scope: :address_book) %></h3>
<div class="col-lg-6 offset-lg-3">
<div class="card mb-3">
<div class="card-header">
<h3 class="card-title h5 mb-0"><%= t(:new_shipping_address, scope: :address_book) %></h3>
</div>
<div class="panel-body">
<div class="card-body">
<%= render 'spree/shared/error_messages', target: @address %>
<%= form_for @address, html: { id: 'checkout_form_address' } do |f| %>
<fieldset>
Expand Down
33 changes: 21 additions & 12 deletions app/views/spree/checkout/_address.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<% ['billing', 'shipping'].each do |address_type|
next if address_type == 'billing' && Spree::AddressBook::Config[:disable_bill_address]
address_name = "#{address_type[0...4]}_address" %>
<div class="col-sm-6" data-hook="<%= address_type %>_fieldset_wrapper">
<div class="panel panel-default" id="<%= address_type %>" data-hook>
<div class="panel-heading">
<h3 class="panel-title"><%= Spree.t(address_type + "_address") %></h3>
<div class="col-lg-6" data-hook="<%= address_type %>_fieldset_wrapper">
<div class="card mb-4" id="<%= address_type %>" data-hook>
<div class="card-header">
<h3 class="card-title mb-0 h5"><%= Spree.t(address_type + "_address") %></h3>
</div>
<div class="panel-body">
<div class="card-body">
<% if address_type == 'shipping' && !Spree::AddressBook::Config[:disable_bill_address] %>
<p class="field checkbox" data-hook="use_billing">
<p class="mb-0 form-check" data-hook="use_billing">
<%= label_tag :order_use_billing, :id => 'use_billing' do %>
<%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address? %>
<%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address?, { class: 'form-check-input'} %>
<%= Spree.t(:use_billing_address) %>
<% end %>
</p>
Expand All @@ -22,11 +22,18 @@
<div class="select_address">
<p class="form-group">
<% @addresses.each_with_index do |address, idx| %>
<span id="<%= [address_type, dom_id(address)].join('_') %>">
<label><%= form.radio_button "#{address_name}_id", address.id, :checked => (address.id == spree_current_user["#{address_name}_id"] || idx == 0) %> <%= address.to_s.html_safe %></label> <a href="<%= edit_address_path(address) %>" data-hook="edit_address"><%= Spree.t(:edit) %></a><br />
<span class="d-block mb-2" id="<%= [address_type, dom_id(address)].join('_') %>">
<label class="form-check-label">
<%= form.radio_button "#{address_name}_id", address.id, :checked => (address.id == spree_current_user["#{address_name}_id"] || idx == 0) %> <%= address.to_s.html_safe %>
</label>
<a class="mb-3" href="<%= edit_address_path(address) %>" data-hook="edit_address"><%= Spree.t(:edit) %></a>
</span>
<% end %>
<label><%= form.radio_button "#{address_name}_id", 0 %> <%= t('other_address', :scope => :address_book) %></label>
<div class="form-check">
<label class="form-check-label">
<%= form.radio_button "#{address_name}_id", 0, :class => 'form-check-input' %> <%= t('other_address', :scope => :address_book) %>
</label>
</div>
</p>
</div>
<% end %>
Expand All @@ -46,6 +53,8 @@
<% end %>
</div>

<div class="well text-right form-buttons" data-hook="buttons">
<%= submit_tag Spree.t(:save_and_continue), :class => 'btn btn-lg btn-success' %>
<div class="card text-right form-buttons mb-4" data-hook="buttons">
<div class="card-body">
<%= submit_tag Spree.t(:save_and_continue), :class => 'btn btn-lg btn-success' %>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/spree/users/_addresses.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
<%= t(:no_shipping_addresses_on_file, scope: :address_book) %>
</div>
<% end %>
<div id='new_address_link'>
<div id='new_address_link' class="mb-3">
<%= link_to t(:add_new_shipping_address, scope: :address_book), controller: :addresses, action: :new %>
</div>