tramway-landing 3.3 → 3.3.0.1

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: a7c9610e7ca9a06693e66b7d02d8085dcf88c2ec1e4d3f0e2822d80406165e17
4
- data.tar.gz: fd346a2b77c95906b9cee5a40df1d053806cfc94c6eff6d344aec1646c9e25fd
3
+ metadata.gz: a45efb32f0c28f7ae74fa03e12fefe9830d9e1679a7182dd5b6fcb2a31aa91ca
4
+ data.tar.gz: 43e634520e64f88799d85e78777f09f556d02142f0ae38ec17f4cc937d3831aa
5
5
  SHA512:
6
- metadata.gz: bbbdb675f71c7b04d040e9e7dc78a707247916d0076b646bdacdb12c948e19b9f5f69a303a53032c4c79b5bde2de0b586e48acf23bdcae9018afc174fd41d827
7
- data.tar.gz: e7ee9cfed8732ebbd60ea3df48a612d3e9405ebedfcc794a09697651d9dd7750cfcd61153befc78432e23b81cc707d1fc4e598084e8a6801656f770a30f3749b
6
+ metadata.gz: 89d5a7d94f0f52e7895360d84e417397ee9dcc039bcc152c0a7232bb8cc4617f20268c5c77bfd5951eb310ea1e522e85af85a8e8d8bf9245719012b49dcfec96
7
+ data.tar.gz: e4eb3543ba967199ace274b51eff0170a03073bfe2e78e5f262461a1c15f5cabdbb846e06390cebcb7fff6b0c9d9d4712f6ff315bae4c33a52115cf5a37063fb
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
 
@@ -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'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Landing
5
- VERSION = '3.3'
5
+ VERSION = '3.3.0.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - moshinaan