tramway-page 1.5.3.7 → 1.5.4.3
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/pages_controller.rb +1 -1
- data/app/controllers/tramway/page/previews_controller.rb +1 -1
- data/app/decorators/tramway/page/page_decorator.rb +14 -0
- data/app/views/tramway/page/shared/_main_page_view.html.haml +4 -0
- data/config/initializers/tramway.rb +0 -17
- data/config/locales/ru.state_machines.yml +9 -10
- data/lib/tramway/page/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f487df54faccc19946d7ee8be17f1ff1c93af30b2280b78e93395376cdaa4fc9
|
4
|
+
data.tar.gz: be7998669fac8f6aa1624c0c4e98a8e534eef2a9b1588a0d22a995dfffca650d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c8c196704649ad27b3a323c0a32e9088824abb3d9baea9fb77b6de2dc53efa51915a4d3418adc6f4d55a61745ab5c02a254bf9e79c8e952f648c198e4f15e79
|
7
|
+
data.tar.gz: 579fee668c314266c8c81cdb5302218e0a22d1d3b3a5125d4ce30c96cab49bebb9ecad127fe8baa4a49805ce303fc78da28f18694d09f45b6e6778854e731a05
|
@@ -5,7 +5,7 @@ class ::Tramway::Page::PagesController < ::Tramway::Page::ApplicationController
|
|
5
5
|
|
6
6
|
def show
|
7
7
|
@page = ::Tramway::Page::Page.published.find_by slug: params[:slug]
|
8
|
-
@blocks = @page.blocks.published.
|
8
|
+
@blocks = @page.blocks.published.map do |block|
|
9
9
|
if block.block_type.header_with_form? && block.form_url.present?
|
10
10
|
# FIXME: in future
|
11
11
|
@header_with_form = block.form_to_render.new(Tramway::Auth.authenticable_models.first.new, page: @page.id)
|
@@ -8,7 +8,7 @@ class ::Tramway::Page::PreviewsController < ::Tramway::Page::ApplicationControll
|
|
8
8
|
|
9
9
|
def show
|
10
10
|
@page = ::Tramway::Page::Page.find params[:id]
|
11
|
-
@blocks = @page.blocks.
|
11
|
+
@blocks = @page.blocks.map do |block|
|
12
12
|
if block.block_type.header_with_form? && block.form_url.present?
|
13
13
|
# FIXME: in future
|
14
14
|
@header_with_form = block.form_to_render.new(Tramway::Auth.authenticable_models.first.new, page: @page.id)
|
@@ -9,9 +9,23 @@ class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
|
|
9
9
|
def show_associations
|
10
10
|
[:blocks]
|
11
11
|
end
|
12
|
+
|
12
13
|
delegate :human_view_state_event_name, to: :model_class
|
13
14
|
end
|
14
15
|
|
16
|
+
def additional_buttons
|
17
|
+
{
|
18
|
+
show: [
|
19
|
+
{
|
20
|
+
url: Tramway::Page::Engine.routes.url_helpers.preview_path(id: object.id),
|
21
|
+
method: :get,
|
22
|
+
text: 'Preview',
|
23
|
+
color: :primary
|
24
|
+
}
|
25
|
+
]
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
15
29
|
delegate_attributes :title, :page_type, :body
|
16
30
|
|
17
31
|
decorate_association :blocks, state_machines: [:view_state]
|
@@ -1,20 +1,3 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
::Tramway::Admin.set_available_models(::Tramway::Page::Page, project: :page)
|
4
|
-
::Tramway::Admin.set_additional_buttons(
|
5
|
-
{
|
6
|
-
::Tramway::Page::Page => {
|
7
|
-
show: [
|
8
|
-
lambda { |record|
|
9
|
-
{
|
10
|
-
url: Tramway::Page::Engine.routes.url_helpers.preview_path(id: record.id),
|
11
|
-
method: :get,
|
12
|
-
text: 'Preview',
|
13
|
-
color: :primary
|
14
|
-
}
|
15
|
-
}
|
16
|
-
]
|
17
|
-
}
|
18
|
-
},
|
19
|
-
project: :subberz
|
20
|
-
)
|
@@ -1,11 +1,10 @@
|
|
1
1
|
ru:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
hide: Скрыть с сайта
|
2
|
+
state_machines:
|
3
|
+
tramway/page/page:
|
4
|
+
view_state:
|
5
|
+
states:
|
6
|
+
published: Видена
|
7
|
+
unpublished: Скрыта
|
8
|
+
events:
|
9
|
+
publish: Показать на сайте
|
10
|
+
hide: Скрыть с сайта
|
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.5.3
|
4
|
+
version: 1.5.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Description of Tramway::Page.
|
14
14
|
email:
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
|
-
rubygems_version: 3.1
|
71
|
+
rubygems_version: 3.0.3.1
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: Summary of Tramway::Page.
|