tramway-landing 1.2 → 1.2.1

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: 0d515000601a6fbf5765462de251923e05efcf9d2b66c55d087d39c1f40cddd9
4
- data.tar.gz: 0b9661262483cd06592d77555fce0b48a5b25ad69ac1d8fa4b73420c77758537
3
+ metadata.gz: e26b32b7d13f6f68ec1e35bb141d6acd905f4c107752bf63dcd4b61de31f89f0
4
+ data.tar.gz: 784bdc4efdb3483e9e9140abf93f917aa34dff4172a9720932cc61f3f0fedf9e
5
5
  SHA512:
6
- metadata.gz: 568c7bae60fc18a99dd7211d4932398b5a73f65308f7a83e1414f5389df2c325f7f5721b6aa4aa109cd024b444dba2ed5a80e71228b26123bdd87fe6969785d4
7
- data.tar.gz: c3aa28335296e92eff35d9b6530f3982c8138e6dd4970daae82540c26a73974ef2461ec2f9ea4dad7a590e626ef70cfdec46bc53f6489608c7f846df4043b230
6
+ metadata.gz: 6273939bce92a54510c938d2ba94747beeb5f5fba8504c23bc34f452d4ba4767caab0609beeab45343c84e5b39319331e6bd3996fca28fbf5fe2355b91c58a80
7
+ data.tar.gz: e486c0327c24a39f2a8e96095800252786f50a6af6e7d704d69a2fc9ff3c93458b4868f05c3aaa86b9d17d8b1d5dbd0a788267f6d73a1e355a2676a0a3311a33
@@ -1,6 +1,4 @@
1
1
  class Tramway::Landing::Block < ::Tramway::Landing::ApplicationRecord
2
- belongs_to :link_object, polymorphic: true
3
-
4
2
  enumerize :block_type, in: [ :header, :footer, :page, :cards, :features, :contacts, :news, :link ]
5
3
  enumerize :navbar_link, in: [ :exist, :not_exist ], default: :not_exist
6
4
  enumerize :link_object_type, in: [ 'Tramway::SportSchool::Document' ]
@@ -24,4 +22,8 @@ class Tramway::Landing::Block < ::Tramway::Landing::ApplicationRecord
24
22
  scope :with_navbar_link, -> { where navbar_link: :exist }
25
23
  scope :header, -> { on_main_page.where(block_type: :header).first }
26
24
  scope :footer, -> { on_main_page.where(block_type: :footer).first }
25
+
26
+ def link_object
27
+ link_object_type.constantize.find link_object_id
28
+ end
27
29
  end
@@ -8,29 +8,30 @@
8
8
  - eval("@collection_#{block.anchor}")&.each do |item|
9
9
  .col-lg-4.col-md-12.mb-4
10
10
  - if item.path.present?
11
- = link_to item.path do
12
- .card.link
13
- .view.overlay.hm-white-slight
14
- = image_tag item.image, class: 'img-fluid'
15
- = link_to '#' do
16
- .mask
17
- .card-body
18
- %h4.card-title
19
- = item.title
20
- %p.card-text
21
- = strip_tags item.description
22
- - if item.button.present?
23
- = link_to item.button.text, item.button.url, class: 'btn btn-primary'
11
+ -# FIXME
12
+ .card.link{ onclick: "window.location.href = '#{item.path}';" }
13
+ .view.overlay.hm-white-slight
14
+ = image_tag item.image || '', class: 'img-fluid'
15
+ = link_to '#' do
16
+ .mask
17
+ .card-body
18
+ %h4.card-title
19
+ = item.title
20
+ %p.card-text
21
+ = strip_tags item.description
22
+ - if item.button.present?
23
+ = link_to item.button.text, item.button.url, class: 'btn btn-primary'
24
24
  - else
25
25
  .card
26
26
  .view.overlay.hm-white-slight
27
- = image_tag item.image, class: 'img-fluid'
27
+ = image_tag item.image || '', class: 'img-fluid'
28
28
  = link_to '#' do
29
29
  .mask
30
30
  .card-body
31
31
  %h4.card-title
32
32
  = item.title
33
- %p.card-text
34
- = item.description
33
+ - if item.description
34
+ %p.card-text
35
+ = item.description
35
36
  - if item.button.present?
36
37
  = link_to item.button.text, item.button.url, class: 'btn btn-primary'
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Landing
3
- VERSION = '1.2'
3
+ VERSION = '1.2.1'
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.2'
4
+ version: 1.2.1
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-05-30 00:00:00.000000000 Z
11
+ date: 2018-06-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email:
@@ -48,6 +48,7 @@ files:
48
48
  - app/views/tramway/landing/blocks/block_types/_header.html.haml
49
49
  - app/views/tramway/landing/blocks/block_types/_link.html.haml
50
50
  - app/views/tramway/landing/blocks/block_types/_page.html.haml
51
+ - app/views/tramway/landing/blocks/block_types/index.html.haml
51
52
  - config/initializers/assets.rb
52
53
  - config/initializers/tramway.rb
53
54
  - config/locales/models.yml