tramway-page 1.4 → 1.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1cbea56bbf0d6591b925fe452014620ff8b7d86455513594c6b8f05bce3979e
|
4
|
+
data.tar.gz: 6d211b20569f271b391f895adad6989d14913eccafc56ec1abd5e9e2d922cdf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8b2e229afc065d945fe9ca9e47e87345b4c34e54a2ed09096db1b99004dff7bb40f33b815b52c052900362d692fe69e78d8f7d8cd557440cc62033aa45d24f6
|
7
|
+
data.tar.gz: 41d82c1b5a68039374ef17b5752fad5ce51d03d9a5949f32282ece73a1f50e716abc6eb6ff5d68a1dbc68cf70df66888f4abace63fc9e1b8d6a8868741f90c53
|
@@ -5,6 +5,12 @@ class ::Tramway::Page::PagesController < ::Tramway::Page::ApplicationController
|
|
5
5
|
|
6
6
|
def show
|
7
7
|
@page = ::Tramway::Page::Page.find_by slug: params[:slug]
|
8
|
-
@blocks =
|
8
|
+
@blocks = @page.blocks.active.map do |block|
|
9
|
+
if block.block_type.header_with_form? && block.form_url.present?
|
10
|
+
# FIXME in future
|
11
|
+
@header_with_form = block.form_to_render.new(Tramway::Auth.authenticable_models.first.new)
|
12
|
+
end
|
13
|
+
::Tramway::Landing::BlockDecorator.decorate block
|
14
|
+
end
|
9
15
|
end
|
10
16
|
end
|
@@ -5,10 +5,16 @@ class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
|
|
5
5
|
def collections
|
6
6
|
[:all]
|
7
7
|
end
|
8
|
+
|
9
|
+
def show_associations
|
10
|
+
[ :blocks ]
|
11
|
+
end
|
8
12
|
end
|
9
13
|
|
10
14
|
delegate :title, to: :object
|
11
15
|
|
16
|
+
decorate_association :blocks, state_machines: [ :view_state ]
|
17
|
+
|
12
18
|
def lead
|
13
19
|
object.body.first 200
|
14
20
|
end
|
@@ -9,7 +9,7 @@ class Admin::Tramway::Page::PageForm < ::Tramway::Core::ApplicationForm
|
|
9
9
|
page_type: {
|
10
10
|
type: :default,
|
11
11
|
input_options: {
|
12
|
-
hint: "
|
12
|
+
hint: "View field will be ignored in Landing page type. You will configurate it with Blocks"
|
13
13
|
}
|
14
14
|
},
|
15
15
|
body: :ckeditor,
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Tramway::Page::Page < ::Tramway::Core::ApplicationRecord
|
4
|
-
|
4
|
+
has_many :blocks, class_name: 'Tramway::Landing::Block'
|
5
|
+
|
6
|
+
enumerize :page_type, in: [ :main, :other ], default: :other
|
5
7
|
|
6
8
|
scope :landings, -> { where page_type: :landing }
|
7
9
|
end
|
data/lib/tramway/page/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-page
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Description of Tramway::Page.
|
14
14
|
email:
|