tramway-landing 3.3 → 3.3.0.4

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: a7c9610e7ca9a06693e66b7d02d8085dcf88c2ec1e4d3f0e2822d80406165e17
4
- data.tar.gz: fd346a2b77c95906b9cee5a40df1d053806cfc94c6eff6d344aec1646c9e25fd
3
+ metadata.gz: 6c14f6391ae112cddfc858d096b112eca375aaa6ddc7cd9da06a866693078669
4
+ data.tar.gz: f7ba024715b3c41a14c4bcd842663d5406db0534563db94c9a81e207cabe6c44
5
5
  SHA512:
6
- metadata.gz: bbbdb675f71c7b04d040e9e7dc78a707247916d0076b646bdacdb12c948e19b9f5f69a303a53032c4c79b5bde2de0b586e48acf23bdcae9018afc174fd41d827
7
- data.tar.gz: e7ee9cfed8732ebbd60ea3df48a612d3e9405ebedfcc794a09697651d9dd7750cfcd61153befc78432e23b81cc707d1fc4e598084e8a6801656f770a30f3749b
6
+ metadata.gz: 0323315717fbb03b07a3b9c14a5e0fdde3addc11f62a1fa64d44be73dd3b9470af28f978747a7573d4d837fddd48b4ee69063e4edab2c86ed17cc2cfc0639dce
7
+ data.tar.gz: 5f16ae8cea65958e08b700a7a4067629b2eef5c329668a67f1a39de80272bc2c908c9083fea65b28f8111ab03a83433d89beaefb292da6899fe5c8e1756ca852
data/README.md CHANGED
@@ -232,6 +232,52 @@ How create blocks you can find here
232
232
  * [Just text](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/docs/just_text/main.md)
233
233
  * Link to object
234
234
 
235
+ ## Tools
236
+
237
+ ### Google Tag Manager, Google Analytics, Yandex Metrika
238
+
239
+ #### 1. Add landing tools to the initializer
240
+
241
+ *config/initializers/tramway.rb*
242
+ ```ruby
243
+ Tramway::Admin.set_available_models(
244
+ ::Tramway::Landing::Block,
245
+ ::Tramway::Landing::Tool,
246
+ project: #{project_name_which_you_use_in_the_application}
247
+ )
248
+
249
+ Tramway::Admin.navbar_structure(
250
+ ::Tramway::Landing::Block,
251
+ ::Tramway::Landing::Tool
252
+ )
253
+ ```
254
+
255
+ #### 2. Click on `Tools`, create new tool with type `[Google Tag Manager, Google Analytics, Yandex Metrika]` and add account_id for your profile in this tool.
256
+
257
+ #### 3. Add to `WelcomeController` query to get `@tools`
258
+
259
+ *app/controllers/web/welcome_controller.rb*
260
+ ```ruby
261
+ class Web::WelcomeController < ApplicationController
262
+ before_action :application
263
+
264
+ layout 'tramway/landing/application'
265
+
266
+ def index
267
+ @blocks = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.on_main_page
268
+ @tools = ::Tramway::Landing::Tool.active
269
+ end
270
+
271
+ private
272
+
273
+ def application
274
+ @application = ::Tramway::Core.application_object
275
+ end
276
+ end
277
+ ```
278
+
279
+ And now all we need to integrate tool to your web page will be integrated automatically. **Enjoy!**
280
+
235
281
  ## Contributing
236
282
  Contribution directions go here.
237
283
 
@@ -8,4 +8,8 @@ class Tramway::Landing::Navbar::LinkDecorator < Tramway::Core::ApplicationDecora
8
8
  def link
9
9
  object[:link]
10
10
  end
11
+
12
+ def icon
13
+ object[:icon]
14
+ end
11
15
  end
@@ -14,7 +14,7 @@ class Admin::Tramway::Landing::BlockForm < ::Tramway::Core::ExtendedApplicationF
14
14
  position: {
15
15
  type: :numeric,
16
16
  input_options: {
17
- hint: I18n.t('hints.tramway.landing.block.position', array: ::Tramway::Landing::Block.active.on_main_page.map(&:position).join(','))
17
+ hint: I18n.t('hints.tramway.landing.block.position', array: ::Tramway::Landing::Block.on_main_page.map(&:position).join(','))
18
18
  }
19
19
  },
20
20
  block_type: :default,
@@ -5,6 +5,7 @@ module Tramway
5
5
  module ApplicationHelper
6
6
  include Tramway::Admin::RussianCasesHelper
7
7
  include Tramway::Profiles::LinksHelper if defined?(::Tramway::Profiles)
8
+ include ::FontAwesome5::Rails::IconHelper
8
9
 
9
10
  def actual_forms(forms)
10
11
  forms = forms.reject { |f| f.form_name == 'user_sign_up' } if @signed_in
@@ -11,5 +11,5 @@
11
11
  = favicon_link_tag @application.favicon
12
12
  - ::Tramway::Landing.head_content.each do |content|
13
13
  - self.instance_exec &content
14
- - @tools.each do |tool|
14
+ - @tools&.each do |tool|
15
15
  = render "layouts/tramway/landing/tools/#{tool.title}_head", account_id: tool.account_id
@@ -3,7 +3,7 @@
3
3
  %head
4
4
  = render 'layouts/tramway/landing/head'
5
5
  %body{ class: @application&.name }
6
- - @tools.each do |tool|
6
+ - @tools&.each do |tool|
7
7
  - if tool.with_body_fragment?
8
8
  = render "layouts/tramway/landing/tools/#{tool.title}_body", account_id: tool.account_id
9
9
  = stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.4.5/css/mdb.min.css'
@@ -3,13 +3,12 @@ ru:
3
3
  tramway/landing/block:
4
4
  published: Опубликованные
5
5
  hidden: Скрытые
6
- activerecord:
7
- state_machines:
8
- tramway/landing/block:
9
- view_state:
10
- states:
11
- published: Виден
12
- hidden: Скрытый
13
- events:
14
- publish: Показать на сайте
15
- hide: Скрыть с сайта
6
+ state_machines:
7
+ tramway/landing/block:
8
+ view_state:
9
+ states:
10
+ published: Виден
11
+ hidden: Скрытый
12
+ events:
13
+ publish: Показать на сайте
14
+ hide: Скрыть с сайта
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Landing
5
- VERSION = '3.3'
5
+ VERSION = '3.3.0.4'
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.3'
4
+ version: 3.3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - moshinaan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-11 00:00:00.000000000 Z
11
+ date: 2021-12-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Landing Engine for your Rails projects
14
14
  email:
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.1.2
123
+ rubygems_version: 3.0.3.1
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Landing Engine for your Rails projects