tramway-landing 3.1.1.10 → 3.2.0.3

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: 6357cedad3d2422008f3d4e6bad426889c79ece0e777041fe34988f72536b757
4
- data.tar.gz: be5301c2c4dfc3e64ca2db13b6e8d4b3bf69f1e82388ad99f8139a48dc55968d
3
+ metadata.gz: 9049dba4967149cb1ee00c67192845a31730ca9421a416f5d3244bbc148cdace
4
+ data.tar.gz: 9791a682642002981bf6d07ba7156ec323df728a65ee209318179a90de8ce48f
5
5
  SHA512:
6
- metadata.gz: 9caf4587006b41ca494e6af23b18bbd383213c99ac61a47a802c70f4e8483aaf03ed452998b4e27865d0b0e1e59b3e15d8f10311bc6e0f1615f4f39bf624014b
7
- data.tar.gz: 0dcc7a118571778183d033984de220038de36ba3808c7647652487cd2c6963c6572e54dedda32d10922a970fd38c52b60c57a9cfbaf1db5821fec33ff81912eb
6
+ metadata.gz: cf3e443a1a10e4d29f9fce38308e254aa10d83e9397f68e0a4aec9e317f13bc75c59c011355e343129694536a1794658cc71532d66e8b6f43ea5b6ec0709496c
7
+ data.tar.gz: 924a4a230033865f9c0a52994c1639ce33c0e684f23506e4aba8f96171c616ad91138c0594c485ce2c6ab6068724f5395e2964c278c02b2f6968d80e24bf507c
@@ -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,5 +1,5 @@
1
1
  %meta{ content: 'text/html; charset=UTF-8', http: { equiv: 'Content-Type' } }
2
2
  %meta{ content: "width=device-width, initial-scale=1, maximum-scale=0.8", name: "viewport" }
3
- - main_image = @application.main_image.present? ? "/#{@application.main_image}" : yield(:main_image)
3
+ - main_image = @application&.main_image.present? ? "/#{@application.main_image}" : yield(:main_image)
4
4
  %meta{ property: 'vk:image', content: main_image }
5
5
  %meta{ property: 'og:image', content: main_image }
@@ -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
@@ -10,11 +10,11 @@
10
10
  = javascript_include_tag 'https://code.jquery.com/jquery-3.2.1.slim.min.js', integrity: 'sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN', crossorigin: 'anonymous'
11
11
  = javascript_include_tag 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js', integrity: 'sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q', crossorigin: 'anonymous'
12
12
  = csrf_meta_tags
13
- - if @application.favicon.present?
13
+ - if @application&.favicon.present?
14
14
  = favicon_link_tag @application.favicon
15
15
  - ::Tramway::Landing.head_content.each do |content|
16
16
  - self.instance_exec &content
17
- %body{ class: @application.name }
17
+ %body{ class: @application&.name }
18
18
  = stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/css/mdb.min.css'
19
19
  = javascript_include_tag 'https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/js/mdb.js'
20
20
  = javascript_include_tag 'https://cdn.rawgit.com/CezarLuiz0/anchor.js/master/dist/anchor.min.js'
@@ -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.10'
5
+ VERSION = '3.2.0.3'
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.10
4
+ version: 3.2.0.3
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-15 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: