af83/chouette-core

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

Summary

Maintainability
Test Coverage
doctype html
html lang=I18n.locale
  head
    meta charset="utf-8"
    meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"

    = csrf_meta_tag

    javascript:
     window.testSecurity = function() {
       document.getElementsByClassName('security')[0].innerHTML = "<p id='security-issue'>Security Issue</p>"
     }

    title
      = t('brandname') + " | "
      = page_title

    // Webpack bundle
    = favicon_pack_tag 'static/favicon.ico'
    - additional_packs = (yield :additional_packs).split.to_set.to_a
    = javascript_pack_tag 'application', *additional_packs, defer: true
    = stylesheet_pack_tag 'application'

    // Sprockets bundle
    = javascript_include_tag 'application'

    = javascript_tag do
      | I18n.locale = '#{I18n.locale}'

  body(x-data="{ mainNavLeftIsOpen: #{current_page?('/') ? "true" : "false"}, profileMenuIsOpen: false }" x-on:keydown.escape="mainNavLeftIsOpen = false; profileMenuIsOpen = false" x-on:scroll="profileMenuIsOpen = false")
    nav#main_nav
      // Left menu content
      = render 'layouts/navigation/main_nav_left'
      // Top menu content
      = render 'layouts/navigation/main_nav_top'
    .notifications
    = render 'layouts/flash_messages', flash: flash
    .security
    = render 'layouts/navigation/page_header'
    = yield
    #sidebar
      = yield :sidebar

    = yield :javascript