tramway-landing 3.1.1.9 → 3.2.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: a44989414fa9ea2683c413dab6d7c4754827c59b6521bdbd7d904d8322a6d125
4
- data.tar.gz: 07e739b85750986aca9c90fb7b1ff53341c800fd4939db4236045c66e4d0ec49
3
+ metadata.gz: 3f1d39d83c76954bd7017c0fe486c14abfe80196382dd09e7ea98bf5e876ca3c
4
+ data.tar.gz: 643f56984b540a39fa2ef99e7860bbd2512b5e8867af569ec9af87dd24cb2361
5
5
  SHA512:
6
- metadata.gz: f1086cb5b3b878f65a8042e19763b8483984461cb04321135f21cb3a61b084fbec7ade774dcb52e8bcfa52901590fd1e726df337f5fee8950cedf5049f612b15
7
- data.tar.gz: ac552528b5ec8cfe5c8fdc6b6d369b746b17083d92984743396513d718c5618c28f0293880806cfc6c310d2bd53ebe9c18ee3eb23191129d17c5332f7249ea47
6
+ metadata.gz: 51dca16a03148c007a512241d62f9b1c287d79269ccd1c1130b657b15dcf1c11b1e539b25f7967f78daf5dabbcbae335650880c8de15409d37031281531b0d43
7
+ data.tar.gz: 20a42a2c6c5e04fb034a5bc65449cbdf5b460157afb03c9657802c20e9495099c22ffb9a4423ca818af5e27eb44777dc5a3788b8b1f499a6d921dd9a37fdcb88
@@ -8,12 +8,12 @@ $(document).ready(function() {
8
8
  });
9
9
 
10
10
  const iframe_selectors_for_video = ['iframe[src*="vk.com"]', 'iframe[src*="youtu.be"]', 'iframe[src*="youtube.com"]'];
11
- for (const selector in iframe_selectors_for_video) {
11
+ iframe_selectors_for_video.forEach(function(selector) {
12
12
  $(selector).each(function() {
13
13
  width = $(this).parents('div').first().width();
14
14
  height = width / 16 * 9;
15
15
  $(this).width(width);
16
16
  $(this).height(height);
17
17
  });
18
- }
18
+ })
19
19
  });
@@ -13,8 +13,6 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
13
13
  def show_associations
14
14
  [:forms]
15
15
  end
16
-
17
- delegate :human_view_state_event_name, to: :model_class
18
16
  end
19
17
 
20
18
  decorate_association :forms
@@ -39,7 +37,7 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
39
37
  end
40
38
 
41
39
  def view_state
42
- object.human_view_state_name
40
+ object.view_state
43
41
  end
44
42
 
45
43
  def link
@@ -20,18 +20,22 @@ module Tramway
20
20
  else
21
21
  if block.page.page_type.main?
22
22
  content_for?(:application_name) && content_for(:application_name).present? ? content_for(:application_name) : @application.public_name
23
+ else
24
+ block.page.title
23
25
  end
24
26
  end
25
27
  end
26
28
 
27
29
  def block_tagline(block)
28
- unless block.is_a? Array
30
+ if block.is_a? Array
31
+ block.each do |_current_block|
32
+ raw _current_block.page.body
33
+ end
34
+ else
29
35
  if block.page.page_type.main?
30
36
  content_for?(:application_tagline) && content_for(:application_tagline).present? ? content_for(:application_tagline) : @application.tagline
31
37
  else
32
- block.each do |_current_block|
33
- raw block.page.body
34
- end
38
+ raw block.page.body
35
39
  end
36
40
  end
37
41
  end
@@ -10,16 +10,16 @@ class Tramway::Landing::Block < ::Tramway::Landing::ApplicationRecord
10
10
 
11
11
  uploader :background, :photo, extensions: %i[jpg jpeg gif png]
12
12
 
13
- state_machine :view_state, initial: :published do
14
- state :published
13
+ aasm :view_state do
14
+ state :published, initial: true
15
15
  state :hidden
16
16
 
17
17
  event :publish do
18
- transition hidden: :published
18
+ transitions from: :hidden, to: :published
19
19
  end
20
20
 
21
21
  event :hide do
22
- transition published: :hidden
22
+ transitions from: :published, to: :hidden
23
23
  end
24
24
  end
25
25
 
