tramway-landing 1.4.7.4 → 1.5

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: 69ff995f5f833554843602c28dd96c1d78f74816c70eb130e3597752828b2513
4
- data.tar.gz: 3abbecfd51573e18988521296976343d770c99f5dcafea14fdb0a007ef11e958
3
+ metadata.gz: 728596237f98b5c68567721b2e37ed6014150023b82f041208a446528ea0a372
4
+ data.tar.gz: 4e53d54560da8393d353b19f0931747a4ae5a6094e446dd990915ca746c17bc3
5
5
  SHA512:
6
- metadata.gz: ef588ed525178b82360dd36049de26be1c99e7ce36e41408fc3239cc86b3a2de4198c6de4d8dcc8c8bd38f6350a5658d1a0eec931b65eb16c04f58b8a601308c
7
- data.tar.gz: 48e7d4037b25e5d6b099b4c8353fb38848f33cc54f06a0fe16ec4e7b23bbdbcf9fb3ef15ba62a9de072a33e0ee5f6c75278631783c9f35c62390198894fe0553
6
+ metadata.gz: c74dbb1c4e9421a610f541e6b585c5f0d15fcb88f34fb27b8cc3cbc18788a7e59ddec94933a08a3ed641de23fd3a29ce8d4977c6880f46f0f55bab716477a5f4
7
+ data.tar.gz: 3f268c7be830004cc47d0feb79c6a8e37d33635a5b14d140406ae855cc805c7282de9866308b83469ae1e504c9f5b5fc8272b2cdb76ce7da30e3152d5096dc74
@@ -3,6 +3,7 @@
3
3
  *= require_self
4
4
  */
5
5
 
6
+ @import 'bootstrap'
6
7
  @import "tramway/core/application"
7
8
  @import "tramway/landing/collage"
8
9
  @import "tramway/landing/justified"
@@ -17,7 +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
-
20
+
21
21
  def block_type
22
22
  object.block_type_text
23
23
  end
@@ -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
@@ -7,3 +7,5 @@
7
7
  %hr
8
8
  %p
9
9
  != block.description
10
+ - if block.try :button
11
+ = link_to block.button[:title], block.button[:link], class: 'btn btn-primary'
@@ -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|
@@ -0,0 +1,5 @@
1
+ class AddButtonToTramwayLandingBlocks < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :tramway_landing_blocks, :button, :jsonb
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Landing
3
- VERSION = '1.4.7.4'
3
+ VERSION = '1.5'
4
4
  end
5
5
  end
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.7.4
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