## mako

<%page expression_filter="h"/>

<%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 _
%>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
  <ul class="navbar-nav mr-auto">
  % if static.get_value('ENABLE_MKTG_SITE', settings.FEATURES.get('ENABLE_MKTG_SITE', False)):
    <li class="nav-item">
      <a class="nav-link mt-2" href="${marketing_link('HOW_IT_WORKS')}">${_("How it Works")}</a>
    </li>
    % if settings.FEATURES.get('COURSES_ARE_BROWSABLE'):
      <li class="nav-item">
        <a class="nav-link mt-2" href="${marketing_link('COURSES')}">${_("Courses")}</a>
      </li>
    % endif
    <li class="nav-item">
      <a class="nav-link mt-2" href="${marketing_link('SCHOOLS')}">${_("Schools")}</a>
    </li>
  % endif

  % if not settings.FEATURES['DISABLE_LOGIN_BUTTON'] and not combined_login_and_register:
    % if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
      <li class="nav-item">
        <a class="nav-link mt-2" href="/courses">${_('Explore courses')}</a>
      </li>
    %endif
    % if course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
      <li class="nav-item">
        <a class="nav-link mt-2 btn-register" href="${reverse('course-specific-register', args=[course.id.to_deprecated_string()])}">${_("Register")}</a>
      </li>
    % elif static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')):
      <li class="nav-item">
        <a class="nav-link mt-2" href="/register${login_query()}">${_("Register")}</a>
      </li>
    % endif
  % endif
  </ul>
  <ul class="navbar-nav">
    <li class="nav-item">
      % if not settings.FEATURES['DISABLE_LOGIN_BUTTON'] and not combined_login_and_register:
        % if course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
          <a class="btn btn-primary mt-2" role="button" href="${reverse('course-specific-login', args=[course.id.to_deprecated_string()])}${login_query()}">
            ${_("Sign in")}
          </a>
        % else:
          <a class="btn btn-primary mt-2" role="button" href="/login${login_query()}">
            ${_("Sign in")}
          </a>
        % endif
      % endif
    </li>
  </ul>
</div>
