tramway-landing 3.1.0.5 → 3.1.1.3

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: 57f2d1b3f419bb1bb445ddbdaaeddfaff7e36ff793996ebdf01ee8ee02af12eb
4
- data.tar.gz: a6b60de0abf7774981099ae62a6a6a9deea359ffc2a78df092eef19647d2ab1b
3
+ metadata.gz: '08d7831b4585397754e140b18998cb695ec0ba23b07f6d0f80ff6b01fda43efb'
4
+ data.tar.gz: 8399b98114b9e3de6b6a5bcd4b03d5ceb099181a42b44636a1e8443dd586c1ea
5
5
  SHA512:
6
- metadata.gz: a344b8c9013efd19eb212656411ba9a28551fba244886328fd515ebc32d832a90ad2a713ff71af926323ad2f8d3804286baebf772f88d6e91a9c6aab4ac54d29
7
- data.tar.gz: 6125433fabb4a07aece199dd5b6c14ffe67c03e97a008fbbb8980a990e01bd6b2c1e21afdd545e74606aea648430cacb0033bf8fe4a636addb1b1acfabc44bdf
6
+ metadata.gz: f4ec85b3d2c054f45138349d95088334dcbccde09cf72fd6460264e477042378c7f5615a7fbef4210c7e2f7033af7a3c16f909cc5c2f249fe5cc31de5aaf18a5
7
+ data.tar.gz: a7b55670a6f4b906df8c1d05e3cdb0da1f5f377b18fafc62f0288375500b8e0f3a1060c9f98dbda48f335019124126033958ab5e0429a253e117571e18cc8797
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## English
2
+
1
3
  # Tramway::Landing
2
4
  It uses [Material Design Bootstrap](https://mdbootstrap.com/) by default
3
5
 
@@ -47,12 +49,45 @@ Tramway::Admin.set_available_models ::Tramway::Landing::Block, project: #{projec
47
49
  Tramway::Admin.navbar_structure ::Tramway::Landing::Block
48
50
  ```
49
51
 
50
- #### 4. Run server `rails s`
51
- #### 5. Open `localhost:3000/admin`
52
- #### 6. Click on `Blocks`, add new block with type `Header`
53
- #### 7. Click `Show` in the block menu
52
+ #### 4. Add `PhotoVersions` to middleware (will be removed soon)
53
+
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
+ ```
54
70
 
55
- #### 8. Then create your main page controller `rails g controller web/welcome`
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`
56
91
 
57
92
  *app/controllers/web/welcome_controller.rb*
58
93
  ```ruby
@@ -73,7 +108,7 @@ class Web::WelcomeController < ApplicationController
73
108
  end
74
109
  ```
75
110
 
76
- #### 9. Add new controller to the routes
111
+ #### 10. Add new controller to the routes
77
112
 
78
113
  *config/routes.rb*
79
114
  ```ruby
@@ -82,7 +117,7 @@ root to: 'web/welcome#index'
82
117
  # ...
83
118
  ```
84
119
 
85
- #### 10. Add view for the new landing
120
+ #### 11. Add view for the new landing
86
121
 
87
122
  *app/views/web/welcome/index.html.haml*
88
123
  ```haml
@@ -202,3 +237,19 @@ Contribution directions go here.
202
237
 
203
238
  ## License
204
239
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
240
+
241
+ ## Русский
242
+
243
+ Инструкцию по созданию блоков, Вы можете посмотреть здесь
244
+
245
+ * [Начальный (Header)](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/header/main.md#%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)
246
+ * Начальный блок с формой (Header)
247
+ * [Подвал (Footer)](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/footer/main.md#%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)
248
+ * [Свободный блок (картинка+текст)](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/block_with_text_and_image/main.md)
249
+ * [Свободный блок с кнопкой (картинка + текст + кнопка)](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/block_with_text_image_and_button/main.md)
250
+ * [Карточки (выводит опредеделенный набор карточек)-программируется](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/cards/main.md)
251
+ * [Список возможностей-программируется](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/features/main.md)
252
+ * [Блок с контактами](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/contacts/main.md#%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)
253
+ * Представление
254
+ * [Просто текст](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/just_text/main.md)
255
+ * Ссылка на объект
@@ -9,9 +9,9 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
9
9
  def list_attributes
10
10
  %i[page_title position view_state block_type]
11
11
  end
12
-
12
+
13
13
  def show_associations
14
- [ :forms ]
14
+ [:forms]
15
15
  end
16
16
 
17
17
  delegate :human_view_state_event_name, to: :model_class
@@ -24,9 +24,7 @@ class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
24
24
 
25
25
  def public_path
26
26
  if object.published?
27
- if object.page.slug.present?
28
- Tramway::Page::Engine.routes.url_helpers.page_path slug: object.page.slug
29
- end
27
+ Tramway::Page::Engine.routes.url_helpers.page_path slug: object.page.slug if object.page.slug.present?
30
28
  else
31
29
  Tramway::Page::Engine.routes.url_helpers.preview_path id: object.page.id
32
30
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Landing::Navbar::LinkDecorator < Tramway::Core::ApplicationDecorator
2
4
  def title
3
5
  object[:title]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Admin::Tramway::Landing::FormForm < Tramway::Core::ApplicationForm
2
4
  association :block
3
5
 
@@ -6,10 +8,10 @@ class Admin::Tramway::Landing::FormForm < Tramway::Core::ApplicationForm
6
8
  def initialize(object)
7
9
  super(object).tap do
8
10
  form_properties block: :association,
9
- title: :string,
10
- url: :string,
11
- form_name: :default,
12
- position: :integer
11
+ title: :string,
12
+ url: :string,
13
+ form_name: :default,
14
+ position: :integer
13
15
  end
14
16
  end
15
17
  end
@@ -7,14 +7,14 @@ module Tramway
7
7
  include Tramway::Profiles::LinksHelper if defined?(::Tramway::Profiles)
8
8
 
9
9
  def actual_forms(forms)
10
- forms = forms.select { |f| f.form_name != 'user_sign_up' } if @signed_in
11
- forms = forms.select { |f| f.form_name != 'user_sign_in' } if @signed_in
10
+ forms = forms.reject { |f| f.form_name == 'user_sign_up' } if @signed_in
11
+ forms = forms.reject { |f| f.form_name == 'user_sign_in' } if @signed_in
12
12
  forms
13
13
  end
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
@@ -8,7 +8,7 @@ class Tramway::Landing::Block < ::Tramway::Landing::ApplicationRecord
8
8
  enumerize :navbar_link, in: %i[exist not_exist], default: :not_exist
9
9
  enumerize :link_object_type, in: ['Tramway::SportSchool::Document', 'Tramway::Page::Page']
10
10
 
11
- mount_uploader :background, PhotoUploader
11
+ uploader :background, :photo, extensions: %i[jpg jpeg gif png]
12
12
 
13
13
  state_machine :view_state, initial: :published do
14
14
  state :published
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Landing::Form < ApplicationRecord
2
4
  belongs_to :block, class_name: 'Tramway::Landing::Block'
3
5
 
@@ -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'
@@ -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
@@ -52,3 +52,6 @@ ru:
52
52
  navbar_link:
53
53
  exist: Присутствует
54
54
  not_exist: Отсутствует
55
+ errors:
56
+ messages:
57
+ extension_whitelist_error: неверный формата, расширение файла должно быть jpg, jpeg, gif или png.
@@ -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.5'
5
+ VERSION = '3.1.1.3'
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.5
4
+ version: 3.1.1.3
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-07 00:00:00.000000000 Z
11
+ date: 2020-06-09 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