<commit_before>{% extends "layouts/base.html" %}
{% load i18n %}


{% block title %}
{{ bread_crumb_trail|join:" | " }}
{% endblock %}


{% block body %}
<!-- lava-container -->
<div id="lava-container">

  {% block header %}
  <!-- header -->
  <div id="lava-panel">

    {% block menu %}
    <!-- menu -->
    <div id="lava-menu-bar-left">
    {% for menu in lava.menu_list %}
    <div class="lava-panel-element{% if menu.sub_menu %} has-menu{% endif %}">
      <a class="lava-panel-menu-text" href="{{ menu.url }}">{{ menu.label }}{% if menu.sub_menu %} &#x25BE;{% endif %}</a>
      {% if menu.sub_menu %}
      <ul class="lava-panel-menu">
      {% for sub_menu in menu.sub_menu %}
        <li><a href="{{ sub_menu.url }}">{{ sub_menu.label }}</a></li>
      {% endfor %}
      </ul>
      {% endif %}
    </div>
    {% endfor %}
    <!-- !menu -->
    {% endblock menu %}
    </div>
    <!-- !lava menu bar left -->
    <div id="lava-menu-bar-right">
    <!-- ajax indicator -->
    <div class="lava-panel-element lava-indicator no-hover" id="lava-ajax-indicator">
      <div class="lava-panel-menu-text">
        <img src="{{ STATIC_URL }}lava-server/images/ajax-loader.gif" alt="AJAX progress indicator"/>
      </div>
    </div>
    <script type="text/javascript">
      $(document).ajaxStart(function() {
        $('#lava-ajax-indicator').animate({
          opacity: 1.0
        }, "fast", function() {
          $("#lava-ajax-indicator").css("visibility", "visible");
        });
      }).ajaxStop(function() {
        $('#lava-ajax-indicator').animate({
          opacity: 0.0
        }, "fast", function() {
          $("#lava-ajax-indicator").css("visibility", "hidden");
        });
      });
    </script>
    <!-- !ajax indicator -->


    <!-- instance name indicator -->
    {% if lava.instance_name %}
    <div class="lava-indicator lava-panel-element" id="lava-instance-name-indicator">Instance: {{ lava.instance_name }}</div>
    {% endif %}
    <!-- !instance name indicator -->

    <!-- user indicator -->
    <div class="lava-indicator lava-panel-element {% if user.is_authenticated %}has-menu{% endif %}" id="lava-user-indicator">
      <div class="lava-panel-menu-text">
        {% if not user.is_authenticated %}
        <span class="sign-in-hint">Click to sign-in &#x25BB;</span>
        {% endif %}
        <img 
        src="{{ STATIC_URL }}lava-server/images/avatar-default-symbolic.svg"
        width="18" height="18"/>
        {% if user.is_authenticated %}
        <a href="{% url lava.me %}" class="username">{{user.get_full_name|default:user.username}} &#x25BE;</a>
        {% else %}
          {% if request.get_full_path == "/accounts/logout/" %}
            <a href="{% url django.contrib.auth.views.login %}"
	      class="username">{% trans "Guest" %}</a>
	  {% else %}
            <a href="{% url django.contrib.auth.views.login %}?next={{request.get_full_path}}"
	      class="username">{% trans "Guest" %}</a>
          {% endif %}
        {% endif %}
      </div>
      {% if user.is_authenticated %}
      <ul class="lava-panel-menu">
        <li><a href="{% url lava.me %}">My profile</a></li>
        {% if user.is_staff %}
        <li><a href="{% url admin:index %}">Administration</a></li>
        {% endif %}
        <li><a href="{% url django.contrib.auth.views.logout %}">Sign out</a></li>
      </ul>
      {% endif %}
    </div>
    <!-- !user indicator -->
    </div>
    <!-- !lava menu bar right -->

  </div>
  <!-- !panel -->

  <script type="text/javascript">
    $(document).ready(function(){  
      // When true sub-mens should open on hover.
      // This mode is enabled by the first click on a top-level menu.
      var menu_should_open = false;

      var current_menu = null;
      var current_sub_menu = null;

      function close_current_menu() {
        if (current_menu) {
          //console.log("--- closing current menu ---");
          current_menu.removeClass("active");
          current_menu = null;
        }
        if (current_sub_menu) {
          //console.log("--- closing current sub menu ---");
          current_sub_menu.offset({top: -1000, left: 0});
          current_sub_menu = null;
        }
      }

      // Leaving the panel closes all menus and disables "preview" mode where
      // menus open automatically.
      $("#lava-panel").bind('mouseleave', function() {
        menu_should_open = false;
        $("#lava-panel").removeClass("active")
        close_current_menu();
      });

      $('.lava-panel-element')
        .bind('mouseenter', function() {
          if (menu_should_open) {
            close_current_menu();
            if ($(this).hasClass("has-menu")) {
              $(this).click();
            }
          }
        });

      // Clicking on a panel element with a menu does stuff
      $('.lava-panel-element.has-menu')
        .click(function(event) {

          //console.log("----------------------");

          // Enter hover-mode
          menu_should_open = true;
          $("#lava-panel").addClass("active");

          if ($(this).children(".lava-panel-menu").position().top > -500) {
            // Clicking on a menu with a visible sub-menu just triggers the link
            return;
          }
          // Since our menu headers are links (for compatibility) let's prevent
          // the default link action from firing
          event.preventDefault();

          // Find the sub menu 
          var self = $(this);
          current_menu = self;
          current_sub_menu = self.children(".lava-panel-menu");

          // Add an 'active' class to the current menu, this showes up as a nice gradient
          current_menu.addClass("active");

          // The top absolute position of the menu.
          // Defaults to the bottom border of the panel
          var _top = $("#lava-panel").outerHeight(true);

          // The left absolute position of the menu.
          // defaults to the offset of the indicator span
          var _left = current_menu.offset().left;
          //console.log("_left is ", _left);

          // Same with the right menu, the right margin
          var _menu_width = current_menu.width();
          //console.log("_menu_width is ", _menu_width);

          // Same with the right menu, the right margin
          var _sub_menu_width = current_sub_menu.width();
          //console.log("_sub_menu_width is ", _sub_menu_width);

          // Adjust the width to consider the border of the pop-up menu.
          var _sub_menu_width_adj = current_sub_menu.outerWidth() - current_sub_menu.width();
          //console.log("_sub_menu_width_adj is ", _sub_menu_width_adj);

          // Check how much space we have left
          var _space_left = $("#lava-panel").width() - _left - current_sub_menu.outerWidth(true);
          //console.log("_space left is ", _space_left);

          // If we ran out of space then let's move the whole thing to the left
          // This is only needed for the user indicator.
          if (_space_left < 0) {
            _left += _space_left;
            _sub_menu_width += _sub_menu_width_adj;
            //console.log(
            //  "sub-menu would go off-screen",
            //  " _left changes to ", _left,
            //  " _sub_menu_width changes to ", _sub_menu_width
            //);
          }

          // Don't set the width if it would make the menu too narrow.
          if (_sub_menu_width < _menu_width) {
            _sub_menu_width = _menu_width - _sub_menu_width_adj;
            //console.log("sub-menu is too narrow, _sub_menu_width changes to ", _menu_width);
          }

          // Place & resize the sub menu
          // console.log("Setting position to ", {top: _top, left: _left});
          // console.log("Setting width to ", _sub_menu_width);
          current_sub_menu
            .width(_sub_menu_width)
            .offset({left: _left, top: _top})
            .bind('mouseleave', function() { close_current_menu(); });
          // Slide it down
          // .slideDown("fast")
          // And bind a mouse leave event to close it when
        });

    });
  </script>
  {% endblock header %}

  {% block before_content %}
  {% endblock %}

  {% spaceless %}
  <div id="lava-around-content">
    {% block breadcrumb_container %}
    <!-- breadcrumbs -->
    <div id="lava-breadcrumbs">
      <b>{% trans "You are here:" %}</b>
      <ul>
        {% block breadcrumbs %}
        {% for bread_crumb in bread_crumb_trail %}
        <li><a 
          href="{{ bread_crumb.get_absolute_url }}"
          >{{ bread_crumb.get_name }}</a></li>
        {% endfor %}
        {% endblock %}
      </ul>
    </div>
    <!-- !breadcrumbs -->
    {% endblock breadcrumb_container %}

    {% block content-and-sidebar %}
    <!-- sidebar (not in this layout) -->
    <div id="lava-content-without-sidebar">
      <div id="lava-content">
        <!-- content -->
        {% block content %}{% endblock %}
        <!-- !content -->
      </div>
    </div>
    {% endblock %}
  </div>
  {% endspaceless %}

  <div id="lava-footer-sanitizer"></div>

  <!-- footer -->
  <div id="lava-footer">
    {% block footer %}
    <ul>
      <li><a href="{% url lava.version_details %}">{% trans "LAVA version" %}</a></li>
      <li><a href="https://bugs.launchpad.net/lava/+filebug" >Report a bug</a></li>
      <li><a href="http://launchpad.net/lava/">Source Code</a></li>
      <li><a href="http://validator.w3.org/check?uri=referer">Validate HTML</a></li>
    </ul>
    <p>LAVA Server is free software developed by <a
      href="http://linaro.org">Linaro</a>. It is distributed under the terms
    of the <a href="http://www.gnu.org/licenses/agpl-3.0.html"
      >GNU Affero General Public License version 3</a>.
    <br/>
    <strong>You have the right to obtain source code of any server side
      installations of this software that you interact with.</strong>.</p>
    {% endblock footer %}
  </div>
  <!-- !footer -->
