tramway-landing 1.3.6 → 1.4

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: '0159288ae983c94ad8f8ebb8e6ff64903c083b96be4b66bd6d97d901c4a40d08'
4
- data.tar.gz: 417baf20f963477b209965e47b5013e0f10ccf13cff65abcd19e6754d2561845
3
+ metadata.gz: 2b8ae53ed49fccd5be8e6c7006a4698e794132e57070df7af37c1b6fdcd74098
4
+ data.tar.gz: b27217f06c5ed82309ad17b6b502911c2d9bc73b965e9c9915b95f2d3ab4276e
5
5
  SHA512:
6
- metadata.gz: ece758a59707b34375a38ed7772e3dbb8124a2a99b2259e5434bfc92a7f1cf88528f1de8fbea4fdded19d6e6d3d5f0fdad6c703631c06e1c7cde4f7d74d441a1
7
- data.tar.gz: 9142b028c4c99bef334672403e8de5d726ac5aad3ea802b1d634a1c89a2d207a44a357628faba699bc329efbb7f7334517c23243c5153f156a60198a524fc0be
6
+ metadata.gz: 6b78c63050d57dbbd7305545a0d1c59a589801ec818f9ac344f5d56c866f6f45cc495d9928a49c09b3cca51e8b718eaa741963535a74596e0466550519d2054b
7
+ data.tar.gz: 48ba7c0b5d4eddf270c4fff05b22a9adc212f70c08fcf683363b48af347114d82f68eedc0038830090577096f5b17193e91cc322ef0f232046a7187133a7248e
@@ -0,0 +1,5 @@
1
+ class Tramway::Landing::LinkDecorator < ::Tramway::Core::ApplicationDecorator
2
+ def title; end
3
+
4
+ def link; end
5
+ end
@@ -0,0 +1,30 @@
1
+ class Tramway::Landing::NavbarDecorator < ::Tramway::Core::ApplicationDecoratedCollection
2
+ def initialize(array)
3
+ original = if array.any? { |obj| obj.is_a? Hash }
4
+ get_original_array array
5
+ else
6
+ array
7
+ end
8
+ super array, original
9
+ end
10
+
11
+ def original_array
12
+ get_original_array @original_array
13
+ end
14
+
15
+ def dropdown_title
16
+ object.keys.first
17
+ end
18
+
19
+ private
20
+
21
+ def get_original_array(arr)
22
+ arr.reduce([]) do |array, obj|
23
+ if obj.is_a? Hash
24
+ array += obj.values.first.original_array
25
+ else
26
+ array << obj
27
+ end
28
+ end
29
+ end
30
+ end
@@ -7,7 +7,15 @@
7
7
  .collapse.navbar-collapse#navbarSupportedContent
8
8
  %ul.navbar-nav.mr-auto
9
9
  - @links.each do |link|
10
- = menu_item link.title, link.link
11
- = render 'tramway/landing/blocks/templates/full_page', block: header_block(block, title: yield(:application_name), tagline: yield(:application_tagline)), buttons: @links
10
+ - if link.is_a? Hash
11
+ .nav-item.dropdown
12
+ %a.nav-link.dropdown-toggle{ id: "dropdown_menu_button_#{link.keys.first}", aria: { expanded: :false, haspopup: :true }, data: { toggle: :dropdown } }
13
+ = t(".#{link.keys.first}")
14
+ .dropdown-menu.dropdown-primary{ aria: { labelledby: "dropdown_menu_button_#{link.keys.first}" } }
15
+ - link.values.first.each do |menu_item|
16
+ = link_to menu_item.title, menu_item.link, class: 'dropdown-item'
17
+ - else
18
+ = menu_item link.title, link.link
19
+ = render 'tramway/landing/blocks/templates/full_page', block: header_block(block, title: yield(:application_name), tagline: yield(:application_tagline)), buttons: @links.select { |link| !link.is_a? Hash }
12
20
  %script
13
21
  var scroll = new SmoothScroll('a[href*="#"]');
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Landing
3
- VERSION = '1.3.6'
3
+ VERSION = '1.4'
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.3.6
4
+ version: '1.4'
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-11-23 00:00:00.000000000 Z
11
+ date: 2018-11-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email:
@@ -32,6 +32,8 @@ files:
32
32
  - app/decorators/tramway/landing/block_decorator.rb
33
33
  - app/decorators/tramway/landing/block_types/cards_decorator.rb
34
34
  - app/decorators/tramway/landing/block_types/features_decorator.rb
35
+ - app/decorators/tramway/landing/link_decorator.rb
36
+ - app/decorators/tramway/landing/navbar_decorator.rb
35
37
  - app/forms/tramway/landing/block_form.rb
36
38
  - app/helpers/tramway/landing/application_helper.rb
37
39
  - app/jobs/tramway/landing/application_job.rb