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.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/frontend.js +38 -5
  3. data/app/assets/javascripts/spree/frontend/account.js +1 -1
  4. data/app/assets/javascripts/spree/frontend/cart.js +1 -1
  5. data/app/assets/javascripts/spree/frontend/checkout/address.js +1 -1
  6. data/app/assets/javascripts/spree/frontend/checkout/shipment.js +15 -2
  7. data/app/assets/javascripts/spree/frontend/coupon_manager.js +1 -1
  8. data/app/assets/javascripts/spree/frontend/currency.js +43 -0
  9. data/app/assets/javascripts/spree/frontend/locale.js +13 -0
  10. data/app/assets/stylesheets/spree/frontend/application.scss +0 -3
  11. data/app/assets/stylesheets/spree/frontend/variables/bootstrap-overrides.scss +1 -0
  12. data/app/assets/stylesheets/spree/frontend/variables/helper-variables.scss +1 -0
  13. data/app/assets/stylesheets/spree/frontend/variables/variables.scss +54 -0
  14. data/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss +27 -22
  15. data/app/assets/stylesheets/spree/frontend/views/spree/orders/show.scss +3 -0
  16. data/app/controllers/concerns/spree/locale_urls.rb +21 -0
  17. data/app/controllers/spree/checkout_controller.rb +8 -8
  18. data/app/controllers/spree/currency_controller.rb +9 -9
  19. data/app/controllers/spree/home_controller.rb +5 -1
  20. data/app/controllers/spree/locale_controller.rb +23 -6
  21. data/app/controllers/spree/orders_controller.rb +2 -2
  22. data/app/controllers/spree/products_controller.rb +6 -5
  23. data/app/controllers/spree/store_controller.rb +11 -15
  24. data/app/controllers/spree/taxons_controller.rb +3 -2
  25. data/app/helpers/spree/addresses_helper.rb +9 -2
  26. data/app/helpers/spree/cache_helper.rb +7 -0
  27. data/app/helpers/spree/frontend_helper.rb +15 -23
  28. data/app/helpers/spree/navigation_helper.rb +6 -1
  29. data/app/helpers/spree/store_helper.rb +39 -0
  30. data/app/helpers/spree/taxons_helper.rb +1 -1
  31. data/app/models/spree/frontend_configuration.rb +2 -1
  32. data/app/views/kaminari/twitter-bootstrap-4/_first_page.html.erb +2 -2
  33. data/app/views/kaminari/twitter-bootstrap-4/_gap.html.erb +2 -2
  34. data/app/views/kaminari/twitter-bootstrap-4/_last_page.html.erb +2 -2
  35. data/app/views/kaminari/twitter-bootstrap-4/_next_page.html.erb +2 -2
  36. data/app/views/kaminari/twitter-bootstrap-4/_page.html.erb +2 -2
  37. data/app/views/kaminari/twitter-bootstrap-4/_paginator.html.erb +2 -2
  38. data/app/views/kaminari/twitter-bootstrap-4/_prev_page.html.erb +2 -2
  39. data/app/views/spree/address/_form.html.erb +15 -16
  40. data/app/views/spree/addresses/edit.html.erb +2 -2
  41. data/app/views/spree/addresses/new.html.erb +2 -2
  42. data/app/views/spree/checkout/_address.html.erb +4 -6
  43. data/app/views/spree/checkout/_confirm.html.erb +1 -33
  44. data/app/views/spree/checkout/_credit_card.html.erb +2 -2
  45. data/app/views/spree/checkout/_delivery_informations.html.erb +43 -36
  46. data/app/views/spree/checkout/_summary.html.erb +3 -5
  47. data/app/views/spree/checkout/payment/_gateway.html.erb +1 -1
  48. data/app/views/spree/home/index.html.erb +21 -22
  49. data/app/views/spree/locale/index.html.erb +1 -0
  50. data/app/views/spree/orders/_coupon_code.html.erb +2 -3
  51. data/app/views/spree/orders/_line_item.html.erb +2 -2
  52. data/app/views/spree/orders/_line_item_data.html.erb +1 -1
  53. data/app/views/spree/orders/edit.html.erb +2 -3
  54. data/app/views/spree/orders/show.html.erb +1 -71
  55. data/app/views/spree/products/_cart_form.html.erb +2 -3
  56. data/app/views/spree/products/_color_option_type.html.erb +2 -3
  57. data/app/views/spree/products/_filters_desktop.html.erb +1 -2
  58. data/app/views/spree/products/_gallery.html.erb +4 -6
  59. data/app/views/spree/products/_gallery_modal.html.erb +3 -5
  60. data/app/views/spree/products/_option_type.html.erb +1 -2
  61. data/app/views/spree/products/_sort_mobile.html.erb +4 -4
  62. data/app/views/spree/products/related.html.erb +11 -5
  63. data/app/views/spree/products/show.html.erb +1 -2
  64. data/app/views/spree/shared/_carousel_4_products.html.erb +6 -12
  65. data/app/views/spree/shared/_color_select.html.erb +3 -3
  66. data/app/views/spree/shared/_currency_dropdown.html.erb +13 -0
  67. data/app/views/spree/shared/_delete_address_popup.html.erb +1 -2
  68. data/app/views/spree/shared/_error_messages.html.erb +2 -2
  69. data/app/views/spree/shared/_footer.html.erb +2 -2
  70. data/app/views/spree/shared/_head.html.erb +2 -1
  71. data/app/views/spree/shared/_header.html.erb +1 -1
  72. data/app/views/spree/shared/_internationalization_options.html.erb +31 -0
  73. data/app/views/spree/shared/_line_item.html.erb +2 -2
  74. data/app/views/spree/shared/_link_to_account.html.erb +5 -5
  75. data/app/views/spree/shared/_locale_and_currency.html.erb +6 -0
  76. data/app/views/spree/shared/_locale_dropdown.html.erb +13 -0
  77. data/app/views/spree/shared/_login.html.erb +1 -1
  78. data/app/views/spree/shared/_main_nav_bar.html.erb +1 -1
  79. data/app/views/spree/shared/_mobile_internationalization_options.html.erb +37 -0
  80. data/app/views/spree/shared/_mobile_navigation.html.erb +3 -6
  81. data/app/views/spree/shared/_nav_bar.html.erb +5 -5
  82. data/app/views/spree/shared/_no_product_available.html.erb +1 -1
  83. data/app/views/spree/shared/_option_values.html.erb +1 -1
  84. data/app/views/spree/shared/_order_details.html.erb +117 -174
  85. data/app/views/spree/shared/_payment.html.erb +2 -2
  86. data/app/views/spree/shared/_payment_sources.html.erb +2 -2
  87. data/app/views/spree/shared/_product_added_modal.html.erb +3 -3
  88. data/app/views/spree/shared/_search.html.erb +1 -2
  89. data/app/views/spree/shared/_translations.html.erb +6 -6
  90. data/app/views/spree/shared/carousel/_single.html.erb +6 -11
  91. data/app/views/spree/shared/carousel/_thumbnails.html.erb +5 -11
  92. data/app/views/spree/users/_address_controls.html.erb +1 -2
  93. data/app/views/spree/users/show.html.erb +4 -4
  94. data/config/initializers/canonical_rails.rb +1 -1
  95. data/config/routes.rb +26 -30
  96. data/lib/generators/spree/frontend/copy_storefront/copy_storefront_generator.rb +1 -7
  97. data/lib/generators/spree/frontend/install/install_generator.rb +34 -0
  98. data/lib/generators/spree/frontend/install/templates/config/initializers/spree_storefront.rb +1 -0
  99. data/lib/generators/spree/frontend/install/templates/config/spree_storefront.yml +99 -0
  100. data/spree_frontend.gemspec +1 -1
  101. metadata +26 -16
  102. data/app/views/spree/shared/_change_store.html.erb +0 -25
  103. data/app/views/spree/shared/_mobile_change_store.html.erb +0 -30
  104. data/app/views/spree/shared/forbidden.html.erb +0 -0
  105. 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
- @currency = supported_currencies.find { |currency| currency.iso_code == params[:currency] }
5
- # Make sure that we update the current order, so the currency change is reflected.
6
- current_order&.update(currency: @currency.iso_code)
7
- session[:currency] = params[:currency] if Spree::Config[:show_store_currency_selector]
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.json { render json: !@currency.nil? }
10
- format.html do
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
- fresh_when etag: store_etag, last_modified: store_last_modified, public: true
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
- session['user_return_to'] = request.referer if request.referer&.starts_with?('http://' + request.host)
5
- if params[:locale] && I18n.available_locales.map(&:to_s).include?(params[:locale])
6
- session[:locale] = I18n.locale = params[:locale]
7
- flash.notice = Spree.t(:locale_changed)
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
- flash[:error] = Spree.t(:locale_not_changed)
21
+ redirect_to root_path
10
22
  end
11
- redirect_back_or_default(spree.root_path)
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
- fresh_when etag: etag_index, last_modified: last_modified_index, public: true
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
- @related_products = related_products
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
- skip_before_action :verify_authenticity_token, only: :ensure_cart, raise: false
6
+ helper 'spree/locale'
7
+ helper 'spree/currency'
6
8
 
7
- def forbidden
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
- def unauthorized
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
- return unless try_spree_current_user
68
+ @user_available_addresses ||= begin
69
+ return [] unless try_spree_current_user
69
70
 
70
- try_spree_current_user.addresses.where(country: available_countries)
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)
@@ -0,0 +1,7 @@
1
+ module Spree
2
+ module CacheHelper
3
+ def http_cache_enabled?
4
+ @http_cache_enabled ||= Spree::Frontend::Config[:http_cache_enabled]
5
+ end
6
+ end
7
+ end
@@ -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 4.2.
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 :locale, :string, default: Rails.application.config.i18n.default_locale
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,