tramway-landing 1.3.6 → 1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b8ae53ed49fccd5be8e6c7006a4698e794132e57070df7af37c1b6fdcd74098
|
4
|
+
data.tar.gz: b27217f06c5ed82309ad17b6b502911c2d9bc73b965e9c9915b95f2d3ab4276e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b78c63050d57dbbd7305545a0d1c59a589801ec818f9ac344f5d56c866f6f45cc495d9928a49c09b3cca51e8b718eaa741963535a74596e0466550519d2054b
|
7
|
+
data.tar.gz: 48ba7c0b5d4eddf270c4fff05b22a9adc212f70c08fcf683363b48af347114d82f68eedc0038830090577096f5b17193e91cc322ef0f232046a7187133a7248e
|
@@ -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
|
-
|
11
|
-
|
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*="#"]');
|
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.
|
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-
|
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
|