tramway-page 1.4.2 → 1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/tramway/page/previews_controller.rb +19 -0
- data/app/decorators/tramway/page/page_decorator.rb +2 -2
- data/app/forms/admin/tramway/page/page_form.rb +1 -1
- data/app/models/tramway/page/page.rb +1 -1
- data/app/views/tramway/page/pages/show.html.haml +1 -6
- data/app/views/tramway/page/previews/show.html.haml +1 -0
- data/app/views/tramway/page/shared/_main_page_view.html.haml +6 -0
- data/config/routes.rb +1 -0
- data/lib/tramway/page/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9948e96dfbfea49716f38a9aac7279dfbbcd65add33ac110a6e79d04c74565c8
|
4
|
+
data.tar.gz: aa2bcc1dec2f02e431a5ca085c1ecdb5b8d2740c483746a7def1239a125e0f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32c31c105061b762ba9f871d226234b6a1ef3fd56ee29536e7ea161cec3bdbecb0ea8ce3178195ece82764ea3521ddffe9864c9df05e8ba8108fe2f53563cfa8
|
7
|
+
data.tar.gz: 28106f875e2f094a9895e1f47a208d6fcbab59ed44710e613814318d569da97e7759921ca08938029d45c716cbe51c9061c59a7ab82bbee31153c0a94ad3cde7
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ::Tramway::Page::PreviewsController < ::Tramway::Page::ApplicationController
|
4
|
+
include Tramway::AuthManagement
|
5
|
+
layout 'tramway/landing/application'
|
6
|
+
|
7
|
+
before_action :authenticate_admin!
|
8
|
+
|
9
|
+
def show
|
10
|
+
@page = ::Tramway::Page::Page.find params[:id]
|
11
|
+
@blocks = @page.blocks.active.map do |block|
|
12
|
+
if block.block_type.header_with_form? && block.form_url.present?
|
13
|
+
# FIXME in future
|
14
|
+
@header_with_form = block.form_to_render.new(Tramway::Auth.authenticable_models.first.new, page: @page.id)
|
15
|
+
end
|
16
|
+
::Tramway::Landing::BlockDecorator.decorate block
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -7,13 +7,13 @@ class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def show_associations
|
10
|
-
[
|
10
|
+
[:blocks]
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
delegate :title, to: :object
|
15
15
|
|
16
|
-
decorate_association :blocks, state_machines: [
|
16
|
+
decorate_association :blocks, state_machines: [:view_state]
|
17
17
|
|
18
18
|
def lead
|
19
19
|
object.body.first 200
|
@@ -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,
|
@@ -3,7 +3,7 @@
|
|
3
3
|
class Tramway::Page::Page < ::Tramway::Core::ApplicationRecord
|
4
4
|
has_many :blocks, class_name: 'Tramway::Landing::Block'
|
5
5
|
|
6
|
-
enumerize :page_type, in: [
|
6
|
+
enumerize :page_type, in: %i[main other], default: :other
|
7
7
|
|
8
8
|
scope :landings, -> { where page_type: :landing }
|
9
9
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
= render 'tramway/page/shared/main_page_view'
|
data/config/routes.rb
CHANGED
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: 1.
|
4
|
+
version: '1.5'
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Description of Tramway::Page.
|
14
14
|
email:
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- app/assets/stylesheets/tramway/page/application.css
|
26
26
|
- app/controllers/tramway/page/application_controller.rb
|
27
27
|
- app/controllers/tramway/page/pages_controller.rb
|
28
|
+
- app/controllers/tramway/page/previews_controller.rb
|
28
29
|
- app/decorators/tramway/page/page_decorator.rb
|
29
30
|
- app/forms/admin/tramway/page/page_form.rb
|
30
31
|
- app/helpers/tramway/page/application_helper.rb
|
@@ -33,6 +34,8 @@ files:
|
|
33
34
|
- app/models/tramway/page/page.rb
|
34
35
|
- app/views/tramway/page/pages/show.html.haml
|
35
36
|
- app/views/tramway/page/pages/views/_article.html.haml
|
37
|
+
- app/views/tramway/page/previews/show.html.haml
|
38
|
+
- app/views/tramway/page/shared/_main_page_view.html.haml
|
36
39
|
- config/initializers/tramway.rb
|
37
40
|
- config/locales/models.yml
|
38
41
|
- config/routes.rb
|