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

<%
  allows_login = not settings.FEATURES['DISABLE_LOGIN_BUTTON'] and not combined_login_and_register
  can_discover_courses = settings.FEATURES.get('ENABLE_COURSE_DISCOVERY')
  restrict_enroll_for_course = course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain
  allow_public_account_creation = static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION'))
%>
<nav class="nav-links">
  <div class="secondary">
    <div>
      % if allows_login:
        % if restrict_enroll_for_course:
          <div class="mobile-nav-item hidden-mobile nav-item">
            <a class="register-btn btn" href="${reverse('course-specific-register', args=[course.id.to_deprecated_string()])}">${_("Register")}</a>
          </div>
          <div class="mobile-nav-item hidden-mobile nav-item">
            <a class="sign-in-btn btn" role="button" href="${reverse('course-specific-login', args=[course.id.to_deprecated_string()])}${login_query()}">${_("Sign in")}</a>
          </div>
        % else:
            % if allow_public_account_creation:
              <div class="mobile-nav-item hidden-mobile nav-item">
                <a class="register-btn btn" href="/register${login_query()}">${_("Register")}</a>
              </div>
            % endif
              <div class="mobile-nav-item hidden-mobile nav-item">
                <a class="sign-in-btn btn" role="button" href="/login${login_query()}">${_("Sign in")}</a>
              </div>
        % endif
      % endif
    </div>
  </div>
</nav>
