## 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
<%namespace name='static' file='static_content.html'/>
<%! from django.core.urlresolvers import reverse %>

<header class="global" aria-label="Global Navigation">
  <nav>
    <h1 class="logo"><a href="${reverse('root')}"></a></h1>
    <ol class="left">
      <li class="primary">
        <a href="${reverse('courses')}">Find Courses</a>
      </li>
    </ol>

  %if user.is_authenticated():
    <ol class="user">
      <li class="primary">
        <a href="${reverse('dashboard')}" class="user-link">
          <span class="avatar"></span>
          ${user.username}
        </a>
      </li>
      <li class="primary">
        <a href="#" class="dropdown">&#9662</a>
        <ul class="dropdown-menu">
          <li><a href="#">Account Settings</a></li>
          <li><a href="${reverse('help')}">Help</a></li>
          <li><a href="${reverse('logout')}">Log Out</a></li>
        </ul>
      </li>
    </ol>

  %else:
    <ol class="guest">
      <li class="secondary">
        <a href="${reverse('about_edx')}">About</a>
        <a href="#">Blog</a>
        <a href="${reverse('jobs')}">Jobs</a>
        <a href="/t/contact.html">Contact</a>
        <a href="#login-modal" id="login" rel="leanModal">Log In</a>
      </li>
      <li class="primary">
        <a href="#signup-modal" id="signup" rel="leanModal">Sign Up</a>
      </li>
    </ol>
  </nav>
  %endif
</header>

%if not user.is_authenticated():
  <%include file="login_modal.html" />
  <%include file="signup_modal.html" />
%endif
