tramway-landing 3.1.0.4 → 3.1.0.5
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 +4 -4
- data/app/decorators/tramway/landing/block_decorator.rb +4 -3
- data/app/helpers/tramway/landing/application_helper.rb +16 -0
- data/app/views/tramway/landing/blocks/block_types/_footer.html.haml +2 -2
- data/app/views/tramway/landing/blocks/block_types/_header.html.haml +1 -1
- data/lib/tramway/landing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57f2d1b3f419bb1bb445ddbdaaeddfaff7e36ff793996ebdf01ee8ee02af12eb
|
4
|
+
data.tar.gz: a6b60de0abf7774981099ae62a6a6a9deea359ffc2a78df092eef19647d2ab1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a344b8c9013efd19eb212656411ba9a28551fba244886328fd515ebc32d832a90ad2a713ff71af926323ad2f8d3804286baebf772f88d6e91a9c6aab4ac54d29
|
7
|
+
data.tar.gz: 6125433fabb4a07aece199dd5b6c14ffe67c03e97a008fbbb8980a990e01bd6b2c1e21afdd545e74606aea648430cacb0033bf8fe4a636addb1b1acfabc44bdf
|
@@ -18,6 +18,7 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
|
|
18
18
|
end
|
19
19
|
|
20
20
|
decorate_association :forms
|
21
|
+
decorate_association :page
|
21
22
|
|
22
23
|
delegate_attributes :position, :title, :background, :anchor, :description, :view_name
|
23
24
|
|
@@ -57,9 +58,9 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def button
|
60
|
-
if object.button.present? && object.button['
|
61
|
-
content_tag :a, href: object.button['
|
62
|
-
object.button['
|
61
|
+
if object.button.present? && object.button['button_title'].present? && object.button['button_link'].present?
|
62
|
+
content_tag :a, href: object.button['button_link'], target: '_blank', class: 'btn btn-primary' do
|
63
|
+
object.button['button_title']
|
63
64
|
end
|
64
65
|
end
|
65
66
|
end
|
@@ -11,6 +11,22 @@ module Tramway
|
|
11
11
|
forms = forms.select { |f| f.form_name != 'user_sign_in' } if @signed_in
|
12
12
|
forms
|
13
13
|
end
|
14
|
+
|
15
|
+
def block_title(block)
|
16
|
+
if block.page.page_type.main?
|
17
|
+
(content_for?(:application_name) && yield(:application_name).present?) ? yield(:application_name) : @application.public_name
|
18
|
+
else
|
19
|
+
block.page.title
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def block_tagline(block)
|
24
|
+
if block.page.page_type.main?
|
25
|
+
(content_for?(:application_tagline) && yield(:application_tagline).present?) ? yield(:application_tagline) : @application.tagline
|
26
|
+
else
|
27
|
+
raw block.page.body
|
28
|
+
end
|
29
|
+
end
|
14
30
|
end
|
15
31
|
end
|
16
32
|
end
|
@@ -1,4 +1,4 @@
|
|
1
1
|
= javascript_include_tag 'tramway/landing/smooth-scroll'
|
2
|
-
= render 'tramway/landing/templates/full_page', block: OpenStruct.new(title:
|
2
|
+
= render 'tramway/landing/templates/full_page', block: OpenStruct.new(title: block_title(block), tagline: block_tagline(block), background: block.background), buttons: @links&.select { |link| !link.is_a? Hash }
|
3
3
|
%script
|
4
4
|
var scroll = new SmoothScroll('a[href*="#"]');
|