Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade bootstrap to 4.0.0 #2516

Merged
merged 6 commits into from
Feb 1, 2018
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
<div class="row">
<div class="col-6">
<div class="input-group">
<span class="input-group-addon">$</span>
<div class="input-group-prepend">
<span class="input-group-text">$</span>
</div>
<input class="js-base-input form-control" type="text" value={{baseField.value}}>
</div>
</div>
<div class="col-6">
<div class="input-group">
<span class="input-group-addon">$</span>
<div class="input-group-prepend">
<span class="input-group-text">$</span>
</div>
<input class="js-value-input form-control"
name="{{valueField.name}}" type="text" value={{valueField.value}}>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
<div class="row">
<div class="col-6">
<div class="input-group">
<span class="input-group-addon">$</span>
<div class="input-group-prepend">
<span class="input-group-text">$</span>
</div>
<input class="js-base-input form-control" type="text" value={{baseField.value}}>
</div>
</div>
<div class="col-6">
<div class="input-group">
<input class="js-value-input form-control right-align"
name="{{valueField.name}}" type="text" value={{valueField.value}}>
<span class="input-group-addon">%</span>
<div class="input-group-append">
<span class="input-group-text">%</span>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.number-with-currency {
$currency-width: 5.5rem;

&-symbol {
min-width: 2.5em;

/* bootstrap makes this a flexbox item */
justify-content: space-around;
}

&-amount {
Expand All @@ -9,7 +14,7 @@
}

&-addon {
min-width: 3.5rem;
width: $currency-width;
text-align: left;
}

Expand All @@ -26,7 +31,7 @@
@extend .custom-select;

cursor: pointer;
width: 5.5rem;
width: $currency-width;

@include border-radius($border-radius);
@include border-left-radius(0);
Expand Down
8 changes: 5 additions & 3 deletions backend/app/views/spree/admin/orders/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
<div class="date-range-fields input-group">
<%= f.text_field :created_at_gt, class: 'datepicker form-control datepicker-from', value: params[:q][:created_at_gt], placeholder: t('spree.start') %>

<span class="range-divider input-group-addon">
<i class="fa fa-arrow-right"></i>
</span>
<div class="input-group-prepend input-group-append">
<span class="input-group-text range-divider">
<i class="fa fa-arrow-right"></i>
</span>
</div>

<%= f.text_field :created_at_lt, class: 'datepicker form-control datepicker-to', value: params[:q][:created_at_lt], placeholder: t('spree.stop') %>
</div>
Expand Down
16 changes: 9 additions & 7 deletions backend/app/views/spree/admin/payments/_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
</td>
<td class="amount align-right">
<div class="editing-show">
<div class="input-group">
<div class="input-group-addon number-with-currency-symbol">
<%= ::Money::Currency.find(@order.currency).symbol %>
</div>
<form class="editing-show">
<form class="editing-show">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text number-with-currency-symbol">
<%= ::Money::Currency.find(@order.currency).symbol %>
</span>
</div>
<%= text_field_tag :amount, payment.amount, class: 'js-edit-amount align-right form-control' %>
</form>
</div>
</div>
</form>
</div>
<span class="js-display-amount editing-hide"><%= payment.display_amount.to_html %></span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
<% required ||= nil %>

<div class="input-group number-with-currency <%= "number-with-currency-with-select" unless currency %> js-number-with-currency">
<div class="input-group-addon number-with-currency-symbol"></div>
<div class="input-group-prepend">
<span class="input-group-text number-with-currency-symbol"></span>
</div>
<%= f.text_field amount_attr, value: number_to_currency(f.object.public_send(amount_attr), unit: '', delimiter: ''), class: 'form-control number-with-currency-amount', required: required %>
<% if currency %>
<div class="input-group-addon number-with-currency-addon" data-currency="<%= currency %>">
<%= ::Money::Currency.find(currency).iso_code %>
<div class="input-group-append">
<span class="input-group-text number-with-currency-addon" data-currency="<%= currency %>">
<%= ::Money::Currency.find(currency).iso_code %>
</span>
</div>
<% else %>
<%= f.select currency_attr, Spree::Config.available_currencies.map(&:iso_code), {selected: Spree::Config.currency}, {required: required, class: 'number-with-currency-select'} %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
<div class="date-range-fields input-group">
<%= s.text_field :completed_at_gt, class: 'datepicker datepicker-from form-control', value: datepicker_field_value(params[:q][:completed_at_gt]), placeholder: t('spree.start') %>

<span class="range-divider input-group-addon">
<i class="fa fa-arrow-right"></i>
</span>
<div class="input-group-prepend input-group-append">
<span class="input-group-text range-divider">
<i class="fa fa-arrow-right"></i>
</span>
</div>

<%= s.text_field :completed_at_lt, class: 'datepicker datepicker-to form-control', value: datepicker_field_value(params[:q][:completed_at_lt]), placeholder: t('spree.end') %>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
<label for="q_created_at_gt">Date Range</label>
<div class="input-group date-range-fields">
<input class="form-control datepicker datepicker-from" placeholder="From">
<span class="range-divider input-group-addon">
<i class="fa fa-arrow-right"></i>
</span>
<div class="input-group-prepend input-group-append">
<span class="input-group-text range-divider">
<i class="fa fa-arrow-right"></i>
</span>
</div>
<input class="form-control datepicker datepicker-to" placeholder="To">
</div>
</div>
Expand Down
8 changes: 5 additions & 3 deletions backend/app/views/spree/admin/tax_rates/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
<div class="date-range-fields input-group">
<%= f.text_field :starts_at, class: 'datepicker form-control datepicker-from', value: datepicker_field_value(f.object.starts_at), placeholder: Spree::TaxRate.human_attribute_name(:starts_at) %>

<span class="range-divider input-group-addon">
<i class="fa fa-arrow-right"></i>
</span>
<div class="input-group-prepend input-group-append">
<span class="input-group-text range-divider">
<i class="fa fa-arrow-right"></i>
</span>
</div>

<%= f.text_field :expires_at, class: 'datepicker form-control datepicker-to', value: datepicker_field_value(f.object.expires_at), placeholder: Spree::TaxRate.human_attribute_name(:expires_at) %>
</div>
Expand Down
6 changes: 5 additions & 1 deletion backend/app/views/spree/admin/taxons/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
<%= label_tag :permalink_part, Spree::Taxon.human_attribute_name(:permalink), class: 'required' %><br />
<div class="input-group">
<% if @taxon.parent %>
<span class="input-group-addon"><%= @taxon.permalink.split('/')[0...-1].join('/') + '/' %></span>
<div class="input-group-prepend">
<span class="input-group-text">
<%= @taxon.permalink.split('/')[0...-1].join('/') + '/' %>
</span>
</div>
<% end %>
<%= text_field_tag :permalink_part, @permalink_part, class: 'fullwidth form-control' %><br />
</div>
Expand Down
8 changes: 5 additions & 3 deletions backend/app/views/spree/admin/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
<%= f.text_field :created_at_gt, class: 'datepicker form-control datepicker-from',
value: params[:q].try!("[]", :created_at_gt), placeholder: t('spree.start') %>

<span class="range-divider input-group-addon">
<i class="fa fa-arrow-right"></i>
</span>
<div class="input-group-prepend input-group-append">
<span class="input-group-text range-divider">
<i class="fa fa-arrow-right"></i>
</span>
</div>

<%= f.text_field :created_at_lt, class: 'datepicker form-control datepicker-to',
value: params[:q].try!("[]", :created_at_lt), placeholder: t('spree.stop') %>
Expand Down
Loading