tramway-landing 3.1.0.6 → 3.1.1.4

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: e63ac0e6c73f4a430023cfcd2b012c34dc790f17a301a80253d29514e1e770ce
4
- data.tar.gz: 3c9960b503437ab6a60b686df8b112953f61fbaa836f7d757704761188ede4be
3
+ metadata.gz: d71197a80aec79c649064328e86784a3687e1d96456c63439ae2ffef307fcc7b
4
+ data.tar.gz: 2ce896949b8a659e9254b990e6a98011533c0a71cdebaace792adb2f5e1f57c5
5
5
  SHA512:
6
- metadata.gz: 474416ff89499f248e8d930d42051f042bb611eab3dd0193f9bcafb1a548c1b67bfdc49874f5bf5a1270c68668ffc6d7e1e56e057c6fa02ad93e3acf2e9dab79
7
- data.tar.gz: 317bd1de28db9c050168eca7c341f6c20a22eac6acd4abc10bfaaffefcfb9f9bc27aae094b92f126c99b94ebead532753b17568ea6a9a513753c1a75e3c86e66
6
+ metadata.gz: 472a6376fa0f9a89bdb37b17abac7bd7b36544ea203da5e6691ba1b622ca63213191bcdd336f05905cb6a65f4554166812a48ad068a11bb57ad33f614d19cb34
7
+ data.tar.gz: 900995a5707308577e39ea717f382990ea43be4d431fe391d7803ede062f7173944e5746fdbf30ce80d40bc09e59d3f40776d3d56dd01ea560ecc16869b710cc
data/README.md CHANGED
@@ -49,12 +49,45 @@ Tramway::Admin.set_available_models ::Tramway::Landing::Block, project: #{projec
49
49
  Tramway::Admin.navbar_structure ::Tramway::Landing::Block
50
50
  ```
51
51
 
52
- #### 4. Run server `rails s`
53
- #### 5. Open `localhost:3000/admin`
54
- #### 6. Click on `Blocks`, add new block with type `Header`
55
- #### 7. Click `Show` in the block menu
52
+ #### 4. Add `PhotoVersions` to middleware (will be removed soon)
56
53
 
57
- #### 8. Then create your main page controller `rails g controller web/welcome`
54
+ *lib/middleware/tramway/landing_middleware.rb*
55
+ ```ruby
56
+ module Tramway
57
+ class LandingMiddleware
58
+ def initialize(app)
59
+ @app = app
60
+ end
61
+
62
+ def call(env)
63
+ PhotoUploader.include Tramway::Landing::PhotoVersions
64
+
65
+ @app.call(env)
66
+ end
67
+ end
68
+ end
69
+ ```
70
+
71
+ *confing/initializers/application.rb*
72
+ ```ruby
73
+ ...
74
+ require_relative '../lib/middleware/tramway/landing_middleware'
75
+ ...
76
+
77
+ module YourApplication
78
+ class Application < Rails::Application
79
+ config.middleware.use = ::Tramway::LandingMiddleware
80
+ end
81
+ end
82
+ ```
83
+
84
+
85
+ #### 5. Run server `rails s`
86
+ #### 6. Open `localhost:3000/admin`
87
+ #### 7. Click on `Blocks`, add new block with type `Header`
88
+ #### 8. Click `Show` in the block menu
89
+
90
+ #### 9. Then create your main page controller `rails g controller web/welcome`
58
91
 
59
92
  *app/controllers/web/welcome_controller.rb*
60
93
  ```ruby
@@ -75,7 +108,7 @@ class Web::WelcomeController < ApplicationController
75
108
  end
76
109
  ```
77
110
 
78
- #### 9. Add new controller to the routes
111
+ #### 10. Add new controller to the routes
79
112
 
80
113
  *config/routes.rb*
81
114
  ```ruby
@@ -84,7 +117,7 @@ root to: 'web/welcome#index'
84
117
  # ...
85
118
  ```
86
119
 
87
- #### 10. Add view for the new landing
120
+ #### 11. Add view for the new landing
88
121
 
89
122
  *app/views/web/welcome/index.html.haml*
90
123
  ```haml
@@ -13,18 +13,26 @@ module Tramway
13
13
  end
14
14
 
15
15
  def block_title(block)
16
- if block.page.page_type.main?
17
- content_for?(:application_name) && yield(:application_name).present? ? yield(:application_name) : @application.public_name
16
+ if block.is_a? Array
17
+ block.each do |current_block|
18
+ current_block.page.title
19
+ end
18
20
  else
19
- block.page.title
21
+ if block.page.page_type.main?
22
+ content_for?(:application_name) && content_for(:application_name).present? ? content_for(:application_name) : @application.public_name
23
+ end
20
24
  end
21
25
  end
22
26
 
23
27
  def block_tagline(block)
24
- if block.page.page_type.main?
25
- content_for?(:application_tagline) && yield(:application_tagline).present? ? yield(:application_tagline) : @application.tagline
26
- else
27
- raw block.page.body
28
+ unless block.is_a? Array
29
+ if block.page.page_type.main?
30
+ content_for?(:application_tagline) && content_for(:application_tagline).present? ? content_for(:application_tagline) : @application.tagline
31
+ else
32
+ block.each do |_current_block|
33
+ raw block.page.body
34
+ end
35
+ end
28
36
  end
29
37
  end
30
38
  end
@@ -17,5 +17,3 @@ module Tramway::Landing::PhotoVersions
17
17
  end
18
18
  end
19
19
  end
20
-
21
- PhotoUploader.include Tramway::Landing::PhotoVersions
@@ -14,7 +14,7 @@
14
14
  = favicon_link_tag @application.favicon
15
15
  - ::Tramway::Landing.head_content.each do |content|
16
16
  - self.instance_exec &content
17
- %body
17
+ %body{ class: @application.name }
18
18
  = stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/css/mdb.min.css'
19
19
  = javascript_include_tag 'https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/js/mdb.js'
20
20
  = javascript_include_tag 'https://cdn.rawgit.com/CezarLuiz0/anchor.js/master/dist/anchor.min.js'
@@ -4,9 +4,9 @@
4
4
  .row
5
5
  .col-md-6
6
6
  %h5.title
7
- = block_title(block)
7
+ - block_title(block)
8
8
  %p
9
- = block_tagline(block)
9
+ - block_tagline(block)
10
10
  .logo_collage.effect-parent
11
11
  = yield :footer_logos
12
12
  .col-md-6
@@ -19,7 +19,7 @@
19
19
  .col-md-6.col-xl-5.mb-4
20
20
  - if params[:flash] == 'success_user_sign_up'
21
21
  = render 'tramway/landing/templates/alert', alert_type: :success do
22
- Sign up successful!
22
+ = t('.sign_up_successful')
23
23
  - if params[:flash] == 'success_user_sign_in'
24
24
  = render 'tramway/landing/templates/alert', alert_type: :success do
25
25
  Sign In successful!
@@ -2,7 +2,7 @@
2
2
  #intro.view.hm-black-strong{ style: "background-image: url('#{block.background.url}')" }
3
3
  .container-fluid.full-bg-img.d-flex.align-items-center.justify-content-center
4
4
  .row.d-flex.justify-content-center
5
- .col-md-10.text-center
5
+ .col-md-12.text-center
6
6
  %h2.display-3.font-bold.white-text.mb-2
7
7
  = block.title
8
8
  %hr.hr-light
@@ -0,0 +1,5 @@
1
+ ru:
2
+ tramway:
3
+ landing:
4
+ alert:
5
+ sign_up_successful: Ваши данные отправлены
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Landing
5
- VERSION = '3.1.0.6'
5
+ VERSION = '3.1.1.4'
6
6
  end
7
7
  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: 3.1.0.6
4
+ version: 3.1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - moshinaan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-12 00:00:00.000000000 Z
11
+ date: 2020-06-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email:
@@ -77,6 +77,7 @@ files:
77
77
  - config/locales/ru.forms.yml
78
78
  - config/locales/ru.models.yml
79
79
  - config/locales/ru.state_machines.yml
80
+ - config/locales/templates.yml
80
81
  - config/routes.rb
81
82
  - lib/tasks/tramway/landing_tasks.rake
82
83
  - lib/tramway/landing.rb