tramway-landing 3.1.1 → 3.1.1.5
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/tramway/landing/blocks/block_types/_footer.html.haml +2 -2
- data/app/views/tramway/landing/blocks/block_types/_header_with_form.html.haml +4 -4
- data/config/locales/templates.yml +9 -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: 8cdf40a2a324672c52c438e27d760d6a25a74bf5254b2904d357354bb52ee2bb
|
4
|
+
data.tar.gz: 1afc8e68a3b43c2f50d38a2bc25673e4d055762d6fae81d1f935b30e9fa3fdd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f174636195a5d28be61a438e67021db93e3cab990bf8fe356da21fe62cb83826fbfffc0deea3e02e1bd27780a180027c7e08adaff6842f8308a3807ca3cbc739
|
7
|
+
data.tar.gz: b76eecea6f7c4055c0238032cd0477474796bc1950207d3f3ad16268533258503f0f4b34536c859bad155abc728c7e83eddccdb2d628d2147a98afecd587b019
|
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
|
@@ -19,16 +19,16 @@
|
|
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
|
+
= t('.sign_in_successful')
|
26
26
|
- if params[:flash] == 'error_user_sign_up'
|
27
27
|
= render 'tramway/landing/templates/alert', alert_type: :danger do
|
28
|
-
|
28
|
+
= t('.there_is_some_errors')
|
29
29
|
- if params[:flash] == 'error_user_sign_in'
|
30
30
|
= render 'tramway/landing/templates/alert', alert_type: :danger do
|
31
|
-
|
31
|
+
= t('.invalid_email_or_password')
|
32
32
|
.card
|
33
33
|
.card-body
|
34
34
|
- raise 'Initialize @header_with_form in a controller with something like that `@header_with_form = UserSignUpForm.new User.new`. `User` is your model which you want to Sign Up' unless defined?(@header_with_form)
|
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.5
|
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-15 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
|