<commit_before>## mako
<%page expression_filter="h" args="online_help_token"/>
<%namespace name='static' file='static_content.html'/>
<%namespace file='main.html' import="login_query"/>
<%!
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from student.models import UserProfile

from context_processors import doc_url
from lms.djangoapps.ccx.overrides import get_current_ccx
from openedx.core.djangolib.markup import HTML, Text

# App that handles subdomain specific branding
from branding import api as branding_api
# app that handles site status messages
from status.status import get_site_status_msg
%>

## Provide a hook for themes to inject branding on top.
<%block name="navigation_top">
    <%static:optional_include_mako file="navigation_top.html" />
</%block>

## Add UI Toolkit components if using the Pattern Library
% if uses_pattern_library:
    <%block name="js_extra">
    <%static:require_module module_name="js/header_factory" class_name="HeaderFactory">
    HeaderFactory();
    </%static:require_module>
    </%block>
% endif

<%block>
<%
try:
    course_id = course.id
except:
    # can't figure out a better way to get at a possibly-defined course var
    course_id = None
site_status_msg = get_site_status_msg(course_id)
%>
% if site_status_msg:
<div class="site-status">
  <div class="inner-wrapper">
    <span class="white-error-icon"></span>
    <p>${site_status_msg}</p>
  </div>
</div>
% endif
</%block>
  <header id="global-navigation" class="header-global ${"slim" if course else ""}" >
    <nav class="wrapper-header" aria-label="${_('Global')}">
    <h1 class="logo">
      <a href="${marketing_link('ROOT')}">
        <%block name="navigation_logo">
            <img height="50"
                 src="${branding_api.get_logo_url(is_secure)}" alt="${_("{platform_name} Home Page").format(platform_name=static.get_platform_name())}"/>
        </%block>
      </a>
    </h1>

    % if course:
      <h2 class="course-header"><span class="provider">${course.display_org_with_default}:</span>
        <span class="course-number">${course.display_number_with_default}</span>
        <%
        display_name = course.display_name_with_default
        if settings.FEATURES.get('CUSTOM_COURSES_EDX', False):
          ccx = get_current_ccx(course.id)
          if ccx:
            display_name = ccx.display_name
        %>
        <span class="course-name">${display_name}</span></h2>
      % endif

      % if UserProfile.has_registered(user):
        <ol class="left nav-global list-inline authenticated">
        <%block name="navigation_global_links_authenticated">
          % if settings.FEATURES.get('COURSES_ARE_BROWSABLE') and not show_program_listing:
            <li class="item nav-global-01">
              <a href="${marketing_link('COURSES')}">${_('Explore courses')}</a>
            </li>
          % endif
          % if show_program_listing:
            <li class="tab-nav-item">
              <a class="${'active ' if reverse('dashboard') == request.path else ''}tab-nav-link" href="${reverse('dashboard')}">
                ${_("Courses")}
              </a>
            </li>
            <li class="tab-nav-item">
              <a class="${'active ' if reverse('program_listing_view') in request.path else ''}tab-nav-link" href="${reverse('program_listing_view')}">
                ${_("Programs")}
              </a>
            </li>
          % endif
          %if settings.FEATURES.get('ENABLE_SYSADMIN_DASHBOARD','') and user.is_staff:
            <li class="item">
              ## Translators: This is short for "System administration".
              <a href="${reverse('sysadmin')}">${_("Sysadmin")}</a>
            </li>
          %endif
        </%block>
      </ol>

      <%include file="user_dropdown.html"/>

      <a href="${get_online_help_info(online_help_token)['doc_url']}" 
         target="_blank"
         class="doc-link">${_("Help")}</a>

      % if should_display_shopping_cart_func() and not (course and static.is_request_in_themed_site()): # see shoppingcart.context_processor.user_has_cart_context_processor
        <ol class="user">
          <li class="primary">
            <a class="shopping-cart" href="${reverse('shoppingcart.views.show_cart')}">
              <span class="icon fa fa-shopping-cart" aria-hidden="true"></span> ${_("Shopping Cart")}
            </a>
          </li>
        </ol>
      % endif
    % else:
      <ol class="left list-inline nav-global">
        <%block name="navigation_global_links">
          % if static.get_value('ENABLE_MKTG_SITE', settings.FEATURES.get('ENABLE_MKTG_SITE', False)):
            <li class="item nav-global-01">
              <a href="${marketing_link('HOW_IT_WORKS')}">${_("How it Works")}</a><commit_msg>Feature flag LMS contextual help link<commit_after>## mako
<%page expression_filter="h" args="online_help_token"/>
<%namespace name='static' file='static_content.html'/>
<%namespace file='main.html' import="login_query"/>
<%!
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from student.models import UserProfile