</div>
<!-- !lava-container -->
{% endblock body %}
<commit_msg>fix for missing redirect after logout<commit_after>{% extends "layouts/base.html" %}
{% load i18n %}


{% block title %}
{{ bread_crumb_trail|join:" | " }}
{% endblock %}


{% block body %}
<!-- lava-container -->
<div id="lava-container">

  {% block header %}
  <!-- header -->
  <div id="lava-panel">

    {% block menu %}
    <!-- menu -->
    <div id="lava-menu-bar-left">
    {% for menu in lava.menu_list %}
    <div class="lava-panel-element{% if menu.sub_menu %} has-menu{% endif %}">
      <a class="lava-panel-menu-text" href="{{ menu.url }}">{{ menu.label }}{% if menu.sub_menu %} &#x25BE;{% endif %}</a>
      {% if menu.sub_menu %}
      <ul class="lava-panel-menu">
      {% for sub_menu in menu.sub_menu %}
        <li><a href="{{ sub_menu.url }}">{{ sub_menu.label }}</a></li>
      {% endfor %}
      </ul>
      {% endif %}
    </div>
    {% endfor %}
    <!-- !menu -->
    {% endblock menu %}
    </div>
    <!-- !lava menu bar left -->
    <div id="lava-menu-bar-right">
    <!-- ajax indicator -->
    <div class="lava-panel-element lava-indicator no-hover" id="lava-ajax-indicator">
      <div class="lava-panel-menu-text">
        <img src="{{ STATIC_URL }}lava-server/images/ajax-loader.gif" alt="AJAX progress indicator"/>
      </div>
    </div>
    <script type="text/javascript">
      $(document).ajaxStart(function() {
        $('#lava-ajax-indicator').animate({
          opacity: 1.0
        }, "fast", function() {
          $("#lava-ajax-indicator").css("visibility", "visible");
        });
      }).ajaxStop(function() {
        $('#lava-ajax-indicator').animate({
          opacity: 0.0
        }, "fast", function() {
          $("#lava-ajax-indicator").css("visibility", "hidden");
        });
      });
    </script>
    <!-- !ajax indicator -->


    <!-- instance name indicator -->
    {% if lava.instance_name %}
    <div class="lava-indicator lava-panel-element" id="lava-instance-name-indicator">Instance: {{ lava.instance_name }}</div>
    {% endif %}
    <!-- !instance name indicator -->

    <!-- user indicator -->
    <div class="lava-indicator lava-panel-element {% if user.is_authenticated %}has-menu{% endif %}" id="lava-user-indicator">
      <div class="lava-panel-menu-text">
        {% if not user.is_authenticated %}
        <span class="sign-in-hint">Click to sign-in &#x25BB;</span>
        {% endif %}
        <img 
        src="{{ STATIC_URL }}lava-server/images/avatar-default-symbolic.svg"
        width="18" height="18"/>
        {% if user.is_authenticated %}
        <a href="{% url lava.me %}" class="username">{{user.get_full_name|default:user.username}} &#x25BE;</a>
        {% else %}
          {% if request.get_full_path == "/accounts/logout/" %}
            <a href="{% url django.contrib.auth.views.login %}"
	      class="username">{% trans "Guest" %}</a>
	  {% else %}
            <a href="{% url django.contrib.auth.views.login %}?next={{request.get_full_path}}"
	      class="username">{% trans "Guest" %}</a>
          {% endif %}
        {% endif %}
      </div>
      {% if user.is_authenticated %}
      <ul class="lava-panel-menu">
        <li><a href="{% url lava.me %}">My profile</a></li>
        {% if user.is_staff %}
        <li><a href="{% url admin:index %}">Administration</a></li>
        {% endif %}
        <li><a href="{% url django.contrib.auth.views.logout %}?next={{ MOUNT_POINT }}/">Sign out</a></li>
      </ul>
      {% endif %}
    </div>
    <!-- !user indicator -->
    </div>
    <!-- !lava menu bar right -->

  </div>
  <!-- !panel -->

  <script type="text/javascript">
    $(document).ready(function(){  
      // When true sub-mens should open on hover.
      // This mode is enabled by the first click on a top-level menu.
      var menu_should_open = false;

      var current_menu = null;
      var current_sub_menu = null;

      function close_current_menu() {
        if (current_menu) {
          //console.log("--- closing current menu ---");
          current_menu.removeClass("active");
          current_menu = null;
        }
        if (current_sub_menu) {
          //console.log("--- closing current sub menu ---");
          current_sub_menu.offset({top: -1000, left: 0});
          current_sub_menu = null;
        }
      }

      // Leaving the panel closes all menus and disables "preview" mode where
      // menus open automatically.
      $("#lava-panel").bind('mouseleave', function() {
        menu_should_open = false;
        $("#lava-panel").removeClass("active")
        close_current_menu();
      });

      $('.lava-panel-element')
        .bind('mouseenter', function() {
          if (menu_should_open) {
            close_current_menu();
            if ($(this).hasClass("has-menu")) {
              $(this).click();
            }
          }
        });

      // Clicking on a panel element with a menu does stuff
      $('.lava-panel-element.has-menu')
        .click(function(event) {

          //console.log("----------------------");

          // Enter hover-mode
          menu_should_open = true;
          $("#lava-panel").addClass("active");

          if ($(this).children(".lava-panel-menu").position().top > -500) {
            // Clicking on a menu with a visible sub-menu just triggers the link
            return;
          }
          // Since our menu headers are links (for compatibility) let's prevent
          // the default link action from firing
          event.preventDefault();

          // Find the sub menu 
          var self = $(this);
          current_menu = self;
          current_sub_menu = self.children(".lava-panel-menu");

          // Add an 'active' class to the current menu, this showes up as a nice gradient
          current_menu.addClass("active");

          // The top absolute position of the menu.
          // Defaults to the bottom border of the panel
          var _top = $("#lava-panel").outerHeight(true);

          // The left absolute position of the menu.
          // defaults to the offset of the indicator span
          var _left = current_menu.offset().left;
          //console.log("_left is ", _left);

          // Same with the right menu, the right margin
          var _menu_width = current_menu.width();
          //console.log("_menu_width is ", _menu_width);

          // Same with the right menu, the right margin
          var _sub_menu_width = current_sub_menu.width();
          //console.log("_sub_menu_width is ", _sub_menu_width);

          // Adjust the width to consider the border of the pop-up menu.
          var _sub_menu_width_adj = current_sub_menu.outerWidth() - current_sub_menu.width();
          //console.log("_sub_menu_width_adj is ", _sub_menu_width_adj);

          // Check how much space we have left
          var _space_left = $("#lava-panel").width() - _left - current_sub_menu.outerWidth(true);
          //console.log("_space left is ", _space_left);

          // If we ran out of space then let's move the whole thing to the left
          // This is only needed for the user indicator.
          if (_space_left < 0) {
            _left += _space_left;
            _sub_menu_width += _sub_menu_width_adj;
            //console.log(
            //  "sub-menu would go off-screen",
            //  " _left changes to ", _left,
            //  " _sub_menu_width changes to ", _sub_menu_width
            //);
          }

          // Don't set the width if it would make the menu too narrow.
          if (_sub_menu_width < _menu_width) {
            _sub_menu_width = _menu_width - _sub_menu_width_adj;
            //console.log("sub-menu is too narrow, _sub_menu_width changes to ", _menu_width);
          }

          // Place & resize the sub menu
          // console.log("Setting position to ", {top: _top, left: _left});
          // console.log("Setting width to ", _sub_menu_width);
          current_sub_menu
            .width(_sub_menu_width)
            .offset({left: _left, top: _top})
            .bind('mouseleave', function() { close_current_menu(); });
          // Slide it down
          // .slideDown("fast")
          // And bind a mouse leave event to close it when
        });

    });
  </script>
  {% endblock header %}

  {% block before_content %}
  {% endblock %}

  {% spaceless %}
  <div id="lava-around-content">
    {% block breadcrumb_container %}
    <!-- breadcrumbs -->
    <div id="lava-breadcrumbs">
      <b>{% trans "You are here:" %}</b>
      <ul>
        {% block breadcrumbs %}
        {% for bread_crumb in bread_crumb_trail %}
        <li><a 
          href="{{ bread_crumb.get_absolute_url }}"
          >{{ bread_crumb.get_name }}</a></li>
        {% endfor %}
        {% endblock %}
      </ul>
    </div>
    <!-- !breadcrumbs -->
    {% endblock breadcrumb_container %}

    {% block content-and-sidebar %}
    <!-- sidebar (not in this layout) -->
    <div id="lava-content-without-sidebar">
      <div id="lava-content">
        <!-- content -->
        {% block content %}{% endblock %}
        <!-- !content -->
      </div>
    </div>
    {% endblock %}
  </div>
  {% endspaceless %}

  <div id="lava-footer-sanitizer"></div>

  <!-- footer -->
  <div id="lava-footer">
    {% block footer %}
    <ul>
      <li><a href="{% url lava.version_details %}">{% trans "LAVA version" %}</a></li>
      <li><a href="https://bugs.launchpad.net/lava/+filebug" >Report a bug</a></li>
      <li><a href="http://launchpad.net/lava/">Source Code</a></li>
      <li><a href="http://validator.w3.org/check?uri=referer">Validate HTML</a></li>
    </ul>
    <p>LAVA Server is free software developed by <a
      href="http://linaro.org">Linaro</a>. It is distributed under the terms
    of the <a href="http://www.gnu.org/licenses/agpl-3.0.html"
      >GNU Affero General Public License version 3</a>.
    <br/>
    <strong>You have the right to obtain source code of any server side
      installations of this software that you interact with.</strong>.</p>
    {% endblock footer %}
  </div>
  <!-- !footer -->
</div>
<!-- !lava-container -->
{% endblock body %}

{'fraction_non_alphanumeric': 0.17071592153738924, 'fraction_numerical': 0.002887583391416907, 'mean_word_length': 2.0625095288915993, 'pattern_counts': {'":': 0, '<': 255, '<?xml version=': 0, '>': 253, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2754801', 'n_tokens_mistral': 6442, 'n_tokens_neox': 6031, 'n_words': 1479}