!!!
%html{:lang => 'en'}
  %head
    %meta{:charset => 'utf-8'}/
    %meta{:content => 'IE=Edge,chrome=1', 'http-equiv' => 'X-UA-Compatible'}/
    %meta{:content => 'width=device-width, initial-scale=1.0', :name => 'viewport'}/
    %title= website_title_with_app_name
    = csrf_meta_tags
    / Le HTML5 shim, for IE6-8 support of HTML elements
    /[if lt IE 9]
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>

    = stylesheet_link_tag 'bootstrap_setup', :media => 'all'
    = stylesheet_link_tag 'bootstrap_layout', :media => 'all'
    = stylesheet_link_tag 'application', :media => 'all'
    
    / For third-generation iPad with high-resolution Retina display:
    / Size should be 144 x 144 pixels
    = favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144'
    / For iPhone with high-resolution Retina display:
    / Size should be 114 x 114 pixels
    = favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114'
    / For first- and second-generation iPad:
    / Size should be 72 x 72 pixels
    = favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72'
    / For non-Retina iPhone, iPod Touch, and Android 2.1+ devices:
    / Size should be 57 x 57 pixels
    = favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png'
    / For all other devices
    / Size should be 32 x 32 pixels
    = favicon_link_tag 'favicon.ico', :rel => 'shortcut icon'
    
    = gmaps4rails_api_script_tags
    = javascript_include_tag 'application'
    = yield :scripts
    = yield :head

  %body{:class => controller.controller_name, data: { locale: I18n.locale }}
    - if user_account_signed_in?
      %nav#logged-in-bar.navbar.navbar-default.navbar-fixed-top
        .container-fluid
          .navbar-header
            %button.navbar-toggle.collapsed{data: {toggle: 'collapse', target: '#logged-in-bar-collapse'}}
              %span.sr-only Toggle Navigation
              %span.icon-bar
              %span.icon-bar
              %span.icon-bar
            %a.navbar-brand{:href => '#'}= app_name

          .collapse.navbar-collapse#logged-in-bar-collapse
            %ul.nav.navbar-nav
              %li
                = link_to t(:my_profile), current_user, :class => 'my_profile'
              %li.dropdown.my_groups
                %a.dropdown-toggle{href: my_groups_path, data: {toggle: 'dropdown'}}
                  = t :my_groups
                  %b.caret= ''
                %ul.dropdown-menu
                  = groups_of_user_table current_user
              
              - # role indicator and preview menu
              = render partial: 'layouts/role_preview_switcher'

              - # %li.dropdown
              - #   = link_to(                                                                   |
              - #     ( t(:bookmarks) + ' ' + content_tag( :b, '', class: 'caret' ) ).html_safe, |
              - #     my_bookmarks_path,                                                         |
              - #     class: 'dropdown-toggle', data: { toggle: 'dropdown' } )                   |
              - #   %ul.dropdown-menu.my-favorites
              - #     = bookmarked_objects_lis( current_user )

            %ul.nav.navbar-nav.navbar-right
              %li.last.dropdown
                %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => '#'}
                  = render 'layouts/session_bar_avatar'
                  = current_user.title
                  %b.caret
                %ul.dropdown-menu{role: 'menu'}
                  %li= link_to t(:my_profile), user_path(current_user)
                  %li= link_to t(:change_avatar), user_path(current_user, trigger_change_avatar: true)
                  %li= link_to t(:change_password), change_password_path
                  %li= link_to t(:settings), user_settings_path(current_user)
                  %li= link_to t(:logout), destroy_user_account_session_url, method: :delete

    .row#header-bar
      .col-sm-2.col-xs-12
        %span#logo
          = link_to image_tag('logo.png'), root_path, class: 'navbar-brand'
      
      .col-md-6.col-sm-5.col-xs-12
        %span#category_indicator.right
          %ul.nav.navbar-nav.nav-pills#horizontal_nav= horizontal_nav_lis
        
      .col-md-4.col-sm-5.col-xs-12
        = render partial: 'layouts/help_button'
        %span#header_search
          %span#search_box= render partial: 'shared/search_box'
    
    .row
      %nav#breadcrumb.navbar
        .container-fluid
          = breadcrumb_ul
    
    .container-fluid
      .row
        #content
          - if show_vertical_nav?
            .col-md-3
              .container-fluid
                .col-xs-8.col-md-12
                  = vertical_nav
                .col-xs-4
                  .row= render partial: 'last_seen_activities/index'
            .col-md-9#content_area
              = flash_area
              = replace_unicode_special_chars_by_html_escape_strings( |
                  convert_to_content_box { yield }                    |
                )                                                     |
            \ 
          - else
            #content_area
              = flash_area
              = replace_unicode_special_chars_by_html_escape_strings( |
                  convert_to_content_box { yield }                    |
                )                                                     |    
        
    %footer.footer#footer
      %div.container.narrow.row
        %ul.footer-links
          %li
            %a(href="https://github.com/fiedl/your_platform") github
          %li.muted ·
          %li
            %a= link_to t(:imprint), Page.find_by_flag(:imprint)
          %li.muted ·
          - if current_user
            %li
              = link_to t(:terms_of_use), terms_path
            %li.muted ·
          %li= language_switcher_html
      #footer_line
      .clear
      %small
        #version_footer= app_version_footer