from context_processors import doc_url
from lms.djangoapps.ccx.overrides import get_current_ccx
from openedx.core.djangolib.markup import HTML, Text

# App that handles subdomain specific branding
from branding import api as branding_api
# app that handles site status messages
from status.status import get_site_status_msg
%>

## Provide a hook for themes to inject branding on top.
<%block name="navigation_top">
    <%static:optional_include_mako file="navigation_top.html" />
</%block>

## Add UI Toolkit components if using the Pattern Library
% if uses_pattern_library:
    <%block name="js_extra">
    <%static:require_module module_name="js/header_factory" class_name="HeaderFactory">
    HeaderFactory();
    </%static:require_module>
    </%block>
% endif

<%block>
<%
try:
    course_id = course.id
except:
    # can't figure out a better way to get at a possibly-defined course var
    course_id = None
site_status_msg = get_site_status_msg(course_id)
%>
% if site_status_msg:
<div class="site-status">
  <div class="inner-wrapper">
    <span class="white-error-icon"></span>
    <p>${site_status_msg}</p>
  </div>
</div>
% endif
</%block>
  <header id="global-navigation" class="header-global ${"slim" if course else ""}" >
    <nav class="wrapper-header" aria-label="${_('Global')}">
    <h1 class="logo">
      <a href="${marketing_link('ROOT')}">
        <%block name="navigation_logo">
            <img height="50"
                 src="${branding_api.get_logo_url(is_secure)}" alt="${_("{platform_name} Home Page").format(platform_name=static.get_platform_name())}"/>
        </%block>
      </a>
    </h1>

    % if course:
      <h2 class="course-header"><span class="provider">${course.display_org_with_default}:</span>
        <span class="course-number">${course.display_number_with_default}</span>
        <%
        display_name = course.display_name_with_default
        if settings.FEATURES.get('CUSTOM_COURSES_EDX', False):
          ccx = get_current_ccx(course.id)
          if ccx:
            display_name = ccx.display_name
        %>
        <span class="course-name">${display_name}</span></h2>
      % endif

      % if UserProfile.has_registered(user):
        <ol class="left nav-global list-inline authenticated">
        <%block name="navigation_global_links_authenticated">
          % if settings.FEATURES.get('COURSES_ARE_BROWSABLE') and not show_program_listing:
            <li class="item nav-global-01">
              <a href="${marketing_link('COURSES')}">${_('Explore courses')}</a>
            </li>
          % endif
          % if show_program_listing:
            <li class="tab-nav-item">
              <a class="${'active ' if reverse('dashboard') == request.path else ''}tab-nav-link" href="${reverse('dashboard')}">
                ${_("Courses")}
              </a>
            </li>
            <li class="tab-nav-item">
              <a class="${'active ' if reverse('program_listing_view') in request.path else ''}tab-nav-link" href="${reverse('program_listing_view')}">
                ${_("Programs")}
              </a>
            </li>
          % endif
          %if settings.FEATURES.get('ENABLE_SYSADMIN_DASHBOARD','') and user.is_staff:
            <li class="item">
              ## Translators: This is short for "System administration".
              <a href="${reverse('sysadmin')}">${_("Sysadmin")}</a>
            </li>
          %endif
        </%block>
      </ol>

      <%include file="user_dropdown.html"/>

      %if settings.FEATURES.get('ENABLE_CONTEXTUAL_LMS_HELP', False):
      <a href="${get_online_help_info(online_help_token)['doc_url']}" 
         target="_blank"
         class="doc-link">${_("Help")}</a>
      %endif

      % if should_display_shopping_cart_func() and not (course and static.is_request_in_themed_site()): # see shoppingcart.context_processor.user_has_cart_context_processor
        <ol class="user">
          <li class="primary">
            <a class="shopping-cart" href="${reverse('shoppingcart.views.show_cart')}">
              <span class="icon fa fa-shopping-cart" aria-hidden="true"></span> ${_("Shopping Cart")}
            </a>
          </li>
        </ol>
      % endif
    % else:
      <ol class="left list-inline nav-global">
        <%block name="navigation_global_links">
          % if static.get_value('ENABLE_MKTG_SITE', settings.FEATURES.get('ENABLE_MKTG_SITE', False)):
            <li class="item nav-global-01">
              <a href="${marketing_link('HOW_IT_WORKS')}">${_("How it Works")}</a>
{'fraction_non_alphanumeric': 0.15255813953488373, 'fraction_numerical': 0.0020671834625322996, 'mean_word_length': 3.0896027049873203, 'pattern_counts': {'":': 0, '<': 155, '<?xml version=': 0, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5298585', 'n_tokens_mistral': 3063, 'n_tokens_neox': 2985, 'n_words': 602}