solidus_backend 2.2.2 → 2.3.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend.js +1 -2
- data/app/assets/javascripts/spree/backend/address_states.js +1 -1
- data/app/assets/javascripts/spree/backend/adjustments.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/admin.js +37 -41
- data/app/assets/javascripts/spree/backend/components/editable_table.js.coffee +3 -0
- data/app/assets/javascripts/spree/backend/images/index.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/images/upload.js +13 -189
- data/app/assets/javascripts/spree/backend/models/image_upload.js +76 -0
- data/app/assets/javascripts/spree/backend/models/index.js +2 -0
- data/app/assets/javascripts/spree/backend/models/taxonomy.js +3 -0
- data/app/assets/javascripts/spree/backend/namespaces.js +3 -1
- data/app/assets/javascripts/spree/backend/payments/new.js +8 -36
- data/app/assets/javascripts/spree/backend/promotions.js.coffee +1 -1
- data/app/assets/javascripts/spree/backend/select_payments.js.coffee +0 -12
- data/app/assets/javascripts/spree/backend/shipments.js +1 -1
- data/app/assets/javascripts/spree/backend/spree-select2.js +1 -1
- data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +101 -95
- data/app/assets/javascripts/spree/backend/templates/products/upload_progress.hbs +5 -3
- data/app/assets/javascripts/spree/backend/views/images/upload_progress.js +48 -0
- data/app/assets/javascripts/spree/backend/views/images/upload_zone.js +39 -0
- data/app/assets/javascripts/spree/backend/views/index.js +6 -0
- data/app/assets/javascripts/spree/backend/views/order/address.js +1 -5
- data/app/assets/javascripts/spree/backend/views/payment/edit_credit_card.js +23 -0
- data/app/assets/javascripts/spree/backend/views/payment/new.js +25 -0
- data/app/assets/javascripts/spree/backend/views/state_select.js +4 -4
- data/app/assets/javascripts/spree/backend/views/tables/editable_table.js.coffee +14 -0
- data/app/assets/javascripts/spree/backend/views/tables/editable_table_row.js.coffee +45 -0
- data/app/assets/stylesheets/spree/backend/components/_date-picker.scss +0 -1
- data/app/assets/stylesheets/spree/backend/components/_editable_table.scss +37 -0
- data/app/assets/stylesheets/spree/backend/plugins/_bootstrap_tooltip.scss +2 -2
- data/app/assets/stylesheets/spree/backend/sections/_products.scss +0 -8
- data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +15 -9
- data/app/assets/stylesheets/spree/backend/shared/_icons.scss +14 -14
- data/app/assets/stylesheets/spree/backend/shared/_tables.scss +1 -2
- data/app/assets/stylesheets/spree/backend/shared/_utilities.scss +13 -0
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +1 -1
- data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
- data/app/controllers/spree/admin/orders_controller.rb +3 -10
- data/app/controllers/spree/admin/payment_methods_controller.rb +19 -6
- data/app/controllers/spree/admin/payments_controller.rb +2 -2
- data/app/controllers/spree/admin/products_controller.rb +3 -9
- data/app/controllers/spree/admin/promotion_rules_controller.rb +5 -1
- data/app/controllers/spree/admin/promotions_controller.rb +1 -1
- data/app/controllers/spree/admin/properties_controller.rb +1 -1
- data/app/controllers/spree/admin/reports_controller.rb +24 -21
- data/app/controllers/spree/admin/resource_controller.rb +25 -14
- data/app/controllers/spree/admin/style_guide_controller.rb +4 -0
- data/app/controllers/spree/admin/users_controller.rb +1 -1
- data/app/controllers/spree/admin/variants_controller.rb +5 -0
- data/app/helpers/spree/admin/navigation_helper.rb +6 -2
- data/app/helpers/spree/promotion_rules_helper.rb +2 -2
- data/app/models/spree/backend_configuration.rb +1 -0
- data/app/views/spree/admin/adjustments/_form.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
- data/app/views/spree/admin/images/_form.html.erb +1 -1
- data/app/views/spree/admin/images/_image_row.html.erb +22 -4
- data/app/views/spree/admin/images/create.js.erb +8 -5
- data/app/views/spree/admin/images/index.html.erb +4 -8
- data/app/views/spree/admin/orders/_risk_analysis.html.erb +6 -7
- data/app/views/spree/admin/orders/_shipment.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm/_customer_details.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +3 -3
- data/app/views/spree/admin/payment_methods/_form.html.erb +5 -5
- data/app/views/spree/admin/payments/_form.html.erb +2 -2
- data/app/views/spree/admin/payments/_list.html.erb +1 -1
- data/app/views/spree/admin/payments/show.html.erb +1 -1
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +2 -7
- data/app/views/spree/admin/prices/_form.html.erb +2 -2
- data/app/views/spree/admin/prices/edit.html.erb +2 -0
- data/app/views/spree/admin/prices/index.html.erb +5 -4
- data/app/views/spree/admin/prices/new.html.erb +4 -0
- data/app/views/spree/admin/product_properties/index.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +4 -3
- data/app/views/spree/admin/products/index.html.erb +3 -3
- data/app/views/spree/admin/products/new.html.erb +2 -2
- data/app/views/spree/admin/products/new.js.erb +0 -3
- data/app/views/spree/admin/promotion_actions/create.js.erb +2 -6
- data/app/views/spree/admin/promotion_rules/create.js.erb +0 -8
- data/app/views/spree/admin/promotions/_actions.html.erb +2 -2
- data/app/views/spree/admin/promotions/_form.html.erb +1 -1
- data/app/views/spree/admin/promotions/_promotion_action.html.erb +3 -4
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +3 -3
- data/app/views/spree/admin/promotions/_rules.html.erb +1 -1
- data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +6 -2
- data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +1 -1
- data/app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb +54 -0
- data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +33 -14
- data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +33 -14
- data/app/views/spree/admin/promotions/index.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_item_total.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_product.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_taxon.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_user_role.html.erb +2 -2
- data/app/views/spree/admin/refunds/edit.html.erb +1 -1
- data/app/views/spree/admin/refunds/new.html.erb +1 -1
- data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
- data/app/views/spree/admin/reports/sales_total.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +4 -4
- data/app/views/spree/admin/shared/_address_form.html.erb +2 -2
- data/app/views/spree/admin/shared/_calculator_fields.html.erb +1 -1
- data/app/views/spree/admin/shared/_product_tabs.html.erb +4 -4
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +1 -1
- data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/states/index.html.erb +1 -1
- data/app/views/spree/admin/stock_items/_stock_management.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/edit.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/index.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
- data/app/views/spree/admin/store_credits/_form.html.erb +1 -1
- data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +1 -1
- data/app/views/spree/admin/stores/_form.html.erb +1 -1
- data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +4 -8
- data/app/views/spree/admin/style_guide/topics/forms/_buttons.html.erb +6 -0
- data/app/views/spree/admin/style_guide/topics/forms/_helper_text.html.erb +13 -0
- data/app/views/spree/admin/style_guide/topics/forms/_inputs.html.erb +96 -0
- data/app/views/spree/admin/style_guide/topics/forms/_labels.html.erb +6 -0
- data/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb +8 -1
- data/app/views/spree/admin/style_guide/topics/layout/_full_width_table_layout.html.erb +10 -0
- data/app/views/spree/admin/style_guide/topics/layout/_helpful_layout.html.erb +0 -0
- data/app/views/spree/admin/style_guide/topics/layout/_sidebar_layout.html.erb +4 -0
- data/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb +10 -4
- data/app/views/spree/admin/style_guide/topics/messaging/_tooltips.html.erb +45 -0
- data/app/views/spree/admin/style_guide/topics/tables/_forms_in_tables.html.erb +4 -0
- data/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/_form.html.erb +17 -3
- data/app/views/spree/admin/tax_rates/index.html.erb +12 -3
- data/app/views/spree/admin/taxonomies/edit.erb +1 -8
- data/app/views/spree/admin/taxons/_form.html.erb +6 -4
- data/app/views/spree/admin/taxons/edit.html.erb +0 -15
- data/app/views/spree/admin/taxons/index.html.erb +1 -1
- data/app/views/spree/admin/variants/_form.html.erb +8 -9
- data/app/views/spree/admin/variants/new.js.erb +0 -1
- data/config/routes.rb +1 -1
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/orders_controller_spec.rb +16 -4
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/payments_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/products_controller_spec.rb +33 -0
- data/spec/controllers/spree/admin/variants_controller_spec.rb +39 -13
- data/spec/features/admin/configuration/payment_methods_spec.rb +11 -11
- data/spec/features/admin/configuration/shipping_methods_spec.rb +1 -1
- data/spec/features/admin/configuration/states_spec.rb +4 -4
- data/spec/features/admin/configuration/store_spec.rb +3 -3
- data/spec/features/admin/configuration/tax_rates_spec.rb +1 -1
- data/spec/features/admin/orders/adjustments_spec.rb +1 -1
- data/spec/features/admin/orders/customer_details_spec.rb +10 -11
- data/spec/features/admin/orders/listing_spec.rb +1 -1
- data/spec/features/admin/orders/new_order_spec.rb +4 -11
- data/spec/features/admin/orders/order_details_spec.rb +20 -30
- data/spec/features/admin/orders/return_payment_state_spec.rb +60 -0
- data/spec/features/admin/orders/shipments_spec.rb +7 -0
- data/spec/features/admin/products/edit/images_spec.rb +48 -9
- data/spec/features/admin/products/edit/variants_spec.rb +1 -1
- data/spec/features/admin/products/option_types_spec.rb +2 -2
- data/spec/features/admin/products/products_spec.rb +49 -3
- data/spec/features/admin/products/stock_management_spec.rb +1 -3
- data/spec/features/admin/products/variant_spec.rb +20 -0
- data/spec/features/admin/promotion_adjustments_spec.rb +35 -34
- data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -2
- data/spec/features/admin/promotions/product_rule_spec.rb +1 -1
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +2 -2
- data/spec/features/admin/promotions/user_rule_spec.rb +2 -2
- data/spec/features/admin/stock_transfer_spec.rb +11 -8
- data/spec/helpers/admin/navigation_helper_spec.rb +23 -0
- metadata +26 -18
- data/app/assets/javascripts/spree/backend/images/new.js.coffee +0 -7
- data/app/assets/stylesheets/spree/backend/sections/_payments.scss +0 -14
- data/app/helpers/spree/admin/images_helper.rb +0 -17
- data/app/views/spree/admin/orders/_add_line_item.html.erb +0 -15
- data/app/views/spree/admin/prices/new.js.erb +0 -2
- data/app/views/spree/admin/products/_properties_form.erb +0 -10
- data/app/views/spree/admin/promotions/_tab.html.erb +0 -1
- data/app/views/spree/admin/shared/_report_criteria.html.erb +0 -17
- data/app/views/spree/admin/states/_new.html.erb +0 -7
- data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +0 -38
- data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +0 -27
- data/app/views/spree/admin/taxons/_taxon_table.html.erb +0 -23
@@ -69,7 +69,7 @@
|
|
69
69
|
<% if display_add_row %>
|
70
70
|
<tr class="js-add-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>">
|
71
71
|
<td class='location-name-cell'>
|
72
|
-
<%= select_tag :stock_location_id, options_from_collection_for_select(locations_without_items, :id, :name), { include_blank: true, class: '
|
72
|
+
<%= select_tag :stock_location_id, options_from_collection_for_select(locations_without_items, :id, :name), { include_blank: true, class: 'custom-select', "data-placeholder" => Spree.t(:add_to_stock_location), id: "variant-stock-location-#{variant.id}" } %>
|
73
73
|
</td>
|
74
74
|
<td class="align-center">
|
75
75
|
<%= check_box_tag :backorderable, 'backorderable', false, id: "variant-backorderable-#{variant.id}" %>
|
@@ -114,7 +114,7 @@
|
|
114
114
|
<% content_for :head do %>
|
115
115
|
<%= javascript_tag do -%>
|
116
116
|
$(document).ready(function(){
|
117
|
-
$('span#country .select2').on('change', function() { update_state(''); });
|
117
|
+
$('span#country select.select2').on('change', function() { update_state(''); });
|
118
118
|
});
|
119
119
|
<% end -%>
|
120
120
|
<% end %>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<% end %>
|
29
29
|
<%= f.field_container :destination_location do %>
|
30
30
|
<%= f.label :destination_location_id %>
|
31
|
-
<%= f.select :destination_location_id, options_from_collection_for_select(@destination_stock_locations, :id, :name, @stock_transfer.destination_location_id), {include_blank: true}, {class: '
|
31
|
+
<%= f.select :destination_location_id, options_from_collection_for_select(@destination_stock_locations, :id, :name, @stock_transfer.destination_location_id), {include_blank: true}, {class: 'custom-select fullwidth', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
|
32
32
|
<%= f.error_message_on :destination_location %>
|
33
33
|
<% end %>
|
34
34
|
<div class="filter-actions actions" data-hook="buttons">
|
@@ -21,7 +21,7 @@
|
|
21
21
|
<div class="field-block col-3">
|
22
22
|
<div class="field">
|
23
23
|
<%= f.label nil, Spree::StockLocation.model_name.human %>
|
24
|
-
<%= f.select :source_location_id_or_destination_location_id_eq, options_from_collection_for_select(@stock_locations, :id, :name, params[:q][:source_location_id_or_destination_location_id_eq]), {include_blank: true}, {class: '
|
24
|
+
<%= f.select :source_location_id_or_destination_location_id_eq, options_from_collection_for_select(@stock_locations, :id, :name, params[:q][:source_location_id_or_destination_location_id_eq]), {include_blank: true}, {class: 'custom-select fullwidth'} %>
|
25
25
|
</div>
|
26
26
|
</div>
|
27
27
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<fieldset class="no-border-top">
|
11
11
|
<%= f.field_container :source_location do %>
|
12
12
|
<%= f.label :source_location_id %>
|
13
|
-
<%= f.select :source_location_id, options_from_collection_for_select(@source_stock_locations, :id, :name), {include_blank: true}, {class: '
|
13
|
+
<%= f.select :source_location_id, options_from_collection_for_select(@source_stock_locations, :id, :name), {include_blank: true}, {class: 'custom-select fullwidth', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
|
14
14
|
<%= f.error_message_on :source_location %>
|
15
15
|
<% end %>
|
16
16
|
<%= f.field_container :description do %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= f.field_container :category_id do %>
|
12
12
|
<%= f.label :category_id, class: 'required' %><br />
|
13
13
|
<%= f.select :category_id, options_from_collection_for_select(@credit_categories, :id, :name, f.object.category.try(:id)),
|
14
|
-
{ include_blank: true }, { class: '
|
14
|
+
{ include_blank: true }, { class: 'custom-select fullwidth', placeholder: Spree.t("admin.store_credits.select_reason") } %>
|
15
15
|
<%= f.error_message_on :category_id %>
|
16
16
|
<% end %>
|
17
17
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= f.field_container :reason do %>
|
3
3
|
<%= f.label :reason, Spree.t(:reason), class: 'required' %><br />
|
4
4
|
<%= select_tag :update_reason_id, options_from_collection_for_select(@update_reasons, :id, :name),
|
5
|
-
{ include_blank: true , class: '
|
5
|
+
{ include_blank: true , class: 'custom-select fullwidth', placeholder: Spree.t("admin.store_credits.select_amount_update_reason") } %>
|
6
6
|
<%= f.error_message_on :reason %>
|
7
7
|
<% end %>
|
8
8
|
</div>
|
@@ -46,6 +46,6 @@
|
|
46
46
|
<%= f.select :cart_tax_country_iso,
|
47
47
|
Spree::Country.all.map { |c| [c.name, c.iso] },
|
48
48
|
{ include_blank: t(".no_cart_tax_country") },
|
49
|
-
{ class: "
|
49
|
+
{ class: "custom-select fullwidth" } %>
|
50
50
|
<%= f.error_message_on :cart_tax_country_iso %>
|
51
51
|
<% end %>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
<p>This content is related to the current Solidus layout and it's forms, and does not apply to building pages with Bootstrap. The "Building Forms" section will be removed once all new Bootstrap layouts have been implemented in Solidus core.</p>
|
1
2
|
<%- snippet = capture do %>
|
2
3
|
<form id="table-filter">
|
3
4
|
<fieldset>
|
@@ -33,8 +34,9 @@
|
|
33
34
|
</div>
|
34
35
|
|
35
36
|
<div class="field">
|
36
|
-
<select class="
|
37
|
-
<option>
|
37
|
+
<select class="custom-select">
|
38
|
+
<option>Option A</option>
|
39
|
+
<option>Option B</option>
|
38
40
|
</select>
|
39
41
|
</div>
|
40
42
|
</div>
|
@@ -75,9 +77,3 @@
|
|
75
77
|
<div class="style-guide-code">
|
76
78
|
<pre><code class="language-html"><%= escape_once snippet %></code></pre>
|
77
79
|
</div>
|
78
|
-
|
79
|
-
<script>
|
80
|
-
$(function(){
|
81
|
-
$('.select2').select2();
|
82
|
-
});
|
83
|
-
</script>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<ul>
|
2
|
+
<li>Display form buttons at the bottom of the group, after the form inputs.</li>
|
3
|
+
<li>Primary action buttons and icons should be one style, secondary actions a second style, and destroy actions a third style.</li>
|
4
|
+
<li>Display search buttons and upload image buttons attached to the left side of the text field they accompany.</li>
|
5
|
+
<li>Allow users to submit a search form with the enter key when the cursor is inside of the search field.</li>
|
6
|
+
</ul>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<ul>
|
2
|
+
<li>Include a "i" icon and tooltip beside form labels with supplementary information.</li>
|
3
|
+
<li>Display input restrictions below form labels and above inputs (example: max 100 characters or specific formats).</li>
|
4
|
+
<li>Use helpful text like 'select a taxon' in dropdowns that don't have anything selected.</li>
|
5
|
+
<li>Don't display placeholder text inside text fields and boxes.</li>
|
6
|
+
<li>Display a progress/loading message or graphic if it takes a long time to submit a form.</li>
|
7
|
+
</ul>
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
@@ -0,0 +1,96 @@
|
|
1
|
+
<div class=half>
|
2
|
+
<h4>Grouping and layout</h4>
|
3
|
+
<ul>
|
4
|
+
<li>Group inputs associated with one function within a background container.</li>
|
5
|
+
<li>Layout inputs in a logical order. Try to group similar input types to make it easier to fill out.</li>
|
6
|
+
<li>Display form fields side by side only if they're reasonably related. Don't do it just to fill the space.</li>
|
7
|
+
<li>Display date range fields side by side (and shorter than other text field types).</li>
|
8
|
+
<li>Stack radio buttons and checkboxes. Use more space between them if they aren't a group of similar items.</li>
|
9
|
+
</ul>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="half">
|
13
|
+
<h4>Specific field types</h4>
|
14
|
+
<ul>
|
15
|
+
<li>Mark mandatory fields with an *.</li>
|
16
|
+
<li>Use radio buttons instead of dropdown lists for small finite lists and toggles.</li>
|
17
|
+
<li>Display a calendar icon in the right of date picker fields. When either the icon or the field is clicked, a calendar picker should appear.</li>
|
18
|
+
<li>Display a downwards pointing arrow in all dropdown lists, and Select2 dropdown fields.</li>
|
19
|
+
<li>Include a way for users to access a plain text version of their password in a password field.</li>
|
20
|
+
</ul>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<h4>Input widths</h4>
|
24
|
+
<p>Size a text field or a text box so that it's indicative of how much text goes inside of it.</p>
|
25
|
+
<table>
|
26
|
+
<tr>
|
27
|
+
<th>Input type</th>
|
28
|
+
<th>2/3 column<br>(main content area)</th>
|
29
|
+
<th>1/3 column<br>(secondary content area)</th>
|
30
|
+
<th>1/2 column<br>(main content, small screen)</th>
|
31
|
+
<th>1 column<br>(main & secondary content, small screen)
|
32
|
+
</tr>
|
33
|
+
<tr>
|
34
|
+
<td>text field - 'normal'</td>
|
35
|
+
<td>full, half, or quarter width</td>
|
36
|
+
<td>full or half width</td>
|
37
|
+
<td>full or half width</td>
|
38
|
+
<td>full width</td>
|
39
|
+
</tr>
|
40
|
+
<tr>
|
41
|
+
<td>text field - date picker</td>
|
42
|
+
<td>half width</td>
|
43
|
+
<td>full width</td>
|
44
|
+
<td>full width</td>
|
45
|
+
<td>full width</td>
|
46
|
+
</tr>
|
47
|
+
<tr>
|
48
|
+
<td>text field - multi selects </td>
|
49
|
+
<td>full width</td>
|
50
|
+
<td>full width</td>
|
51
|
+
<td>full width</td>
|
52
|
+
<td>full width</td>
|
53
|
+
</tr>
|
54
|
+
<tr>
|
55
|
+
<td>2 text fields - date range</td>
|
56
|
+
<td>full width</td>
|
57
|
+
<td>full width</td>
|
58
|
+
<td>full width</td>
|
59
|
+
<td>full width</td>
|
60
|
+
</tr>
|
61
|
+
<tr>
|
62
|
+
<td>text box</td>
|
63
|
+
<td>full width</td>
|
64
|
+
<td>full width</td>
|
65
|
+
<td>full width</td>
|
66
|
+
<td>full width</td>
|
67
|
+
</tr>
|
68
|
+
<tr>
|
69
|
+
<td>select box ('regular' and select2)</td>
|
70
|
+
<td>full, half, or quarter width</td>
|
71
|
+
<td>full or half width</td>
|
72
|
+
<td>full or half width</td>
|
73
|
+
<td>full width</td>
|
74
|
+
</tr>
|
75
|
+
<tr>
|
76
|
+
<td>checkbox - single</td>
|
77
|
+
<td>full width</td>
|
78
|
+
<td>full width</td>
|
79
|
+
<td>full width</td>
|
80
|
+
<td>full width</td>
|
81
|
+
</tr>
|
82
|
+
<tr>
|
83
|
+
<td>checkbox - list</td>
|
84
|
+
<td>full width</td>
|
85
|
+
<td>full width</td>
|
86
|
+
<td>full width</td>
|
87
|
+
<td>full width</td>
|
88
|
+
</tr>
|
89
|
+
<tr>
|
90
|
+
<td>radio button - list</td>
|
91
|
+
<td>full width</td>
|
92
|
+
<td>full width</td>
|
93
|
+
<td>full width</td>
|
94
|
+
<td>full width</td>
|
95
|
+
</tr>
|
96
|
+
</table>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<ul>
|
2
|
+
<li>Left align field labels and do not include colons.</li>
|
3
|
+
<li>Display field labels above text fields, text boxes and drop downs, and to the right of checkboxes and radio buttons.</li>
|
4
|
+
<li>Labels should be in sentence casing (first letter of the first word is uppercase, the rest are lowercase).</li>
|
5
|
+
<li>Do not add underlines to labels.</li>
|
6
|
+
</ul>
|
@@ -1,3 +1,10 @@
|
|
1
|
+
<ul>
|
2
|
+
<li>Validate mandatory fields client-side to make sure content is present.</li>
|
3
|
+
<li>Display field labels in red when there is an error in their respective field.</li>
|
4
|
+
<li>Outline inputs in red when there is an error inside.</li>
|
5
|
+
<li>Display validation text in red and below the input it is referring to. It should be closer to that input than anything else on the page.</li>
|
6
|
+
</ul>
|
7
|
+
|
1
8
|
<div class="errorExplanation">
|
2
9
|
<h2>2 errors prohibited this record from being saved:</h2>
|
3
10
|
<p>There were problems with the following fields:</p>
|
@@ -7,7 +14,7 @@
|
|
7
14
|
</ul>
|
8
15
|
</div>
|
9
16
|
|
10
|
-
<div class="field withError">
|
17
|
+
<div class="field withError half">
|
11
18
|
<span class="field_with_errors"><label for="user_name">Name</label></span>
|
12
19
|
<span class="field_with_errors"><input class="fullwidth" type="text" name="user[name]" id="user_name"></span>
|
13
20
|
<span class="formError">can't be blank</span>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<ul>
|
2
|
+
<li>This one has a main column on the left and secondary column on the right for information to describe what happens in each section of the form. I expect this one will be used more often than the other.</li>
|
3
|
+
<li>Use this for forms that would benefit from a little extra explanation of how to use the section.</li>
|
4
|
+
<li>Use this for forms that have minimal fields and have many equal priority items in them.</li>
|
5
|
+
<li>Try to use this form layout first before using the next one.</li>
|
6
|
+
</ul>
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
File without changes
|
@@ -5,9 +5,15 @@
|
|
5
5
|
<script>
|
6
6
|
$('.trigger-flash').on('click', function(){
|
7
7
|
type = $(this).data('flashType');
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
|
9
|
+
if (!$('.flash.' + type).is('*')) {
|
10
|
+
flash = $("<div class='flash'>")
|
11
|
+
.text(type)
|
12
|
+
.addClass(type)
|
13
|
+
.appendTo('.js-flash-wrapper')
|
14
|
+
.on('click', function() {
|
15
|
+
$(this).remove();
|
16
|
+
});
|
17
|
+
}
|
12
18
|
});
|
13
19
|
</script>
|
@@ -14,3 +14,48 @@
|
|
14
14
|
<div class="style-guide-code">
|
15
15
|
<pre><code class="language-html"><%= escape_once snippet %></code></pre>
|
16
16
|
</div>
|
17
|
+
<br/>
|
18
|
+
<%- info_tooltip = capture do %>
|
19
|
+
<a title="Some info." class="fa fa-info-circle with-tip" href="#"></a>
|
20
|
+
<%- end %>
|
21
|
+
<table class="with-actions-borders">
|
22
|
+
<thead>
|
23
|
+
<tr>
|
24
|
+
<th> Type </th>
|
25
|
+
<th> Example </th>
|
26
|
+
<th> Code </th>
|
27
|
+
</tr>
|
28
|
+
</thead>
|
29
|
+
<tbody>
|
30
|
+
<tr>
|
31
|
+
<td>
|
32
|
+
<b>Info tooltips</b>
|
33
|
+
These are used to add supplementary information to form labels.
|
34
|
+
The info icon is the coverable area for this tooltip and should be placed at the right side of the form label.
|
35
|
+
</td>
|
36
|
+
<td class="align-center">
|
37
|
+
<%= info_tooltip %>
|
38
|
+
</td>
|
39
|
+
<td>
|
40
|
+
<div class="style-guide-code">
|
41
|
+
<pre><code class="language-html"><%= escape_once info_tooltip %></code></pre>
|
42
|
+
</div>
|
43
|
+
</td>
|
44
|
+
</tr>
|
45
|
+
<tr>
|
46
|
+
<td>
|
47
|
+
<b>Adding icon tooltips</b>
|
48
|
+
These are used to add textual context to the action icons used with tabular data like edit, delete, and clone.
|
49
|
+
They are styled with a similar colour to the icon that they’re attached to.
|
50
|
+
</td>
|
51
|
+
<td class="align-center actions">
|
52
|
+
<%= link_to_edit_url('#', title: 'edit', no_text: true) %>
|
53
|
+
</td>
|
54
|
+
<td>
|
55
|
+
<div class="style-guide-code">
|
56
|
+
<pre><code class="language-html"><%= escape_once link_to_edit_url('#', title: 'edit', no_text: true) %></code></pre>
|
57
|
+
</div>
|
58
|
+
</td>
|
59
|
+
</tr>
|
60
|
+
</tbody>
|
61
|
+
</table>
|
@@ -22,16 +22,30 @@
|
|
22
22
|
<div class="col-5">
|
23
23
|
<div data-hook="zone" class="field">
|
24
24
|
<%= f.label :zone, Spree::Zone.model_name.human %>
|
25
|
-
<%= f.collection_select(:zone_id, @available_zones, :id, :name, {}, {class: '
|
25
|
+
<%= f.collection_select(:zone_id, @available_zones, :id, :name, {}, {class: 'custom-select fullwidth'}) %>
|
26
26
|
</div>
|
27
27
|
<div data-hook="category" class="field">
|
28
|
-
<%= f.label :
|
29
|
-
<%= f.collection_select(:
|
28
|
+
<%= f.label :tax_category_ids, Spree::TaxCategory.model_name.human %>
|
29
|
+
<%= f.collection_select(:tax_category_ids, @available_categories, :id, :name, {}, {class: 'select2 fullwidth', multiple: "multiple"}) %>
|
30
30
|
</div>
|
31
31
|
<div data-hook="show_rate" class="field">
|
32
32
|
<%= f.check_box :show_rate_in_label %>
|
33
33
|
<%= f.label :show_rate_in_label, Spree.t(:show_rate_in_label) %>
|
34
34
|
</div>
|
35
|
+
|
36
|
+
<div class="date-range-filter field">
|
37
|
+
<%= label_tag :validity_period, Spree.t(:validity_period) %>
|
38
|
+
<%= admin_hint Spree.t(:validity_period), Spree.t(:validity_period, scope: [:hints, "spree/tax_rate"]) %>
|
39
|
+
<div class="date-range-fields input-group">
|
40
|
+
<%= 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) %>
|
41
|
+
|
42
|
+
<span class="range-divider input-group-addon">
|
43
|
+
<i class="fa fa-arrow-right"></i>
|
44
|
+
</span>
|
45
|
+
|
46
|
+
<%= 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) %>
|
47
|
+
</div>
|
48
|
+
</div>
|
35
49
|
</div>
|
36
50
|
</div>
|
37
51
|
</fieldset>
|
@@ -20,7 +20,8 @@
|
|
20
20
|
<col style="width: 15%">
|
21
21
|
<col style="width: 10%">
|
22
22
|
<col style="width: 10%">
|
23
|
-
<col style="width:
|
23
|
+
<col style="width: 5%">
|
24
|
+
<col style="width: 5%">
|
24
25
|
<col style="width: 10%">
|
25
26
|
<col style="width: 15%">
|
26
27
|
<col style="width: 15%">
|
@@ -29,10 +30,11 @@
|
|
29
30
|
<tr data-hook="rate_header">
|
30
31
|
<th><%= Spree::TaxRate.human_attribute_name(:zone) %></th>
|
31
32
|
<th><%= Spree::TaxRate.human_attribute_name(:name) %></th>
|
32
|
-
<th><%= Spree::TaxRate.human_attribute_name(:
|
33
|
+
<th><%= Spree::TaxRate.human_attribute_name(:tax_categories) %></th>
|
33
34
|
<th><%= Spree::TaxRate.human_attribute_name(:amount) %></th>
|
34
35
|
<th><%= Spree::TaxRate.human_attribute_name(:included_in_price) %></th>
|
35
36
|
<th><%= Spree::TaxRate.human_attribute_name(:show_rate_in_label) %></th>
|
37
|
+
<th><%= Spree::TaxRate.human_attribute_name(:expires_at) %></th>
|
36
38
|
<th><%= Spree::Calculator.model_name.human %></th>
|
37
39
|
<th class="actions"></th>
|
38
40
|
</tr>
|
@@ -42,10 +44,17 @@
|
|
42
44
|
<tr id="<%= spree_dom_id tax_rate %>" data-hook="rate_row" class="<%= cycle('odd', 'even')%>">
|
43
45
|
<td class="align-center"><%=tax_rate.zone.try(:name) || Spree.t(:not_available) %></td>
|
44
46
|
<td class="align-center"><%=tax_rate.name %></td>
|
45
|
-
<td class="align-center"
|
47
|
+
<td class="align-center">
|
48
|
+
<% if tax_rate.tax_categories.any? %>
|
49
|
+
<%= tax_rate.tax_categories.map(&:name).join(", ") %>
|
50
|
+
<% else %>
|
51
|
+
<%= Spree.t(:not_available) %>
|
52
|
+
<% end %>
|
53
|
+
</td>
|
46
54
|
<td class="align-center"><%=tax_rate.amount %></td>
|
47
55
|
<td class="align-center"><%=tax_rate.included_in_price? ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
48
56
|
<td class="align-center"><%=tax_rate.show_rate_in_label? ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
57
|
+
<td class="align-center"><%=tax_rate.expires_at.to_date.to_s(:short_date) if tax_rate.expires_at %></td>
|
49
58
|
<td class="align-center"><%=tax_rate.calculator.to_s %></td>
|
50
59
|
<td class="actions">
|
51
60
|
<% if can?(:update, tax_rate) %>
|
@@ -19,12 +19,5 @@
|
|
19
19
|
</fieldset>
|
20
20
|
|
21
21
|
|
22
|
-
<div>
|
23
|
-
<script>
|
24
|
-
Spree.routes.taxonomy_path = "<%= spree.api_taxonomy_path(@taxonomy) %>";
|
25
|
-
Spree.routes.taxonomy_taxons_path = "<%= spree.api_taxonomy_taxons_path(@taxonomy) %>";
|
26
|
-
Spree.routes.admin_taxonomy_taxons_path = "<%= spree.admin_taxonomy_taxons_path(@taxonomy) %>";
|
27
|
-
</script>
|
28
|
-
<div id="taxonomy_tree" class="tree" data-taxonomy-id="<%= @taxonomy.id %>"></div>
|
29
|
-
</div>
|
22
|
+
<div id="taxonomy_tree" class="tree" data-taxonomy-id="<%= @taxonomy.id %>"></div>
|
30
23
|
<% end %>
|