shopapp 0.2.6 → 0.2.7

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: a79004b05f353393d4787b77d4261599f671c2d722acd395260748d7f4e572a6
4
- data.tar.gz: 740821d7b2e7ba2aec300ec2ec9ab5b5243032ad2d3bb7477adf85284f1e11c3
3
+ metadata.gz: e7358bcd191eca835a745a359c283c2c021a89578552c09b82fdecfcd44c2ca1
4
+ data.tar.gz: 8d1f82dfba08d9da9dd1a19d55db02b121ca65d5d904fe1ab5750d1b47184736
5
5
  SHA512:
6
- metadata.gz: 7901c675fe62f1fb0edc6de6d13d77f3daeffefec6e37d2963ed63ad8650ae8c7c31654bb57e4583d5279df0aedfbea418175ceecfb72d55ab7ea16b77aa5914
7
- data.tar.gz: a6f8880d72bbab944295f97633b408afc3c5e88fc403141168864b9154cc1be332bca2409ab6a0cf9837d0bc4a96b44890e9bce1cc110589f0fe609f4c1e7177
6
+ metadata.gz: 4767ee96a987c7000aa21f81a1084cb6851d120e19c16d144bd1b477dae3a75853d2126e9ca4f84ecf0b931962f7fe8c47ca478c4889b3d6d69940b16586f901
7
+ data.tar.gz: e9f323c0da1970f17c8bfcb27e4e7b5308cb2902fa83c90e1a5d7f9b9d5554b8351d57382282170f737e57f5eefd01192c0e18cd2055854b15b4e07749e939e4
@@ -9,6 +9,8 @@ module ShopliftClient
9
9
  attr_reader :api_key
10
10
  attr_reader :current_user
11
11
  attr_reader :current_company
12
+ attr_reader :do_hide_search_for_this_action
13
+ helper_method :company_logo_path_defined
12
14
  end
13
15
 
14
16
  class_methods do
@@ -18,6 +20,7 @@ module ShopliftClient
18
20
 
19
21
  def set_search_path(value)
20
22
  @search_path = value
23
+ return if @search_path == :current_path
21
24
  @search_path = "/#{@search_path}" unless @search_path[0] == '/'
22
25
  @search_path = "#{@search_path}/" unless @search_path[-1] == '/'
23
26
  end
@@ -34,6 +37,10 @@ module ShopliftClient
34
37
  end
35
38
  end
36
39
 
40
+ def hide_search_for_this_action
41
+ @do_hide_search_for_this_action = true
42
+ end
43
+
37
44
  def session_cookie
38
45
  session["authlift_session_id"]
39
46
  end
@@ -195,4 +202,12 @@ module ShopliftClient
195
202
  Rails.configuration.settings['authlift_app_secret'],
196
203
  site: Rails.configuration.settings['authlift_url']
197
204
  end
198
- end
205
+
206
+ def company_logo_path_defined
207
+ if defined? self.company_logo_path
208
+ company_logo_path
209
+ else
210
+ "https://media.shoplift.fi/company_logos/#{@current_company.code}_company_logo_24.png"
211
+ end
212
+ end
213
+ end
@@ -43,4 +43,12 @@ module ShopappHelper
43
43
  </li>
44
44
  HTML
45
45
  end
46
+
47
+ def search_path
48
+ if controller.class.search_path == :current_path
49
+ request.path
50
+ else
51
+ "#{controller.class.search_path || '/'}"
52
+ end
53
+ end
46
54
  end
@@ -4,14 +4,14 @@
4
4
  %nav.navbar.navbar-dark.fixed-top.bg-dark.flex-md-nowrap.p-0.shadow.navbar-expand-md
5
5
  -#= link_to(Rails.configuration.settings['shopapp_name'], '/', class: 'navbar-brand col-3 col-md-2 mr-0')
6
6
  = link_to('/', class: 'navbar-brand col-3 col-md-2 mr-0') do
7
- = image_tag "https://media.shoplift.fi/company_logos/#{@current_company.code}_company_logo_24.png", style: "padding-bottom: 3px;"
7
+ = image_tag company_logo_path_defined, style: "padding-bottom: 3px;"
8
8
  %span= Rails.configuration.settings['shopapp_name']
9
9
  %button.navbar-toggler(type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation")
10
10
  %span.navbar-toggler-icon
11
11
  #navbarSupportedContent.collapse.navbar-collapse.navbar-toggleable-xs
12
- - unless controller.class.do_hide_search_for_this_controller
12
+ - unless controller.class.do_hide_search_for_this_controller || controller.do_hide_search_for_this_action
13
13
  .w-75.mx-md-auto.mt-4.mt-md-0.ml-3
14
- %form(action="#{controller.class.search_path || '/'}")
14
+ %form(action=search_path)
15
15
  .input-group.input-group-sm
16
16
  %input#search.form-control(name="search" placeholder="Search" type="text" value=@search)
17
17
  .input-group-append
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.6'
4
- s.date = '2018-09-13'
3
+ s.version = '0.2.7'
4
+ s.date = '2018-09-25'
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.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-13 00:00:00.000000000 Z
11
+ date: 2018-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties