tramway-page 1.1.2 → 1.3

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: cf268b551cb77336eda00852cb4140612d9bfc96eb16bae6ebc38051fd39adcd
4
- data.tar.gz: ce67831742a002aea8772aa7c3d868083dac14d6ce5f76f41d9edb8fc2d04491
3
+ metadata.gz: d2b93651091515ca7189e47beca79ad1298a72dead84e437eb69c1d2c989e443
4
+ data.tar.gz: df5bd4d45a263db057dec974fd1b6036df09e5f3e5b7710c91a7e23436243feb
5
5
  SHA512:
6
- metadata.gz: 0f43e1dc4183e0195a5e33cf05a6763aa3d033d0d982ce79cb09a4579919b2780c138f37ca9ced9846edb4fde43b90fc6f0411a6980a382ff3f95dea42ff4663
7
- data.tar.gz: a07df8a039ce704ad2f3e53bcfe374ecb72da0cf7160a2cedb8849bfdaea77ba62f50bceb90cba9859fde19aeac09ca5817cc04834d1fce5e2f9b3f1848cc133
6
+ metadata.gz: b9cf310446fd69927204ba5bdf1fa0145c88a53abfeedac740f765553794b57d4e8edcb7e13ce759c7aba7002be8c3d3782f732e5cd0d9328af7f994537c030b
7
+ data.tar.gz: bde4179419cec974680341dff947871106abd6ef051d72328d11910a7a7d9aeb5774101a1d36af282cf56dce861ad80158b5fec35e26a13d8b810c9c70f333a3
@@ -5,6 +5,8 @@ class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
5
5
  end
6
6
  end
7
7
 
8
+ delegate :title, to: :object
9
+
8
10
  def lead
9
11
  object.body.first 200
10
12
  end
@@ -12,4 +14,8 @@ class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
12
14
  def link
13
15
  Tramway::Page::Engine.routes.url_helpers.page_path slug: object.slug
14
16
  end
17
+
18
+ def public_path
19
+ Tramway::Page::Engine.routes.url_helpers.page_path object.slug
20
+ end
15
21
  end
@@ -1,11 +1,12 @@
1
1
  class Tramway::Page::PageForm < ::Tramway::Core::ApplicationForm
2
- properties :title, :body, :slug
2
+ properties :title, :body, :slug, :view
3
3
 
4
4
  def initialize(object)
5
- form_object = super object
6
- form_properties title: :string,
7
- body: :default,
8
- slug: :string
9
- form_object
5
+ super(object).tap do
6
+ form_properties title: :string,
7
+ body: :ckeditor,
8
+ slug: :string,
9
+ view: :string
10
+ end
10
11
  end
11
12
  end
@@ -1 +1,6 @@
1
- != @page.body
1
+ - if @page.view.present?
2
+ = render "tramway/page/pages/views/#{@page.view}"
3
+ - else
4
+ - content_for :title do
5
+ = @page.title
6
+ != @page.body
@@ -1 +1 @@
1
- ::Tramway::Admin.set_available_models ::Tramway::Page::Page
1
+ ::Tramway::Admin.set_available_models(::Tramway::Page::Page, project: :page)
@@ -0,0 +1,8 @@
1
+ ru:
2
+ activerecord:
3
+ models:
4
+ tramway/page/page: Страница
5
+ cases:
6
+ tramway/page/page:
7
+ plural: страницы
8
+ genitive: страницу
@@ -15,7 +15,13 @@ module Tramway::Page::Generators
15
15
  end
16
16
 
17
17
  def copy_migrations
18
- migration_template 'create_tramway_page_pages.rb', 'db/migrate/create_tramway_page_pages.rb'
18
+ migrations = [
19
+ :create_tramway_page_pages,
20
+ :add_view_to_tramway_page_pages
21
+ ]
22
+ migrations.each do |migration|
23
+ migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
24
+ end
19
25
  end
20
26
  end
21
27
  end
@@ -0,0 +1,5 @@
1
+ class AddViewToTramwayPagePages < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :tramway_page_pages, :view, :text
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Page
3
- VERSION = '1.1.2'
3
+ VERSION = '1.3'
4
4
  end
5
5
  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.1.2
4
+ version: '1.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: 2018-06-23 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Description of Tramway::Page.
14
14
  email:
@@ -33,11 +33,13 @@ files:
33
33
  - app/models/tramway/page/page.rb
34
34
  - app/views/tramway/page/pages/show.html.haml
35
35
  - config/initializers/tramway.rb
36
+ - config/locales/models.yml
36
37
  - config/routes.rb
37
38
  - lib/tasks/tramway/page_tasks.rake
38
39
  - lib/tramway/page.rb
39
40
  - lib/tramway/page/engine.rb
40
41
  - lib/tramway/page/generators/install_generator.rb
42
+ - lib/tramway/page/generators/templates/add_view_to_tramway_page_pages.rb
41
43
  - lib/tramway/page/generators/templates/create_tramway_page_pages.rb
42
44
  - lib/tramway/page/version.rb
43
45
  homepage: https://github.com/ulmic/tramway-dev
@@ -59,8 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
61
  - !ruby/object:Gem::Version
60
62
  version: '0'
61
63
  requirements: []
62
- rubyforge_project:
63
- rubygems_version: 2.7.6
64
+ rubygems_version: 3.0.3
64
65
  signing_key:
65
66
  specification_version: 4
66
67
  summary: Summary of Tramway::Page.