tramway-landing 3.1.1 → 3.1.1.5

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: 8cdf40a2a324672c52c438e27d760d6a25a74bf5254b2904d357354bb52ee2bb
4
+ data.tar.gz: 1afc8e68a3b43c2f50d38a2bc25673e4d055762d6fae81d1f935b30e9fa3fdd3
5
5
  SHA512:
6
- metadata.gz: 9eba566c78e86f716e68a986971889631674fad452d71f6d0d22a30a3b3de18ccae365b078f93dbd388d15bc8d1a92e18ef6473bfadfa558974b8bd7bee30a31
7
- data.tar.gz: 49dcf95b2e98b519f742d6eb68dfc88a99ff5de7337586011bb48a7e51d03081a60e4dbcdca518701828c7c643f2281e24e7cf5521d5361eff6bd9221115fecd
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. 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
@@ -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,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
- 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
- Sign In successful!
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
- There is some errors
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
- There is some errors
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)
@@ -0,0 +1,9 @@
1
+ ru:
2
+ tramway:
3
+ landing:
4
+ templates:
5
+ alert:
6
+ sign_up_successful: Регистрация прошла успешно
7
+ ign_in_successful: Авторизация прошла успешно
8
+ there_is_some_errors: Исправьте ошибки
9
+ ivalid_email_or_password: email или пароль введены неверно
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Landing
5
- VERSION = '3.1.1'
5
+ VERSION = '3.1.1.5'
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.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-05-18 00:00:00.000000000 Z
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