navigation.html 2.97 KB
Newer Older
1
## mako
2 3 4
## TODO: Split this into two files, one for people who are authenticated, and
## one for people who aren't. Assume a Course object is passed to the former,
## instead of using settings.COURSE_TITLE
Matthew Mongeau committed
5
<%namespace name='static' file='static_content.html'/>
6 7 8 9 10
<%!
from django.core.urlresolvers import reverse

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

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

34 35

% if course:
36
  <header class="global slim" aria-label="Global Navigation">
37
% else:
38
  <header class="global" aria-label="Global Navigation">
39
% endif
40
  <nav>
41
  <h1 class="logo"><a href="${reverse('root')}"><img src="${static.url(branding.get_logo_url(request.META.get('HTTP_HOST')))}"/></a></h1>
42

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

    <ol class="left find-courses-button">
48 49 50 51 52
      <li class="primary">
        <a href="${reverse('courses')}">Find Courses</a>
      </li>
    </ol>

53
  % if user.is_authenticated():
54 55 56
    <ol class="user">
      <li class="primary">
        <a href="${reverse('dashboard')}" class="user-link">
57
          <span class="avatar"></span>
58 59 60 61 62
          ${user.username}
        </a>
      </li>
      <li class="primary">
        <a href="#" class="dropdown">&#9662</a>
63
        <ul class="dropdown-menu">
64 65
##          <li><a href="#">Account Settings</a></li>
          <li><a href="${reverse('help_edx')}">Help</a></li>
66 67
          <li><a href="${reverse('logout')}">Log Out</a></li>
        </ul>
68 69
      </li>
    </ol>
70

71
  % else:
72 73 74
    <ol class="guest">
      <li class="secondary">
        <a href="${reverse('about_edx')}">About</a>
75
        <a href="http://edxonline.tumblr.com/">Blog</a>
76
        <a href="${reverse('jobs')}">Jobs</a>
77
% if not settings.MITX_FEATURES['DISABLE_LOGIN_BUTTON']:
78
        <a href="#login-modal" id="login" rel="leanModal">Log In</a>
79
% endif
80
      </li>
81
% if not settings.MITX_FEATURES['DISABLE_LOGIN_BUTTON']:
82
      <li class="primary">
83
        <a href="#signup-modal" id="signup" rel="leanModal">Sign Up</a>
84
      </li>
85
% endif
86 87
    </ol>
  %endif
88
  </nav>
Matthew Mongeau committed
89
</header>
90
% if course:
91
<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>
92
% endif
Matthew Mongeau committed
93 94 95

%if not user.is_authenticated():
  <%include file="login_modal.html" />
Galen Frechette committed
96
  <%include file="signup_modal.html" />
97
  <%include file="forgot_password_modal.html" />
Matthew Mongeau committed
98
%endif