@@ -1,16 +1,17 @@
1
- %nav.navbar.navbar-expand-lg.navbar-dark.indigo.scrolling-navbar.fixed-top
2
- = link_to @application.public_name || yield(:application_name), '/', class: 'navbar-brand'
3
- %button.navbar-toggler{ type: :button, data: { toggle: :collapse, target: '#navbarSupportedContent' }, aria: { controls: 'navbarSupportedContent', expanded: 'false', label: 'Toggle navigation' } }
4
- - if @links&.any?
5
- = fa_icon :bars
6
- .collapse.navbar-collapse#navbarSupportedContent
7
- - left_links = @links.is_a?(Hash) ? @links[:left] : @links
8
- - if left_links&.any?
9
- %ul.navbar-nav.mr-auto
10
- - left_links.each do |link|
11
- = render 'layouts/tramway/landing/navbar/link', link: link
12
- - right_links = @links.is_a?(Hash) ? @links.dig(:right) : []
13
- - if right_links&.any?
14
- %ul.navbar-nav.ml-auto
15
- - right_links.each do |link|
16
- = render 'layouts/tramway/landing/navbar/link', link: link
1
+ - if Tramway::Landing.navbar_for(@application_engine || @application.name)
2
+ %nav.navbar.navbar-expand-lg.navbar-dark.indigo.scrolling-navbar.fixed-top
3
+ = link_to @application.public_name || yield(:application_name), '/', class: 'navbar-brand'
4
+ %button.navbar-toggler{ type: :button, data: { toggle: :collapse, target: '#navbarSupportedContent' }, aria: { controls: 'navbarSupportedContent', expanded: 'false', label: 'Toggle navigation' } }
5
+ - if @links&.any?
6
+ = fa_icon :bars
7
+ .collapse.navbar-collapse#navbarSupportedContent
8
+ - left_links = @links.is_a?(Hash) ? @links[:left] : @links
9
+ - if left_links&.any?
10
+ %ul.navbar-nav.mr-auto
11
+ - left_links.each do |link|
12
+ = render 'layouts/tramway/landing/navbar/link', link: link
13
+ - right_links = @links.is_a?(Hash) ? @links.dig(:right) : []
14
+ - if right_links&.any?
15
+ %ul.navbar-nav.ml-auto
16
+ - right_links.each do |link|
17
+ = render 'layouts/tramway/landing/navbar/link', link: link
@@ -1,7 +1,7 @@
1
1
  - if link.is_a? Hash
2
2
  .nav-item.dropdown
3
3
  %a.nav-link.dropdown-toggle.scrollable{id: "dropdown_menu_button_#{link.keys.first}", aria: { expanded: :false, haspopup: :true }, data: { toggle: :dropdown } }
4
- = link.keys.first
4
+ = t("navbar.links.#{link.keys.first}")
5
5
  .dropdown-menu.dropdown-primary.scrollable{ aria: { labelledby: "dropdown_menu_button_#{link.keys.first}" } }
6
6
  - link.values.first.each do |menu_item|
7
7
  = link_to menu_item.title, menu_item.link, class: 'dropdown-item'
@@ -1,5 +1,9 @@
1
1
  .row.page{ id: block.anchor }
2
2
  .col-md-7
3
- = image_tag block.background.url, class: 'img-fluid'
3
+ - if block.background.present?
4
+ - background_url = block.background.is_a?(String) ? block.background : block.background.url
5
+ = image_tag background_url, class: 'img-fluid'
6
+ - else
7
+ - raise "Block background should valid image URL or PhotoUploader object. Block: #{block}"
4
8
  .col-md-5{ style: 'text-align: justify' }
5
9
  = render 'tramway/landing/templates/text', block: block
@@ -14,6 +14,15 @@ module Tramway
14
14
  def head_content
15
15
  (defined?(@@head_content) && @@head_content) || []
16
16
  end
17
+
18
+ def set_navbar(bool, project:)
19
+ @@navbars ||= {}
20
+ @@navbars.merge! project => bool
21
+ end
22
+
23
+ def navbar_for(project)
24
+ @@navbars.with_indifferent_access[project]
25
+ end
17
26
  end
18
27
  end
19
28
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Landing
5
- VERSION = '3.1.1.9'
5
+ VERSION = '3.2.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.1.1.9
4
+ version: 3.2.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-09-10 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email: