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 +4 -4
- data/README.md +40 -7
- data/app/helpers/tramway/landing/application_helper.rb +15 -7
- data/app/uploaders/tramway/landing/photo_versions.rb +0 -2
- data/app/views/layouts/tramway/landing/application.html.haml +1 -1
- data/app/views/tramway/landing/blocks/block_types/_footer.html.haml +2 -2
- data/app/views/tramway/landing/blocks/block_types/_header_with_form.html.haml +1 -1
- data/app/views/tramway/landing/templates/_full_page.html.haml +1 -1
- data/config/locales/templates.yml +5 -0
- data/lib/tramway/landing/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d71197a80aec79c649064328e86784a3687e1d96456c63439ae2ffef307fcc7b
|
4
|
+
data.tar.gz: 2ce896949b8a659e9254b990e6a98011533c0a71cdebaace792adb2f5e1f57c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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
|
-
####
|
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
|
-
####
|
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.
|
17
|
-
|
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.
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
@@ -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'
|
@@ -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
|
-
|
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-
|
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
|
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.
|
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-
|
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
|