tramway-landing 3.1.1 → 3.1.1.1

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: dc431043db81f89883889385e03491186d04c04594ffcb06348b8420930f965f
4
- data.tar.gz: d19f26f8b33a81658a29d4756fba4dda1bba6e5c2f0d052f9bf6daaa724a4a93
3
+ metadata.gz: cc9815cf619ada642aa9d5f68b7c322f74ae2541c18ff105c8b100b7a603b65b
4
+ data.tar.gz: 809f5a0d8f1bd62dbe6c7a092c4f988f32f875784a8ba85a08f08ad16b967bce
5
5
  SHA512:
6
- metadata.gz: 9eba566c78e86f716e68a986971889631674fad452d71f6d0d22a30a3b3de18ccae365b078f93dbd388d15bc8d1a92e18ef6473bfadfa558974b8bd7bee30a31
7
- data.tar.gz: 49dcf95b2e98b519f742d6eb68dfc88a99ff5de7337586011bb48a7e51d03081a60e4dbcdca518701828c7c643f2281e24e7cf5521d5361eff6bd9221115fecd
6
+ metadata.gz: 7acfeb6e279f8f11708287c50fbef4ec82a9f6e38217d88de00f47db94dccb083245c992f8bb42560c5f2c096da3d973c5878aadadbca0ec61d40e48cebb97ba
7
+ data.tar.gz: 853f6e6a4eaf19d77a9128d7185d2e502d41df33bb5558f21995e40bc0d8897434741feb8a3b6d9b6eb32f072b0711af8f39d986022251182390e4fdae70796c
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
@@ -14,7 +14,7 @@ module Tramway
14
14
 
15
15
  def block_title(block)
16
16
  if block.page.page_type.main?
17
- content_for?(:application_name) && yield(:application_name).present? ? yield(:application_name) : @application.public_name
17
+ content_for?(:application_name) && content_for(:application_name).present? ? content_for(:application_name) : @application.public_name
18
18
  else
19
19
  block.page.title
20
20
  end
@@ -22,7 +22,7 @@ module Tramway
22
22
 
23
23
  def block_tagline(block)
24
24
  if block.page.page_type.main?
25
- content_for?(:application_tagline) && yield(:application_tagline).present? ? yield(:application_tagline) : @application.tagline
25
+ content_for?(:application_tagline) && content_for(:application_tagline).present? ? content_for(:application_tagline) : @application.tagline
26
26
  else
27
27
  raw block.page.body
28
28
  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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Landing
5
- VERSION = '3.1.1'
5
+ VERSION = '3.1.1.1'
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.1
4
+ version: 3.1.1.1
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-18 00:00:00.000000000 Z
11
+ date: 2020-05-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email: