mberlanda/cheidelacoriera

View on GitHub
app/views/layouts/application.html.haml

Summary

Maintainability
Test Coverage
!!! 5

%html{ lang: 'it' }
  %head
    = render partial: 'layouts/metadata'

    %link{ href: 'https://fonts.googleapis.com/css?family=Josefin+Sans:300,400|Roboto:300,400,500', rel: 'stylesheet' }/
    = stylesheet_pack_tag 'styles', rel: 'stylesheet'
    = stylesheet_link_tag 'application.css', media: 'all', rel: 'stylesheet'

    / = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
    / = javascript_include_tag 'application', 'data-turbolinks-track' => true

    / [if lt IE 9]
      = javascript_include_tag 'https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js'
      = javascript_include_tag 'https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js'

    = javascript_pack_tag 'vendor.js'
    = javascript_pack_tag 'application'

    %link{ href: asset_path('favicon.ico', skip_pipeline: true), rel: 'shortcut icon', type: 'image/x-icon' }/
    = yield :head

    - if Rails.env.production?
      :javascript
        dataLayer = [];
      / Google Tag Manager
      :javascript
        (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
        new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
        j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
        'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
        })(window,document,'script','dataLayer','GTM-PMV3DGW');
      / End Google Tag Manager

  %body
    - if Rails.env.production?
      / Google Tag Manager (noscript)
      %noscript
        %iframe#gtm-iframe{ height: '0', src: 'https://www.googletagmanager.com/ns.html?id=GTM-PMV3DGW', width: '0' }
      / End Google Tag Manager (noscript)

    = render 'layouts/nav'
    / Top content
    .top-content
      .container
        = yield :top_content if content_for?(:top_content)

    / Features
    .features-container.section-container
      .container
        #flash= render partial: 'layouts/flash', collection: %i[notice alert danger warning success], as: :level

        = render 'cookies_eu/consent_banner'
        .row
          .col-sm-12.features.section-description.wow.fadeIn
            %h1= @title
            .divider-1
              .line
            - unless @disable_subtitle
              - if content_for?(:subtitle)
                = yield :subtitle
              - else
                %p.medium-paragraph
                  Divoriamo chilometri per sfamare la nostra passione, la nostra Dea corre, ovunque la seguirem!
        - if content_for(:tools) || content_for(:actions)
          .row.actions.crud-actions
            .col-md-5
              = yield :tools
            .col-md-7
              .btn-toolbar.pull-right
                = yield :actions
        = yield
    = render 'layouts/footer', cached: true

    = javascript_include_tag 'application.js'
    = javascript_tag yield(:javascripts) if content_for?(:javascripts)
    = yield :page_javascript if content_for?(:page_javascript)