navigation.html 3.17 KB
Newer Older
1
## mako
Matthew Mongeau committed
2
<%namespace name='static' file='static_content.html'/>
3
<%namespace file='main.html' import="login_query"/>
4 5 6 7 8
<%!
from django.core.urlresolvers import reverse

# App that handles subdomain specific branding
import branding
9 10
# app that handles site status messages
from status.status import get_site_status_msg
11
%>
12

13 14
<%block cached="False">
<%
15
try:
16
    course_id = course.id
17 18
except:
    # can't figure out a better way to get at a possibly-defined course var
19 20
    course_id = None
site_status_msg = get_site_status_msg(course_id)
21
%>
22
% if site_status_msg:
23 24 25 26 27 28
<div class="site-status">
  <div class="inner-wrapper">
    <span class="white-error-icon"></span>
    <p>${site_status_msg}</p>
  </div>
</div>
29
% endif
30
</%block>
31

32 33

% if course:
34
  <header class="global slim" aria-label="Global Navigation">
35
% else:
36
  <header class="global" aria-label="Global Navigation">
37
% endif
38
  <nav>
39 40

  <h1 class="logo">
41
      <a href="${marketing_link('ROOT')}">
42 43
        <img src="${static.url(branding.get_logo_url(request.META.get('HTTP_HOST')))}"/>
      </a></h1>
44

45
    % if course:
46
      <h2><span class="provider">${course.org}:</span> ${course.number} ${course.display_name_with_default}</h2>
47
    % endif
48

49
    % if user.is_authenticated():
50

51
    <ol class="left nav-global authenticated">
52
      <li class="nav-global-01">
53
      <a href="${marketing_link('COURSES')}">Find Courses</a>
54 55 56 57 58
      </li>
    </ol>
    <ol class="user">
      <li class="primary">
        <a href="${reverse('dashboard')}" class="user-link">
59
          <span class="avatar"></span>
60 61 62 63 64
          ${user.username}
        </a>
      </li>
      <li class="primary">
        <a href="#" class="dropdown">&#9662</a>
65
        <ul class="dropdown-menu">
66
            <li>
67
            <a href="${marketing_link('FAQ')}">
68 69
            Help
          </a></li>
70 71
          <li><a href="${reverse('logout')}">Log Out</a></li>
        </ul>
72 73
      </li>
    </ol>
74

75 76
    % else:
    <ol class="left nav-global">
77
      % if settings.MITX_FEATURES.get('ENABLE_MKTG_SITE'):
78
      <li class="nav-global-01">
79
        <a href="${marketing_link('HOW_IT_WORKS')}">How it Works</a>
80
      </li>
81
      <li class="nav-global-02">
82
        <a href="${marketing_link('COURSES')}">Courses</a>
83
      </li>
84
      <li class="nav-global-03">
85
        <a href="${marketing_link('SCHOOLS')}">Schools</a>
86
      </li>
87
      % endif
88 89
      % if not settings.MITX_FEATURES['DISABLE_LOGIN_BUTTON']:
      <li class="nav-global-04">
90
        <a class="cta cta-register" href="/register">Register Now</a>
91 92 93 94 95 96 97
      </li>
      % endif
    </ol>

    <ol class="right nav-courseware">
    <li class="nav-courseware-01">
      % if not settings.MITX_FEATURES['DISABLE_LOGIN_BUTTON']:
98
      <a class="cta cta-login" href="/login${login_query()}">Log in</a>
99 100
      % endif
    </li>
101
    </ol>
102
    % endif
103
  </nav>
Matthew Mongeau committed
104
</header>
105
% if course:
106
<div class="ie-banner"><strong>Warning:</strong> Your browser is not fully supported. We strongly recommend using <a href="https://www.google.com/intl/en/chrome/browser/" target="_blank">Chrome</a> or <a href="http://www.mozilla.org/en-US/firefox/new/" target="_blank">Firefox</a>.</div>
107 108 109 110
% endif

%if not user.is_authenticated():
  <%include file="forgot_password_modal.html" />
Matthew Mongeau committed
111
%endif
112 113

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