tramway-landing 3.0.1.2 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 337939acc2a3fecd0f8f8cf5da83aa5a407294dcf0c7469d838160aaeb1d2804
4
- data.tar.gz: 94eeb36c35a75858b58f7f79a077c91badfd0f187c45c56cccda8cf7333c0ff5
3
+ metadata.gz: 0e21fee02cb0065616dc61bf96c8511d04a4d55e16a016f0af60ed4b39d99cc1
4
+ data.tar.gz: f43fec0852a18c5d4d171fe0c3e292cd22dd824360041fae1bfc074bd0671ca8
5
5
  SHA512:
6
- metadata.gz: ed053040c0a06ab643239194e18c465d5a4e98c672e3a6cd0410e41fecf81249c25bc66616f8f0d4d5abe3146fb02c3ed998d89c041b27c26ee2726b7392c881
7
- data.tar.gz: '0821b6a9a7cfadd567f1d8a3f401128da8c714861726a5b7149dc0aef54ec4f70c0862bf6928a584b07426751e5ef83b4874b60df98af279b882c1efb32e800f'
6
+ metadata.gz: fe6e012753c8a68003c953badc98a099a5e430fa7ad1934a2bdcd691f427a4cee846407d22d97e2258f1fb6182798a1b8ffcde05b0508cf44aac70b6a93765a6
7
+ data.tar.gz: d0acb6af1362ed8bf473349d96dbca1605a99fbbfb0ed00c8161e08198f6a3db67209aac8eb59b738c47b039a742f1129d2694a19410763158683a51599eeede
@@ -7,7 +7,7 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
7
7
  end
8
8
 
9
9
  def list_attributes
10
- %i[position view_state block_type]
10
+ %i[page_link position view_state block_type]
11
11
  end
12
12
 
13
13
  delegate :human_view_state_event_name, to: :model_class
@@ -15,6 +15,18 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
15
15
 
16
16
  delegate_attributes :position, :title, :background, :anchor, :description, :view_name
17
17
 
18
+ def public_path
19
+ if object.published?
20
+ Tramway::Page::Engine.routes.url_helpers.page_path slug: object.page.slug
21
+ else
22
+ Tramway::Page::Engine.routes.url_helpers.preview_path id: object.page.id
23
+ end
24
+ end
25
+
26
+ def page_link
27
+ link_to object.page.title
28
+ end
29
+
18
30
  def block_type
19
31
  object.block_type_text
20
32
  end
@@ -26,9 +26,9 @@ class Tramway::Landing::Block < ::Tramway::Landing::ApplicationRecord
26
26
  store_accessor :button, :button_link
27
27
  store_accessor :button, :button_title
28
28
 
29
- scope :on_main_page, -> do
30
- active.joins(:page).where(view_state: :published).where('tramway_page_pages.page_type = ?', :main).order :position
31
- end
29
+ scope :on_main_page, lambda {
30
+ active.joins(:page).where(view_state: :published).where('tramway_page_pages.page_type = ?', :main).order :position
31
+ }
32
32
  scope :with_navbar_link, -> { where navbar_link: :exist }
33
33
  scope :header, -> { on_main_page.where(block_type: :header).first }
34
34
  scope :footer, -> { on_main_page.where(block_type: :footer).first }
@@ -39,7 +39,7 @@ class Tramway::Landing::Block < ::Tramway::Landing::ApplicationRecord
39
39
  end
40
40
 
41
41
  def header?
42
- block_type.in? [ 'header', 'header_with_form']
42
+ block_type.in? %w[header header_with_form]
43
43
  end
44
44
 
45
45
  def footer?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Landing
5
- VERSION = '3.0.1.2'
5
+ VERSION = '3.0.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-landing
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1.2
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - moshinaan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-04-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email: