shopapp 0.2.67 → 0.2.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d027c6f21b4d8853222c8c2ec2d2a8ed73c8539ddfed1198cac272835ca0d30
4
- data.tar.gz: 00cdadce9a12b39ad422eb690afa6899a81c646b074cd91ae6a3454752b12c8d
3
+ metadata.gz: 738ab7bb67c5529b4184fd324415e44aad3bfa911bbd6bdec41f28e13af43f37
4
+ data.tar.gz: 694d7f2e1d4976f7c651f239c24e70810107dc16e0472ca724c6d203ca00df56
5
5
  SHA512:
6
- metadata.gz: a8ac31a92fba30b166b38108208273536ec4363d37fcc91b4185740ce9aab30eebe6012a55b312aa16abd81541a6119d4a5208fc50e6cdab5315fd6e9dd99a0e
7
- data.tar.gz: 7060fba84857eaf91f929b97f9ebf75494719f56a9a0f6c9ff0ac85be995bbbf1bc3c5f11e7d0522dc06204c8a21e34aebb4ead24d0933e9ebb3668b2cd5a575
6
+ metadata.gz: d5254b85c1219fc355cc615a916d530bfa468a40a71f027ff883bad4910969ec1847869f69e546692334ebad8761daef433d47308cf1399dbd385bdb9801368a
7
+ data.tar.gz: 58fa561426e2f322acd0e66ccac96af5d62628fd7d1a97ebe4b3f5575b9fc511239b18a38e6efe99b49cf1b5b1c3508db2fcfd6bb498e0362e8d6b66d0f585a6
data/README.md CHANGED
@@ -93,4 +93,4 @@ shopapp to support i18n, add two methods to your ApplicationController:
93
93
 
94
94
  To build new version of this gem, change the version in shopapp.gemspec and run:
95
95
 
96
- gem build shopapp.gemspec ; gem push shopapp-0.2.67.gem; gem install shopapp
96
+ gem build shopapp.gemspec ; gem push shopapp-0.2.68.gem; gem install shopapp
@@ -109,9 +109,16 @@ module ShopliftClient
109
109
  end
110
110
 
111
111
  def shoplift_login_url
112
- client.auth_code.authorize_url(
112
+ redirect_parameters = {
113
113
  redirect_uri: local_authlift_redirect_uri,
114
- scope: scope)
114
+ scope: scope
115
+ }
116
+
117
+ if cookies[:set_i18n_pub]
118
+ redirect_parameters[:set_i18n_pub] = cookies[:set_i18n_pub]
119
+ end
120
+
121
+ client.auth_code.authorize_url(redirect_parameters)
115
122
  end
116
123
 
117
124
  def redirect_unauthorized(skip_landing_page = false)
@@ -2,6 +2,17 @@ class ShopappLoginController < ApplicationController
2
2
  include ShopliftClient
3
3
 
4
4
  def welcome
5
+ redirect_parameters = { return_path: request.url }
6
+
7
+ if params['set_i18n_pub']
8
+ cookies[:set_i18n_pub] = params['set_i18n_pub']
9
+ end
10
+
11
+ if cookies[:set_i18n_pub]
12
+ redirect_parameters[:set_i18n_pub] = cookies[:set_i18n_pub]
13
+ I18n.locale = (cookies[:set_i18n_pub] || I18n.default_locale).to_sym
14
+ end
15
+
5
16
  unless Rails.configuration.settings['use_welcome_screen'].present?
6
17
  redirect_to root_path
7
18
  return
@@ -16,7 +27,7 @@ class ShopappLoginController < ApplicationController
16
27
  authenticate_user! true
17
28
  else
18
29
  destination = URI("#{Rails.configuration.settings['authlift_url']}softly_verify_login")
19
- destination.query = { return_path: request.url }.to_query
30
+ destination.query = redirect_parameters.to_query
20
31
  redirect_to destination.to_s
21
32
  end
22
33
  end
@@ -20,12 +20,14 @@
20
20
  .jumbotron.bg-secondary.text-light
21
21
  .container.h-100
22
22
  = image_tag company_logo_path_defined
23
- %h2.pt-5 #{@current_shop_owner.name} B2B shop
24
- %h1.mt-3 Welcome!
23
+ = link_to '?set_i18n_pub=fi', class: 'float-right ml-2', data: { turbolinks: false } do
24
+ = image_tag "flags/fi.png", style: "height: 24; width: 36px;"
25
+ = link_to '?set_i18n_pub=en', class: 'float-right', data: { turbolinks: false } do
26
+ = image_tag "flags/en.png", style: "height: 24; width: 36px;"
27
+ %h2.pt-5 #{@current_shop_owner.name} #{t :b2b_shop}
28
+ %h1.mt-3= t :welcome
25
29
  %p.mt-5
26
- #{@current_shop_owner.name} B2B Shop is running on OZZ platform.
27
- You need to login with your OZZ account to proceed.
28
- = link_to shoplift_login_url do
29
- %button.btn.btn-primary.btn-lg.float-right.my-5
30
- Proceed to login
30
+ #{@current_shop_owner.name} #{t :landing_message}
31
+ = link_to shoplift_login_url, data: { turbolinks: false } do
32
+ %button.btn.btn-primary.btn-lg.float-right.my-5= t :landing_button
31
33
  .clearfix
data/shopapp.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopapp'
3
- s.version = '0.2.67'
4
- s.date = '2019-09-27'
3
+ s.version = '0.2.68'
4
+ s.date = '2019-10-03'
5
5
  s.summary = 'Do a shoplift.'
6
6
  s.description = 'Ha! Art thou Bedlam? Dost thou thirst base Trojan, to have me fold up Parca\'s fatal web? Hence!\
7
7
  I am qualmish at the smell of leek.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.67
4
+ version: 0.2.68
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties