<%! from django.core.urlresolvers import reverse %>

<% active_tab_class = 'active-tab-' + active_tab if active_tab else '' %>
<header class="primary-header ${active_tab_class}">
  <nav class="inner-wrapper">
    <div class="left">
      <a href="/"><span class="home-icon"></span></a>
      % if context_course:
      <% ctx_loc = context_course.location %>
      <a href="${reverse('course_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}" class="class-name">${context_course.display_name}</a>
      <ul class="class-nav">
        <li><a href="${reverse('course_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}" id='courseware-tab'>Courseware</a></li>
        <li><a href="${reverse('edit_tabs', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, coursename=ctx_loc.name))}" id='pages-tab'>Tabs</a></li>
        <li><a href="${reverse('asset_index', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}" id='assets-tab'>Assets</a></li>
        <li><a href="${reverse('manage_users', kwargs=dict(location=ctx_loc))}" id='users-tab'>Users</a></li>
        <li><a href="${reverse('import_course', kwargs=dict(org=ctx_loc.org, course=ctx_loc.course, name=ctx_loc.name))}" id='import-tab'>Import</a></li>
      </ul>
      % endif
    </div>
    <div class="right">
      <span class="username">${ user.username }</span>
      % if user.is_authenticated():
         <a href="${reverse('logout')}">Log out</a>
      % else:
         <a href="${reverse('login')}">Log in</a>
      % endif
    </div>
  </nav>
</header>
