!!!
%html{ lang: 'en', "data-bs-theme-from-user": theme_from_user }
  %head
    %meta{ content: 'charset=utf-8' }/
    %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1, shrink-to-fit=no' }
    - if @metarobots
      %meta{ content: @metarobots, name: 'robots' }/
    = favicon_link_tag
    %title
      = "#{@pagetitle} - " if @pagetitle
      = home_title
    %meta{ property: 'og:title', content: meta_title }
    %meta{ property: 'og:site_name', content: home_title }
    %meta{ property: 'og:type', content: 'website' }
    %meta{ property: 'og:url', content: request.original_url }
    %meta{ property: 'og:image', content: meta_image }
    - if meta_description
      %meta{ property: 'og:description', content: meta_description }

    - if CONFIG['errbit_javascript_api_key'] && CONFIG['errbit_javascript_host']
      %meta{ property: 'errbit:key', content: CONFIG['errbit_javascript_api_key'] }
      %meta{ property: 'errbit:host', content: CONFIG['errbit_javascript_host'] }

    = stylesheet_link_tag 'webui/application'
    = javascript_include_tag 'webui/application'
    = javascript_importmap_tags

    = yield :content_for_head
    - if content_for?(:head_style)
      %style{ type: 'text/css' }
        = yield :head_style
    = javascript_tag do
      = yield :head_javascript
      var _paq = _paq || [];
      $(function() { #{yield :ready_function} });

    = auto_discovery_link_tag(:rss, news_feed_path(format: 'rss'), title: 'News')
    = csrf_meta_tag
    - if User.session&.rss_secret.present?
      = auto_discovery_link_tag(:rss, user_rss_notifications_url(secret: User.session.rss_secret, format: :rss), title: 'Notifications')
    = auto_discovery_link_tag(:rss, latest_updates_feed_path(format: 'rss'), title: 'Latest updates')
  %body{ class: feature_css_class }
    #grid
      #top-navigation-area
        = render partial: 'layouts/webui/top_navigation', locals: { unread_notifications_count: @unread_notifications_count }
      .navbar-themed-colors#left-navigation-area{ class: "#{'collapsed' if sidebar_collapsed?}" }
        = render partial: 'layouts/webui/left_navigation', locals: { spider_bot: @spider_bot }
        = render partial: 'layouts/webui/left_navigation_collapse_button'
      .d-flex.flex-column#content-area
        - if @current_notification || @current_request_action
          = render partial: 'layouts/webui/notification_toolbar', locals: { notification: @current_notification,
                                                                            request_action: @current_request_action }
        .container-xxl.flex-grow-1.pb-3.border-bottom
          .sticky-top.flash-and-announcement.text-break
            = render partial: 'layouts/webui/status_message_announcement', locals: { current_announcement: @current_announcement }
            #flash= render partial: 'layouts/webui/flash', object: flash
          .modal.fade#modal{ tabindex: '-1', role: 'dialog', aria: { labelledby: 'modalLabel', hidden: true } }

          .row.flex-column
            .col#breadcrumbs
              = render partial: 'layouts/webui/breadcrumbs'
            .col#content{ class: "#{'expanded' if sidebar_collapsed?}" }
              = yield

        .container-fluid.mt-4.mb-2.py-2#footer
          = render partial: 'layouts/webui/footer', locals: { configuration: @configuration, spider_bot: @spider_bot }
        .container-fluid.py-2#sponsors
          = render SponsorsComponent.new
        .container-fluid.mt-2.py-2#footer-legal
          %p.text-center
            The Open Build Service is an
            = succeed '.' do
              = link_to('openSUSE project', 'https://www.opensuse.org')

      - if !current_page?(signup_path) && !current_page?(new_session_path)
        #bottom-navigation-area
          = render partial: 'layouts/webui/bottom_navigation',locals: { spider_bot: @spider_bot,
                                                                        unread_notifications_count: @unread_notifications_count }

      -# Collapsible menu shared between top and bottom navigation
      - if User.session
        .navbar-collapse.navbar-themed-colors.watchlist-collapse
          = render WatchlistComponent.new(user: User.session,
                                          bs_request: @bs_request,
                                          package: @package,
                                          project: @project,
                                          current_object: @bs_request || @package || @project,
                                          bs_requests: @watched_requests,
                                          packages: @watched_packages,
                                          projects: @watched_projects)
        = render DeleteConfirmationDialogComponent.new(modal_id: 'delete-item-from-watchlist-modal', method: :put, options: { remote: true })
