tramway-landing 1.4.7.4 → 1.5
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 +4 -4
- data/app/assets/stylesheets/tramway/landing/application.sass +1 -0
- data/app/decorators/tramway/landing/block_decorator.rb +1 -1
- data/app/forms/tramway/landing/block_form.rb +22 -2
- data/app/models/tramway/landing/block.rb +1 -1
- data/app/views/tramway/landing/blocks/block_types/_page_with_button.html.haml +1 -0
- data/app/views/tramway/landing/blocks/templates/_section_with_image_and_text.html.haml +2 -0
- data/config/locales/models.yml +3 -0
- data/lib/tramway/landing/generates/install_generator.rb +2 -1
- data/lib/tramway/landing/generates/templates/add_button_to_tramway_landing_blocks.rb +5 -0
- data/lib/tramway/landing/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 728596237f98b5c68567721b2e37ed6014150023b82f041208a446528ea0a372
|
4
|
+
data.tar.gz: 4e53d54560da8393d353b19f0931747a4ae5a6094e446dd990915ca746c17bc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c74dbb1c4e9421a610f541e6b585c5f0d15fcb88f34fb27b8cc3cbc18788a7e59ddec94933a08a3ed641de23fd3a29ce8d4977c6880f46f0f55bab716477a5f4
|
7
|
+
data.tar.gz: 3f268c7be830004cc47d0feb79c6a8e37d33635a5b14d140406ae855cc805c7282de9866308b83469ae1e504c9f5b5fc8272b2cdb76ce7da30e3152d5096dc74
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class Tramway::Landing::BlockForm < ::Tramway::Core::ApplicationForm
|
2
|
-
properties :title, :background, :view_state, :block_type, :position, :navbar_link, :anchor, :description, :link_object_type, :link_object_id
|
2
|
+
properties :title, :background, :view_state, :block_type, :position, :navbar_link, :anchor, :description, :link_object_type, :link_object_id, :button
|
3
3
|
|
4
4
|
def initialize(object = nil)
|
5
5
|
form_object = super object
|
@@ -11,7 +11,27 @@ class Tramway::Landing::BlockForm < ::Tramway::Core::ApplicationForm
|
|
11
11
|
anchor: :string,
|
12
12
|
description: :ckeditor,
|
13
13
|
link_object_type: :default,
|
14
|
-
link_object_id: :numeric
|
14
|
+
link_object_id: :numeric,
|
15
|
+
button_title: :string,
|
16
|
+
button_link: :string
|
15
17
|
form_object
|
16
18
|
end
|
19
|
+
|
20
|
+
def button_title
|
21
|
+
model.button&.require(:title) || ""
|
22
|
+
end
|
23
|
+
|
24
|
+
def button_link
|
25
|
+
model.button&.require(:link) || ""
|
26
|
+
end
|
27
|
+
|
28
|
+
def button_title=(value)
|
29
|
+
model.button[:title] = value
|
30
|
+
model.save
|
31
|
+
end
|
32
|
+
|
33
|
+
def button_link=(value)
|
34
|
+
model.button[:link] = value
|
35
|
+
model.save
|
36
|
+
end
|
17
37
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class Tramway::Landing::Block < ::Tramway::Landing::ApplicationRecord
|
2
|
-
enumerize :block_type, in: [ :header, :footer, :page, :cards, :features, :contacts, :news, :link ]
|
2
|
+
enumerize :block_type, in: [ :header, :footer, :page, :cards, :features, :contacts, :news, :link, :page_with_button ]
|
3
3
|
enumerize :navbar_link, in: [ :exist, :not_exist ], default: :not_exist
|
4
4
|
enumerize :link_object_type, in: [ 'Tramway::SportSchool::Document', 'Tramway::Page::Page' ]
|
5
5
|
|
@@ -0,0 +1 @@
|
|
1
|
+
= render 'tramway/landing/blocks/templates/section_with_image_and_text', block: block
|
data/config/locales/models.yml
CHANGED
@@ -14,6 +14,8 @@ ru:
|
|
14
14
|
description: Описание
|
15
15
|
link_object_type: Тип объекта, на который делается ссылка
|
16
16
|
link_object_id: ID объекта, на который делается ссылка
|
17
|
+
button_title: Наименование кнопки
|
18
|
+
button_link: Ссылка кнопки
|
17
19
|
cases:
|
18
20
|
tramway/landing/block:
|
19
21
|
plural: Блоки
|
@@ -24,6 +26,7 @@ ru:
|
|
24
26
|
header: Начальный (Header)
|
25
27
|
footer: Подвал (Footer)
|
26
28
|
page: Свободный блок (картинка + текст)
|
29
|
+
page_with_button: Свободный блок с кнопкой (картинка + текст + кнопка)
|
27
30
|
cards: "Карточки (выводит определённый набор карточек): Программируется"
|
28
31
|
features: "Список возможностей (выделяет возможности): Программируется"
|
29
32
|
contacts: Блок с контактами
|
@@ -18,7 +18,8 @@ module Tramway::Landing::Generators
|
|
18
18
|
:add_anchor_to_tramway_landing_blocks,
|
19
19
|
:add_description_to_tramway_landing_blocks,
|
20
20
|
:add_link_object_id_to_tramway_landing_blocks,
|
21
|
-
:add_link_object_type_to_tramway_landing_blocks
|
21
|
+
:add_link_object_type_to_tramway_landing_blocks,
|
22
|
+
:add_button_to_tramway_landing_blocks
|
22
23
|
]
|
23
24
|
|
24
25
|
migrations.each do |migration|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-landing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- app/views/tramway/landing/blocks/block_types/_header.html.haml
|
52
52
|
- app/views/tramway/landing/blocks/block_types/_link.html.haml
|
53
53
|
- app/views/tramway/landing/blocks/block_types/_page.html.haml
|
54
|
+
- app/views/tramway/landing/blocks/block_types/_page_with_button.html.haml
|
54
55
|
- app/views/tramway/landing/blocks/templates/_features_list.html.haml
|
55
56
|
- app/views/tramway/landing/blocks/templates/_full_page.html.haml
|
56
57
|
- app/views/tramway/landing/blocks/templates/_section_with_image_and_text.html.haml
|
@@ -64,6 +65,7 @@ files:
|
|
64
65
|
- lib/tramway/landing/engine.rb
|
65
66
|
- lib/tramway/landing/generates/install_generator.rb
|
66
67
|
- lib/tramway/landing/generates/templates/add_anchor_to_tramway_landing_blocks.rb
|
68
|
+
- lib/tramway/landing/generates/templates/add_button_to_tramway_landing_blocks.rb
|
67
69
|
- lib/tramway/landing/generates/templates/add_description_to_tramway_landing_blocks.rb
|
68
70
|
- lib/tramway/landing/generates/templates/add_link_object_id_to_tramway_landing_blocks.rb
|
69
71
|
- lib/tramway/landing/generates/templates/add_link_object_type_to_tramway_landing_blocks.rb
|