spree_frontend 4.2.0.rc3 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/frontend.js +38 -5
- data/app/assets/javascripts/spree/frontend/account.js +1 -1
- data/app/assets/javascripts/spree/frontend/cart.js +1 -1
- data/app/assets/javascripts/spree/frontend/checkout/address.js +1 -1
- data/app/assets/javascripts/spree/frontend/checkout/shipment.js +15 -2
- data/app/assets/javascripts/spree/frontend/coupon_manager.js +1 -1
- data/app/assets/javascripts/spree/frontend/currency.js +43 -0
- data/app/assets/javascripts/spree/frontend/locale.js +13 -0
- data/app/assets/stylesheets/spree/frontend/application.scss +0 -3
- data/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss +1 -0
- data/app/assets/stylesheets/spree/frontend/variables/helper-variables.scss +1 -0
- data/app/assets/stylesheets/spree/frontend/variables/variables.scss +54 -0
- data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +27 -22
- data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +3 -0
- data/app/controllers/concerns/spree/locale_urls.rb +21 -0
- data/app/controllers/spree/checkout_controller.rb +8 -8
- data/app/controllers/spree/currency_controller.rb +9 -9
- data/app/controllers/spree/home_controller.rb +5 -1
- data/app/controllers/spree/locale_controller.rb +23 -6
- data/app/controllers/spree/orders_controller.rb +2 -2
- data/app/controllers/spree/products_controller.rb +6 -5
- data/app/controllers/spree/store_controller.rb +11 -15
- data/app/controllers/spree/taxons_controller.rb +3 -2
- data/app/helpers/spree/addresses_helper.rb +9 -2
- data/app/helpers/spree/cache_helper.rb +7 -0
- data/app/helpers/spree/frontend_helper.rb +15 -23
- data/app/helpers/spree/navigation_helper.rb +6 -1
- data/app/helpers/spree/store_helper.rb +39 -0
- data/app/helpers/spree/taxons_helper.rb +1 -1
- data/app/models/spree/frontend_configuration.rb +2 -1
- data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +2 -2
- data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +2 -2
- data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +2 -2
- data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +2 -2
- data/app/views/kaminari/twitter-bootstrap-4/_page.html.erb +2 -2
- data/app/views/kaminari/twitter-bootstrap-4/_paginator.html.erb +2 -2
- data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +2 -2
- data/app/views/spree/address/_form.html.erb +15 -16
- data/app/views/spree/addresses/edit.html.erb +2 -2
- data/app/views/spree/addresses/new.html.erb +2 -2
- data/app/views/spree/checkout/_address.html.erb +4 -6
- data/app/views/spree/checkout/_confirm.html.erb +1 -33
- data/app/views/spree/checkout/_credit_card.html.erb +2 -2
- data/app/views/spree/checkout/_delivery_informations.html.erb +43 -36
- data/app/views/spree/checkout/_summary.html.erb +3 -5
- data/app/views/spree/checkout/payment/_gateway.html.erb +1 -1
- data/app/views/spree/home/index.html.erb +21 -22
- data/app/views/spree/locale/index.html.erb +1 -0
- data/app/views/spree/orders/_coupon_code.html.erb +2 -3
- data/app/views/spree/orders/_line_item.html.erb +2 -2
- data/app/views/spree/orders/_line_item_data.html.erb +1 -1
- data/app/views/spree/orders/edit.html.erb +2 -3
- data/app/views/spree/orders/show.html.erb +1 -71
- data/app/views/spree/products/_cart_form.html.erb +2 -3
- data/app/views/spree/products/_color_option_type.html.erb +2 -3
- data/app/views/spree/products/_filters_desktop.html.erb +1 -2
- data/app/views/spree/products/_gallery.html.erb +4 -6
- data/app/views/spree/products/_gallery_modal.html.erb +3 -5
- data/app/views/spree/products/_option_type.html.erb +1 -2
- data/app/views/spree/products/_sort_mobile.html.erb +4 -4
- data/app/views/spree/products/related.html.erb +11 -5
- data/app/views/spree/products/show.html.erb +1 -2
- data/app/views/spree/shared/_carousel_4_products.html.erb +6 -12
- data/app/views/spree/shared/_color_select.html.erb +3 -3
- data/app/views/spree/shared/_currency_dropdown.html.erb +13 -0
- data/app/views/spree/shared/_delete_address_popup.html.erb +1 -2
- data/app/views/spree/shared/_error_messages.html.erb +2 -2
- data/app/views/spree/shared/_footer.html.erb +2 -2
- data/app/views/spree/shared/_head.html.erb +2 -1
- data/app/views/spree/shared/_header.html.erb +1 -1
- data/app/views/spree/shared/_internationalization_options.html.erb +31 -0
- data/app/views/spree/shared/_line_item.html.erb +2 -2
- data/app/views/spree/shared/_link_to_account.html.erb +5 -5
- data/app/views/spree/shared/_locale_and_currency.html.erb +6 -0
- data/app/views/spree/shared/_locale_dropdown.html.erb +13 -0
- data/app/views/spree/shared/_login.html.erb +1 -1
- data/app/views/spree/shared/_main_nav_bar.html.erb +1 -1
- data/app/views/spree/shared/_mobile_internationalization_options.html.erb +37 -0
- data/app/views/spree/shared/_mobile_navigation.html.erb +3 -6
- data/app/views/spree/shared/_nav_bar.html.erb +5 -5
- data/app/views/spree/shared/_no_product_available.html.erb +1 -1
- data/app/views/spree/shared/_option_values.html.erb +1 -1
- data/app/views/spree/shared/_order_details.html.erb +117 -174
- data/app/views/spree/shared/_payment.html.erb +2 -2
- data/app/views/spree/shared/_payment_sources.html.erb +2 -2
- data/app/views/spree/shared/_product_added_modal.html.erb +3 -3
- data/app/views/spree/shared/_search.html.erb +1 -2
- data/app/views/spree/shared/_translations.html.erb +6 -6
- data/app/views/spree/shared/carousel/_single.html.erb +6 -11
- data/app/views/spree/shared/carousel/_thumbnails.html.erb +5 -11
- data/app/views/spree/users/_address_controls.html.erb +1 -2
- data/app/views/spree/users/show.html.erb +4 -4
- data/config/initializers/canonical_rails.rb +1 -1
- data/config/routes.rb +26 -30
- data/lib/generators/spree/frontend/copy_storefront/copy_storefront_generator.rb +1 -7
- data/lib/generators/spree/frontend/install/install_generator.rb +34 -0
- data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +1 -0
- data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +99 -0
- data/spree_frontend.gemspec +1 -1
- metadata +26 -16
- data/app/views/spree/shared/_change_store.html.erb +0 -25
- data/app/views/spree/shared/_mobile_change_store.html.erb +0 -30
- data/app/views/spree/shared/forbidden.html.erb +0 -0
- data/app/views/spree/shared/unauthorized.html.erb +0 -0
@@ -1,16 +1,16 @@
|
|
1
1
|
module Spree
|
2
2
|
class CurrencyController < StoreController
|
3
3
|
def set
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
new_currency = params[:switch_to_currency]&.upcase
|
5
|
+
|
6
|
+
if new_currency.present? && supported_currency?(new_currency)
|
7
|
+
current_order&.update(currency: new_currency)
|
8
|
+
session[:currency] = new_currency
|
9
|
+
end
|
10
|
+
|
8
11
|
respond_to do |format|
|
9
|
-
format.
|
10
|
-
format.
|
11
|
-
# We want to go back to where we came from!
|
12
|
-
redirect_back_or_default(root_path)
|
13
|
-
end
|
12
|
+
format.html { redirect_back fallback_location: spree.root_path(currency: new_currency) }
|
13
|
+
format.json { head :ok }
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
module Spree
|
2
2
|
class HomeController < Spree::StoreController
|
3
|
+
include Spree::CacheHelper
|
4
|
+
|
3
5
|
respond_to :html
|
4
6
|
|
5
7
|
def index
|
6
|
-
|
8
|
+
if http_cache_enabled?
|
9
|
+
fresh_when etag: store_etag, last_modified: store_last_modified, public: true
|
10
|
+
end
|
7
11
|
end
|
8
12
|
end
|
9
13
|
end
|
@@ -1,14 +1,31 @@
|
|
1
1
|
module Spree
|
2
2
|
class LocaleController < Spree::StoreController
|
3
|
+
def index
|
4
|
+
render :index, layout: false
|
5
|
+
end
|
6
|
+
|
3
7
|
def set
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
+
new_locale = (params[:switch_to_locale] || params[:locale]).to_s
|
9
|
+
|
10
|
+
if new_locale.present? && supported_locale?(new_locale)
|
11
|
+
if should_build_new_url?
|
12
|
+
redirect_to BuildLocalizedRedirectUrl.call(
|
13
|
+
url: request.env['HTTP_REFERER'],
|
14
|
+
locale: new_locale,
|
15
|
+
default_locale: current_store.default_locale
|
16
|
+
).value
|
17
|
+
else
|
18
|
+
redirect_to root_path(locale: new_locale)
|
19
|
+
end
|
8
20
|
else
|
9
|
-
|
21
|
+
redirect_to root_path
|
10
22
|
end
|
11
|
-
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def should_build_new_url?
|
28
|
+
request.env['HTTP_REFERER'].present? && request.env['HTTP_REFERER'] != request.env['REQUEST_URI']
|
12
29
|
end
|
13
30
|
end
|
14
31
|
end
|
@@ -20,9 +20,9 @@ module Spree
|
|
20
20
|
format.html do
|
21
21
|
if params.key?(:checkout)
|
22
22
|
@order.next if @order.cart?
|
23
|
-
redirect_to checkout_state_path(@order.checkout_steps.first)
|
23
|
+
redirect_to spree.checkout_state_path(@order.checkout_steps.first)
|
24
24
|
else
|
25
|
-
redirect_to cart_path
|
25
|
+
redirect_to spree.cart_path
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -2,6 +2,7 @@ module Spree
|
|
2
2
|
class ProductsController < Spree::StoreController
|
3
3
|
include Spree::ProductsHelper
|
4
4
|
include Spree::FrontendHelper
|
5
|
+
include Spree::CacheHelper
|
5
6
|
|
6
7
|
before_action :load_product, only: [:show, :related]
|
7
8
|
before_action :load_taxon, only: :index
|
@@ -12,7 +13,9 @@ module Spree
|
|
12
13
|
@searcher = build_searcher(params.merge(include_images: true, current_store_id: current_store.id))
|
13
14
|
@products = @searcher.retrieve_products
|
14
15
|
|
15
|
-
|
16
|
+
if http_cache_enabled?
|
17
|
+
fresh_when etag: etag_index, last_modified: last_modified_index, public: true
|
18
|
+
end
|
16
19
|
end
|
17
20
|
|
18
21
|
def show
|
@@ -20,7 +23,7 @@ module Spree
|
|
20
23
|
|
21
24
|
@taxon = params[:taxon_id].present? ? Spree::Taxon.find(params[:taxon_id]) : @product.taxons.first
|
22
25
|
|
23
|
-
if stale?(etag: etag_show, last_modified: last_modified_show, public: true)
|
26
|
+
if !http_cache_enabled? || stale?(etag: etag_show, last_modified: last_modified_show, public: true)
|
24
27
|
@product_summary = Spree::ProductSummaryPresenter.new(@product).call
|
25
28
|
@product_properties = @product.product_properties.includes(:property)
|
26
29
|
@product_price = @product.price_in(current_currency).amount
|
@@ -30,9 +33,7 @@ module Spree
|
|
30
33
|
end
|
31
34
|
|
32
35
|
def related
|
33
|
-
|
34
|
-
|
35
|
-
if @related_products.any?
|
36
|
+
if product_relation_types.any?
|
36
37
|
render template: 'spree/products/related', layout: false
|
37
38
|
else
|
38
39
|
head :no_content
|
@@ -1,25 +1,23 @@
|
|
1
1
|
module Spree
|
2
2
|
class StoreController < Spree::BaseController
|
3
3
|
include Spree::Core::ControllerHelpers::Order
|
4
|
+
include Spree::LocaleUrls
|
4
5
|
|
5
|
-
|
6
|
+
helper 'spree/locale'
|
7
|
+
helper 'spree/currency'
|
6
8
|
|
7
|
-
|
8
|
-
render 'spree/shared/forbidden', layout: Spree::Config[:layout], status: 403
|
9
|
-
end
|
9
|
+
skip_before_action :verify_authenticity_token, only: :ensure_cart, raise: false
|
10
10
|
|
11
|
-
|
12
|
-
render 'spree/shared/unauthorized', layout: Spree::Config[:layout], status: 401
|
13
|
-
end
|
11
|
+
before_action :redirect_to_default_locale
|
14
12
|
|
15
13
|
def account_link
|
16
14
|
render partial: 'spree/shared/link_to_account'
|
17
|
-
fresh_when(try_spree_current_user)
|
15
|
+
fresh_when(etag: [try_spree_current_user, I18n.locale])
|
18
16
|
end
|
19
17
|
|
20
18
|
def cart_link
|
21
19
|
render partial: 'spree/shared/link_to_cart'
|
22
|
-
fresh_when(simple_current_order)
|
20
|
+
fresh_when(etag: [simple_current_order, I18n.locale])
|
23
21
|
end
|
24
22
|
|
25
23
|
def api_tokens
|
@@ -39,16 +37,14 @@ module Spree
|
|
39
37
|
Spree::Frontend::Config[:locale]
|
40
38
|
end
|
41
39
|
|
42
|
-
def store_locale
|
43
|
-
current_store.default_locale
|
44
|
-
end
|
45
|
-
|
46
40
|
def store_etag
|
47
41
|
[
|
48
42
|
current_store,
|
49
43
|
current_currency,
|
50
|
-
I18n.locale
|
51
|
-
|
44
|
+
I18n.locale,
|
45
|
+
try_spree_current_user.present?,
|
46
|
+
try_spree_current_user.try(:has_spree_role?, 'admin')
|
47
|
+
].compact
|
52
48
|
end
|
53
49
|
|
54
50
|
def store_last_modified
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Spree
|
2
2
|
class TaxonsController < Spree::StoreController
|
3
3
|
include Spree::FrontendHelper
|
4
|
+
include Spree::CacheHelper
|
4
5
|
helper 'spree/products'
|
5
6
|
|
6
7
|
before_action :load_taxon
|
@@ -8,13 +9,13 @@ module Spree
|
|
8
9
|
respond_to :html
|
9
10
|
|
10
11
|
def show
|
11
|
-
if stale?(etag: etag, last_modified: last_modified, public: true)
|
12
|
+
if !http_cache_enabled? || stale?(etag: etag, last_modified: last_modified, public: true)
|
12
13
|
load_products
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
17
|
def product_carousel
|
17
|
-
if stale?(etag: carousel_etag, last_modified: last_modified, public: true)
|
18
|
+
if !http_cache_enabled? || stale?(etag: carousel_etag, last_modified: last_modified, public: true)
|
18
19
|
load_products
|
19
20
|
if @products.reload.any?
|
20
21
|
render template: 'spree/taxons/product_carousel', layout: false
|
@@ -65,9 +65,16 @@ module Spree
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def user_available_addresses
|
68
|
-
|
68
|
+
@user_available_addresses ||= begin
|
69
|
+
return [] unless try_spree_current_user
|
69
70
|
|
70
|
-
|
71
|
+
states = current_store.countries_available_for_checkout.each_with_object([]) do |country, memo|
|
72
|
+
memo << current_store.states_available_for_checkout(country)
|
73
|
+
end.flatten
|
74
|
+
|
75
|
+
try_spree_current_user.addresses.
|
76
|
+
where(country_id: states.pluck(:country_id).uniq)
|
77
|
+
end
|
71
78
|
end
|
72
79
|
|
73
80
|
def checkout_zone_applicable_states_for(country)
|
@@ -7,26 +7,6 @@ module Spree
|
|
7
7
|
@body_class
|
8
8
|
end
|
9
9
|
|
10
|
-
def store_country_iso(store)
|
11
|
-
store ||= current_store
|
12
|
-
return unless store
|
13
|
-
return unless store.default_country
|
14
|
-
|
15
|
-
store.default_country.iso.downcase
|
16
|
-
end
|
17
|
-
|
18
|
-
def stores
|
19
|
-
@stores ||= Spree::Store.includes(:default_country)
|
20
|
-
end
|
21
|
-
|
22
|
-
def store_currency_symbol(store)
|
23
|
-
store ||= current_store
|
24
|
-
return unless store
|
25
|
-
return unless store.default_currency
|
26
|
-
|
27
|
-
::Money::Currency.find(store.default_currency).symbol
|
28
|
-
end
|
29
|
-
|
30
10
|
def spree_breadcrumbs(taxon, _separator = '', product = nil)
|
31
11
|
return '' if current_page?('/') || taxon.nil?
|
32
12
|
|
@@ -248,7 +228,7 @@ module Spree
|
|
248
228
|
end
|
249
229
|
|
250
230
|
def price_filter_values
|
251
|
-
[
|
231
|
+
@price_filter_values ||= [
|
252
232
|
"#{I18n.t('activerecord.attributes.spree/product.less_than')} #{formatted_price(50)}",
|
253
233
|
"#{formatted_price(50)} - #{formatted_price(100)}",
|
254
234
|
"#{formatted_price(101)} - #{formatted_price(150)}",
|
@@ -295,7 +275,17 @@ module Spree
|
|
295
275
|
end
|
296
276
|
|
297
277
|
def checkout_available_payment_methods
|
298
|
-
@order.available_payment_methods(current_store)
|
278
|
+
@checkout_available_payment_methods ||= @order.available_payment_methods(current_store)
|
279
|
+
end
|
280
|
+
|
281
|
+
def color_option_type_name
|
282
|
+
@color_option_type_name ||= Spree::OptionType.color&.name
|
283
|
+
end
|
284
|
+
|
285
|
+
def country_flag_icon(country_iso_code = nil)
|
286
|
+
return if country_iso_code.blank?
|
287
|
+
|
288
|
+
content_tag :span, nil, class: "flag-icon flag-icon-#{country_iso_code.downcase}"
|
299
289
|
end
|
300
290
|
|
301
291
|
private
|
@@ -314,7 +304,9 @@ module Spree
|
|
314
304
|
end
|
315
305
|
end
|
316
306
|
|
317
|
-
def checkout_edit_link(step = 'address')
|
307
|
+
def checkout_edit_link(step = 'address', order = @order)
|
308
|
+
return if order.complete?
|
309
|
+
|
318
310
|
classes = 'align-text-bottom checkout-confirm-delivery-informations-link'
|
319
311
|
|
320
312
|
link_to spree.checkout_state_path(step), class: classes, method: :get do
|
@@ -3,7 +3,7 @@ require 'digest'
|
|
3
3
|
module Spree
|
4
4
|
module NavigationHelper
|
5
5
|
def spree_navigation_data
|
6
|
-
SpreeStorefrontConfig.dig(current_store.code, :navigation) || SpreeStorefrontConfig.dig(:default, :navigation) || []
|
6
|
+
@spree_navigation_data ||= SpreeStorefrontConfig.dig(I18n.locale, :navigation) || SpreeStorefrontConfig.dig(current_store.code, :navigation) || SpreeStorefrontConfig.dig(:default, :navigation) || []
|
7
7
|
# safeguard for older Spree installs that don't have spree_navigation initializer
|
8
8
|
# or spree.yml file present
|
9
9
|
rescue
|
@@ -28,6 +28,11 @@ module Spree
|
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
31
|
+
def should_render_internationalization_dropdown?
|
32
|
+
(defined?(should_render_locale_dropdown?) && should_render_locale_dropdown?) ||
|
33
|
+
(defined?(should_render_currency_dropdown?) && should_render_currency_dropdown?)
|
34
|
+
end
|
35
|
+
|
31
36
|
private
|
32
37
|
|
33
38
|
def spree_navigation_data_cache_key
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Spree
|
2
|
+
module StoreHelper
|
3
|
+
def store_country_iso(store = nil)
|
4
|
+
store ||= current_store if defined?(current_store)
|
5
|
+
|
6
|
+
store&.default_country&.iso&.downcase
|
7
|
+
end
|
8
|
+
|
9
|
+
def stores
|
10
|
+
@stores ||= Spree::Store.includes(:default_country).order(:id)
|
11
|
+
end
|
12
|
+
|
13
|
+
def store_currency_symbol(store = nil)
|
14
|
+
store ||= current_store if defined?(current_store)
|
15
|
+
return unless store&.default_currency
|
16
|
+
|
17
|
+
::Money::Currency.find(store.default_currency).symbol
|
18
|
+
end
|
19
|
+
|
20
|
+
def store_locale_name(store = nil)
|
21
|
+
store ||= current_store if defined?(current_store)
|
22
|
+
return unless store
|
23
|
+
return store.name if store.default_locale.blank?
|
24
|
+
|
25
|
+
Spree.t('i18n.this_file_language', locale: store.default_locale)
|
26
|
+
end
|
27
|
+
|
28
|
+
def should_render_store_chooser?
|
29
|
+
Spree::Config.show_store_selector && stores.size > 1
|
30
|
+
end
|
31
|
+
|
32
|
+
def store_link(store = nil, html_opts = {})
|
33
|
+
store ||= current_store if defined?(current_store)
|
34
|
+
return unless store
|
35
|
+
|
36
|
+
link_to "#{store_locale_name(store)} (#{store_currency_symbol(store)})", store.formatted_url, **html_opts
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -5,7 +5,7 @@ module Spree
|
|
5
5
|
# to show the most popular products for a particular taxon (that is an exercise left to the developer.)
|
6
6
|
def taxon_preview(taxon, max = 4)
|
7
7
|
ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
|
8
|
-
TaxonsHelper is deprecated and will be removed in Spree
|
8
|
+
TaxonsHelper is deprecated and will be removed in Spree 5.0.
|
9
9
|
Please remove any `helper 'spree/taxons'` from your controllers.
|
10
10
|
DEPRECATION
|
11
11
|
products = taxon.active_products.distinct.select('spree_products.*, spree_products_taxons.position').limit(max)
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module Spree
|
2
2
|
class FrontendConfiguration < Preferences::Configuration
|
3
3
|
preference :coupon_codes_enabled, :boolean, default: true # Determines if we show coupon code form at cart and checkout
|
4
|
-
preference :
|
4
|
+
preference :http_cache_enabled, :boolean, default: true
|
5
|
+
preference :locale, :string, default: nil
|
5
6
|
preference :products_filters, :array, default: %w(keywords price sort_by)
|
6
7
|
preference :additional_filters_partials, :array, default: %w()
|
7
8
|
preference :remember_me_enabled, :boolean, default: true
|
@@ -4,8 +4,8 @@
|
|
4
4
|
current_page: a page object for the currently displayed page
|
5
5
|
total_pages: total number of pages
|
6
6
|
per_page: number of items to fetch per page
|
7
|
-
remote: data-remote
|
8
|
-
|
7
|
+
remote: data-remote -%>
|
8
|
+
|
9
9
|
<% unless current_page.first? %>
|
10
10
|
<li class="first page-item">
|
11
11
|
<%= link_to_unless current_page.first?, inline_svg_tag('pagination-double-arrow-right.svg', size: '13px*16px', class: 'spree-icon-arrow-left'), url, remote: remote, class: 'page-link', 'aria-label': 'First page' %>
|
@@ -3,8 +3,8 @@
|
|
3
3
|
current_page: a page object for the currently displayed page
|
4
4
|
total_pages: total number of pages
|
5
5
|
per_page: number of items to fetch per page
|
6
|
-
remote: data-remote
|
7
|
-
|
6
|
+
remote: data-remote -%>
|
7
|
+
|
8
8
|
<li class="page gap disabled page-item d-none d-lg-flex">
|
9
9
|
<a href="#" onclick="return false;" class="page-link">
|
10
10
|
<%= raw(t 'views.pagination.truncate') %>
|
@@ -4,8 +4,8 @@
|
|
4
4
|
current_page: a page object for the currently displayed page
|
5
5
|
total_pages: total number of pages
|
6
6
|
per_page: number of items to fetch per page
|
7
|
-
remote: data-remote
|
8
|
-
|
7
|
+
remote: data-remote -%>
|
8
|
+
|
9
9
|
<% unless current_page.last? %>
|
10
10
|
<li class="last next page-item"><%# "next" class present for border styling in twitter bootstrap %>
|
11
11
|
<%= link_to_unless current_page.last?, inline_svg_tag('pagination-double-arrow-right.svg', size: '13px*16px'), url, remote: remote, class: 'page-link', 'aria-label': 'Last page' %>
|
@@ -4,8 +4,8 @@
|
|
4
4
|
current_page: a page object for the currently displayed page
|
5
5
|
total_pages: total number of pages
|
6
6
|
per_page: number of items to fetch per page
|
7
|
-
remote: data-remote
|
8
|
-
|
7
|
+
remote: data-remote -%>
|
8
|
+
|
9
9
|
<% unless current_page.last? %>
|
10
10
|
<li class="next_page page-item">
|
11
11
|
<%= link_to_unless current_page.last?, inline_svg_tag('pagination-arrow-right.svg', size: '13px*16px'), url, rel: 'next', remote: remote, class: 'page-link', 'aria-label': 'Next page' %>
|
@@ -5,8 +5,8 @@
|
|
5
5
|
current_page: a page object for the currently displayed page
|
6
6
|
total_pages: total number of pages
|
7
7
|
per_page: number of items to fetch per page
|
8
|
-
remote: data-remote
|
9
|
-
|
8
|
+
remote: data-remote -%>
|
9
|
+
|
10
10
|
<li class="page<%= ' active' if page.current? %> page-item">
|
11
11
|
<%= link_to page,
|
12
12
|
url,
|