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

Add tooltips to admin calculators #3382

Merged
merged 1 commit into from
Nov 13, 2019
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
1 change: 1 addition & 0 deletions backend/app/views/spree/admin/promotions/_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<% if can?(:update, @promotion) %>
<div class="field">
<%= label_tag :action_type, t('spree.adjustment_type')%>
<%= admin_hint t('spree.adjustment_type'), t(:promotions, scope: [:spree, :hints, "spree/calculator"]) %>
<%= select_tag 'action_type', options, include_blank: t(:choose_promotion_action, scope: 'spree'), class: 'custom-select fullwidth' %>
</div>
<div class="filter-actions actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<div id="preference-settings">
<div class="field">
<%= f.label(:calculator_type, Spree::Calculator.model_name.human) %>

<% if local_assigns.has_key? :hint %>
<%= admin_hint t("spree.#{hint}"), t(hint, scope: [:spree, :hints, "spree/calculator"]) %>
<% end %>

<%= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {class: 'custom-select fullwidth js-calculator-type'}) %>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</div>
<div class="col-5">
<div data-hook="admin_shipping_method_form_calculator_fields">
<%= render partial: 'spree/admin/shared/calculator_fields', locals: { f: f } %>
<%= render partial: 'spree/admin/shared/calculator_fields', locals: { f: f, hint: :shipping_methods } %>
</div>
<div>
<fieldset class="tax_categories no-border-bottom">
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/tax_rates/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@

<div class="clear"></div>

<%= render 'spree/admin/shared/calculator_fields', f: f %>
<%= render partial: 'spree/admin/shared/calculator_fields', locals: { f: f, hint: :tax_rates } %>
</div>
8 changes: 8 additions & 0 deletions core/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,14 @@ en:
hidden: hidden
hide_out_of_stock: Hide out of stock
hints:
spree/calculator:
tax_rates: This is used to calculate both sales tax (United States-style taxes)
and value-added tax (VAT). Typically this calculator should be the only tax
calculator required by your store.
shipping_methods: This is used to calculate the shipping rates on a per order or
per package rate.
promotions: This is used to determine the promotional discount to be applied to an
order, an item, or shipping charges.
spree/price:
country: 'This determines in what country the price is valid.<br/>Default:
Any Country'
Expand Down