tramway-page 1.3.1.2 → 1.4

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: 352c8fff69216736da625c664efdbd4d47b97065ed4590f2135f33119cb9e853
4
- data.tar.gz: af446ae307ed4f30b545463d4f30c4f92cf0db0beeff90a66a00d5a9b8d520f7
3
+ metadata.gz: a1965d93d821932f6bfd8722be71212d2eecad82f8b7d10a23a35f92f214065c
4
+ data.tar.gz: 41a9bbe1bb5742dd464239e05a0141db8104844db9dfb912fff715846a73cca9
5
5
  SHA512:
6
- metadata.gz: 2e2aa019706803074048129cd23ef01892881f08441f9deb6a0c16764a96ceffb5bad98dc0f70be641e567fcf6873471e4834e905a9fac36216e4f1ad5bac0b0
7
- data.tar.gz: 559d06baab8cd6fc5e2d4fb63147afc3113cbb1e4105db8f6d603e506363064a4f8573a702f55fa191cf32fd71a294d75883cdb3a8557d38d1cbba3d9417ac6e
6
+ metadata.gz: 077a64fe57736ce4211b1d862f51efe5aa13be68c51780775f06ee029cdeab71bf8e9452626d4586e15aa8c2671e0764dfe5ba92cd4685e9fa3354dcf3929253
7
+ data.tar.gz: 84470d8efb6e415e9cc2baf9824206274405786edc36a974d9a1a73fd2f612880e8c7035739c83f65d61c196dde4c5f1e754bbd75854fbe12cb0bfab10250a8b
@@ -5,5 +5,6 @@ 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 = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.active.where('values @> ?', { page: @page.id.to_s }.to_json)
8
9
  end
9
10
  end
@@ -18,6 +18,6 @@ class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
18
18
  end
19
19
 
20
20
  def public_path
21
- Tramway::Page::Engine.routes.url_helpers.page_path object.slug
21
+ Tramway::Page::Engine.routes.url_helpers.page_path slug: object.slug
22
22
  end
23
23
  end
@@ -1,11 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Admin::Tramway::Page::PageForm < ::Tramway::Core::ApplicationForm
4
- properties :title, :body, :slug, :view
4
+ properties :title, :body, :slug, :view, :page_type
5
5
 
6
6
  def initialize(object)
7
7
  super(object).tap do
8
8
  form_properties title: :string,
9
+ page_type: {
10
+ type: :default,
11
+ input_options: {
12
+ hint: "Body and View fields will be ignored in Landing page type. You will configurate it with Blocks"
13
+ }
14
+ },
9
15
  body: :ckeditor,
10
16
  slug: :string,
11
17
  view: :string
@@ -1,4 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Tramway::Page::Page < ::Tramway::Core::ApplicationRecord
4
+ enumerize :page_type, in: [ :custom, :landing ], default: :custom
5
+
6
+ scope :landings, -> { where page_type: :landing }
4
7
  end
@@ -19,6 +19,7 @@ module Tramway::Page::Generators
19
19
  migrations = %i[
20
20
  create_tramway_page_pages
21
21
  add_view_to_tramway_page_pages
22
+ add_page_type_to_tramway_page_pages
22
23
  ]
23
24
  migrations.each do |migration|
24
25
  migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddPageTypeToTramwayPagePages < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_column :tramway_page_pages, :page_type, :text
6
+ end
7
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Page
5
- VERSION = '1.3.1.2'
5
+ VERSION = '1.4'
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.3.1.2
4
+ version: '1.4'
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-03-31 00:00:00.000000000 Z
11
+ date: 2020-04-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Description of Tramway::Page.
14
14
  email:
@@ -40,6 +40,7 @@ files:
40
40
  - lib/tramway/page.rb
41
41
  - lib/tramway/page/engine.rb
42
42
  - lib/tramway/page/generators/install_generator.rb
43
+ - lib/tramway/page/generators/templates/add_page_type_to_tramway_page_pages.rb
43
44
  - lib/tramway/page/generators/templates/add_view_to_tramway_page_pages.rb
44
45
  - lib/tramway/page/generators/templates/create_tramway_page_pages.rb
45
46
  - lib/tramway/page/version.rb