tramway-landing 1.7.2 → 1.8

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: d36e3af967158a8cefe4840a639d0632561de68adc357b33d2cb4de2e205577a
4
- data.tar.gz: 768cd52781f9a780755c39a1099ab1372e333c6ef6880bd609c2ff85e2825ef8
3
+ metadata.gz: e74664af83fb56c8127c0ccb38dcfe389dda475a82b0b555bda93b7d94d56094
4
+ data.tar.gz: a95df8d21c49dfc28fa6b5652fdae5e2f54ace6d7511de1091e70b22d5638cf9
5
5
  SHA512:
6
- metadata.gz: b91e2bdce4414b1a0d2337cc8da4a594ae951f600ec960b520cb58b53f2cd852d22149b14d6b185f65bd506cbc776e3a60816393e48efe1726881c2101acf4e0
7
- data.tar.gz: eed621db462d3129d99484ffe6077a19540a735e9901aaa2b37b0a64283e1f62c525e866c9bf4cffa497270b01c2abc065d608e99ace4898ec252d6d5dd34cda
6
+ metadata.gz: d13d3a202bec874c370ca73d378c74895442ede071e74c7aa2924668ecf0f9760adca4b70cb4ca45a0887fbec7867965033f1deb274040e7f24a2047f1c30ea0
7
+ data.tar.gz: faa355ec8ff76a08ec3de1ce1120619288f47a0fcd0eba76e6c9c5a62495150234bab7518624af08c050676f4017fa7130145e61712e2fca31b1a580a1d2c0d1
@@ -17,6 +17,7 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
17
17
  delegate :anchor, to: :object
18
18
  delegate :description, to: :object
19
19
  delegate :anchor, to: :object
20
+ delegate :view_name, to: :object
20
21
 
21
22
  def block_type
22
23
  object.block_type_text
@@ -1,20 +1,33 @@
1
1
  class Tramway::Landing::BlockForm < ::Tramway::Core::ExtendedApplicationForm
2
- properties :title, :background, :view_state, :block_type, :position, :navbar_link, :anchor, :description, :link_object_type, :link_object_id, :button_title, :button_link
2
+ properties :title,
3
+ :background,
4
+ :view_state,
5
+ :block_type,
6
+ :position,
7
+ :navbar_link,
8
+ :anchor,
9
+ :description,
10
+ :link_object_type,
11
+ :link_object_id,
12
+ :button_title,
13
+ :button_link,
14
+ :view_name
3
15
 
4
16
  def initialize(object = nil)
5
- form_object = super object
6
- form_properties title: :string,
7
- background: :file,
8
- position: :numeric,
9
- block_type: :default,
10
- navbar_link: :default,
11
- anchor: :string,
12
- description: :ckeditor,
13
- link_object_type: :default,
14
- link_object_id: :numeric,
15
- button_title: :string,
16
- button_link: :string
17
- form_object
17
+ super(object).tap do
18
+ form_properties title: :string,
19
+ background: :file,
20
+ position: :numeric,
21
+ block_type: :default,
22
+ navbar_link: :default,
23
+ anchor: :string,
24
+ description: :ckeditor,
25
+ link_object_type: :default,
26
+ link_object_id: :numeric,
27
+ button_title: :string,
28
+ button_link: :string,
29
+ view_name: :string
30
+ end
18
31
  end
19
32
 
20
33
  def button_title
@@ -1,5 +1,17 @@
1
1
  class Tramway::Landing::Block < ::Tramway::Landing::ApplicationRecord
2
- enumerize :block_type, in: [ :header, :footer, :page, :cards, :features, :contacts, :news, :link, :page_with_button, :just_text ]
2
+ enumerize :block_type, in: [
3
+ :header,
4
+ :footer,
5
+ :page,
6
+ :cards,
7
+ :features,
8
+ :contacts,
9
+ :news,
10
+ :link,
11
+ :page_with_button,
12
+ :just_text,
13
+ :view
14
+ ]
3
15
  enumerize :navbar_link, in: [ :exist, :not_exist ], default: :not_exist
4
16
  enumerize :link_object_type, in: [ 'Tramway::SportSchool::Document', 'Tramway::Page::Page' ]
5
17
 
@@ -0,0 +1 @@
1
+ = render "tramway/landing/blocks/views/#{block.view_name}"
@@ -16,6 +16,7 @@ ru:
16
16
  link_object_id: ID объекта, на который делается ссылка
17
17
  button_title: Наименование кнопки
18
18
  button_link: Ссылка кнопки
19
+ view_name: Название вьюхи
19
20
  cases:
20
21
  tramway/landing/block:
21
22
  plural: Блоки
@@ -33,6 +34,7 @@ ru:
33
34
  news: Блок новостей
34
35
  link: Ссылка на объект
35
36
  just_text_with_button: Просто текст
37
+ view: Вьюха (программируется)
36
38
  navbar_link:
37
39
  exist: Присутствует
38
40
  not_exist: Отсутствует
@@ -19,7 +19,8 @@ module Tramway::Landing::Generators
19
19
  :add_description_to_tramway_landing_blocks,
20
20
  :add_link_object_id_to_tramway_landing_blocks,
21
21
  :add_link_object_type_to_tramway_landing_blocks,
22
- :add_button_to_tramway_landing_blocks
22
+ :add_button_to_tramway_landing_blocks,
23
+ :add_view_name_to_tramway_landing_blocks
23
24
  ]
24
25
 
25
26
  migrations.each do |migration|
@@ -0,0 +1,5 @@
1
+ class AddViewNameToTramwayLandingBlocks < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :tramway_landing_blocks, :view_name, :text
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Landing
3
- VERSION = '1.7.2'
3
+ VERSION = '1.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-landing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.2
4
+ version: '1.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-06 00:00:00.000000000 Z
11
+ date: 2019-09-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email:
@@ -53,6 +53,7 @@ files:
53
53
  - app/views/tramway/landing/blocks/block_types/_link.html.haml
54
54
  - app/views/tramway/landing/blocks/block_types/_page.html.haml
55
55
  - app/views/tramway/landing/blocks/block_types/_page_with_button.html.haml
56
+ - app/views/tramway/landing/blocks/block_types/_view.html.haml
56
57
  - app/views/tramway/landing/blocks/templates/_features_list.html.haml
57
58
  - app/views/tramway/landing/blocks/templates/_full_page.html.haml
58
59
  - app/views/tramway/landing/blocks/templates/_section_with_image_and_text.html.haml
@@ -72,6 +73,7 @@ files:
72
73
  - lib/tramway/landing/generates/templates/add_link_object_id_to_tramway_landing_blocks.rb
73
74
  - lib/tramway/landing/generates/templates/add_link_object_type_to_tramway_landing_blocks.rb
74
75
  - lib/tramway/landing/generates/templates/add_navbar_link_to_tramway_landing_blocks.rb
76
+ - lib/tramway/landing/generates/templates/add_view_name_to_tramway_landing_blocks.rb
75
77
  - lib/tramway/landing/generates/templates/create_tramway_landing_blocks.rb
76
78
  - lib/tramway/landing/version.rb
77
79
  homepage: https://github.com/kalashnikovisme/tramway-landing