tramway-landing 1.2.7 → 1.2.8

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: b7fea3e7b5b22978f266be26c504f87a6b5910a5b293e3dc6925e726ca999847
4
- data.tar.gz: 1adb65923086c06bfcc6f5226fd2266bb720dc46a488ceb2cf4a3ea721ccd2e6
3
+ metadata.gz: 501a71dcbc71727af3cb1d409abe13b27ea31d884c40b6733e9e6e0ef2d0a409
4
+ data.tar.gz: 6a1b90dc4b3ddaa58ec8237dc65ebcc307e88e81c92edd8674734b683cd21129
5
5
  SHA512:
6
- metadata.gz: e4c8265c9a4a9f6ccf1722870ec42579050b773b62934f9351959e36fef43ee452417c7f9e25f849ac78f177ef267bbb92d70276f767a85b7e1ab95c826a6cbb
7
- data.tar.gz: 1fccec0fbe57b970ecfe2ce3adc0ae863f3f1cdbd922fce76e3654114c96b8370ccd55e0f74cda9b66a4484d464e5ecb0c7c43004f406b5b53bb0cbdfcb60a91
6
+ metadata.gz: '08fd152cbb5e28c11bd7a0e736bba90d944473144ec1fac3661600f1309f0a2da3af84e3b4af0f030c266bd0a917f9bb03e747c8fdb9717f5fe2350299e842ff'
7
+ data.tar.gz: e811456823d985f25ab0320ad3d475b3326a359c2ec4d4e7a12cb48195abb6504a5075cdd960a8fe4e0ca103c11022ad08fdac6d7ba719b79b853d3249b2eedd
@@ -10,6 +10,8 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
10
10
  end
11
11
 
12
12
  delegate :position, to: :object
13
+ delegate :title, to: :object
14
+ delegate :background, to: :object
13
15
 
14
16
  def block_type
15
17
  object.block_type_text
@@ -19,6 +21,10 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
19
21
  object.human_view_state_name
20
22
  end
21
23
 
24
+ def link
25
+ "##{object.anchor}"
26
+ end
27
+
22
28
  def view_state_button_color(event)
23
29
  case event
24
30
  when :publish
@@ -48,16 +48,16 @@
48
48
  = javascript_include_tag 'https://cdn.rawgit.com/CezarLuiz0/anchor.js/master/dist/anchor.min.js'
49
49
  - if @blocks&.any?
50
50
  -# FIXME
51
- = render "tramway/landing/blocks/block_types/header", block: @blocks.on_main_page.where(block_type: :header).first
51
+ = render "tramway/landing/blocks/block_types/header", block: @blocks.select { |block| block.model.block_type.header? }.first
52
52
  %main{ class: ('mt-5' if @blocks&.any?) }
53
53
  .container
54
54
  - if @blocks&.any?
55
- - array_of_blocks = (@blocks - [@blocks.header] - [@blocks.footer])
56
- - array_of_blocks.each_with_index do |block, index|
57
- = render "tramway/landing/blocks/block_types/#{block.block_type}", block: block
58
- - if index < array_of_blocks.count - 1
59
- %hr
55
+ - @blocks.each_with_index do |block, index|
56
+ - if !block.model.block_type.header? && !block.model.block_type.footer?
57
+ = render "tramway/landing/blocks/block_types/#{block.block_type}", block: block
58
+ - if index < array_of_blocks.count - 1
59
+ %hr
60
60
  .container-fluid
61
61
  = yield
62
62
  - if @blocks&.any?
63
- = render "tramway/landing/blocks/block_types/footer", block: @blocks.footer
63
+ = render "tramway/landing/blocks/block_types/footer", block: @blocks.select { |block| block.model.block_type.footer? }.first
@@ -7,8 +7,8 @@
7
7
  = fa_icon :bars
8
8
  .collapse.navbar-collapse#navbarSupportedContent
9
9
  %ul.navbar-nav.mr-auto
10
- - @blocks.with_navbar_link.each do |block|
11
- = menu_item block.title, "##{block.anchor}"
10
+ - @links.each do |link|
11
+ = menu_item link.title, link.link
12
12
  - if block
13
13
  #intro.view.hm-black-strong{ style: "background-image: url('#{block.background.url}')" }
14
14
  .container-fluid.full-bg-img.d-flex.align-items-center.justify-content-center
@@ -19,8 +19,8 @@
19
19
  %hr.hr-light
20
20
  %h4.white-text.my-4
21
21
  = yield(:application_tagline)
22
- - @blocks.with_navbar_link.each do |block|
23
- %button.btn.btn-outline-white.waves-effect.waves-light.header-buttons{ type: :button, data: { anchor: "##{block.anchor}" } }
24
- = block.title
22
+ - @links.each do |link|
23
+ %button.btn.btn-outline-white.waves-effect.waves-light.header-buttons{ type: :button, data: { anchor: "##{link.link}" } }
24
+ = link.title
25
25
  %script
26
26
  var scroll = new SmoothScroll('a[href*="#"]');
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Landing
3
- VERSION = '1.2.7'
3
+ VERSION = '1.2.8'
4
4
  end
5
5
  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: 1.2.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-21 00:00:00.000000000 Z
11
+ date: 2018-09-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email: