tramway-page 1.5.3.4 → 1.5.4.2

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: 597d7b82b9a142d39de22114e710dcbda2df5f3854aef0d489bd3b5053b971fa
4
- data.tar.gz: dc0d709e0cb0a326ec3dbd1a8c16f00c6c95f8ee53a4199034bf5106c3e7ddc9
3
+ metadata.gz: f54e0871574115ad5619fb16a4b4648f38379861dd54dcddc86e33de23cc8e83
4
+ data.tar.gz: 1d75e72402c883bd118dc421ede02f224ac44f5a1c997b1f16c4a2692f852b3e
5
5
  SHA512:
6
- metadata.gz: 685464ba40427820743885e46636ad309305e5ecba419051f914475a905cd384829c76f2620a6418eb4ddb5e60760487d5ecfb52adf2f5feb8d9fc8f1c1d2b43
7
- data.tar.gz: 9aefd9d322d53e253d8018d6d8bbb416eed6bac01aece0891ee9daa77f72ec25095f68591141c385d54bf4f289ae7f6d744fb87c057c57b917d1c136f5f74ecc
6
+ metadata.gz: 573e634a9584aff6f053d71ebe10f6f2142b727bc0adcac13036d1d88153449bb9ca9fbabf184cfe51256022a70052e72c9468d95b96488122be71f95b5585e7
7
+ data.tar.gz: 7f9f6a54822873972bda19e0a1d8e8039f086c901d5f2e86bce957f6a50f676bd7edf72e02c692be31f5b86f25f23616a2cd5204d2308be1e7daca7a0e5c64c6
@@ -4,7 +4,6 @@ class ::Tramway::Page::PagesController < ::Tramway::Page::ApplicationController
4
4
  layout 'tramway/landing/application'
5
5
 
6
6
  def show
7
- @application = ::Tramway::Core.application_object # FIXME need to be in the Tramway::Core::ApplicationController
8
7
  @page = ::Tramway::Page::Page.published.find_by slug: params[:slug]
9
8
  @blocks = @page.blocks.published.active.map do |block|
10
9
  if block.block_type.header_with_form? && block.form_url.present?
@@ -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]
@@ -8,16 +8,16 @@ class Tramway::Page::Page < ::Tramway::Core::ApplicationRecord
8
8
  scope :landings, -> { where page_type: :landing }
9
9
  scope :published, -> { where view_state: :published }
10
10
 
11
- state_machine :view_state, initial: :unpublished do
12
- state :unpublished
11
+ aasm :view_state, column: :view_state do
12
+ state :unpublished, initial: true
13
13
  state :published
14
14
 
15
15
  event :publish do
16
- transition unpublished: :published
16
+ transitions from: :unpublished, to: :published
17
17
  end
18
18
 
19
19
  event :hide do
20
- transition published: :unpublished
20
+ transitions from: :published, to: :unpublished
21
21
  end
22
22
  end
23
23
  end
@@ -1,4 +1,8 @@
1
1
  - if @page.view.present?
2
+ :css
3
+ nav.navbar {
4
+ display: none;
5
+ }
2
6
  = render "tramway/page/pages/views/#{@page.view}"
3
7
  - else
4
8
  - content_for :title do
@@ -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
- activerecord:
3
- state_machines:
4
- tramway/page/page:
5
- view_state:
6
- states:
7
- published: Видена
8
- unpublished: Скрыта
9
- events:
10
- publish: Показать на сайте
11
- hide: Скрыть с сайта
2
+ state_machines:
3
+ tramway/page/page:
4
+ view_state:
5
+ states:
6
+ published: Видена
7
+ unpublished: Скрыта
8
+ events:
9
+ publish: Показать на сайте
10
+ hide: Скрыть с сайта
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Page
5
- VERSION = '1.5.3.4'
5
+ VERSION = '1.5.4.2'
6
6
  end
7
7
  end
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
4
+ version: 1.5.4.2
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-06-23 00:00:00.000000000 Z
11
+ date: 2021-03-22 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.2
71
+ rubygems_version: 3.1.4
72
72
  signing_key:
73
73
  specification_version: 4
74
74
  summary: Summary of Tramway::Page.