<h1><a href="/rowers/virtualevents/">Racing</a></h1>
<ul class="cd-accordion-menu animated">
  <li id="races-list">
    <a href="/rowers/virtualevents/">
      <i class="fas fa-flag-checkered fa-fw"></i>&nbsp;Challenges
    </a>
  </li>
  <li id="races-new">
    <a href="/rowers/virtualevent/create/">
      <i class="far fa-flag fa-fw"></i>&nbsp;New Challenge
    </a>
  </li>
  <li id="indoor-new">
    <a href="/rowers/virtualevent/createindoor/">
      <i class="far fa-flag fa-fw"></i>&nbsp;New Indoor Challenge
    </a>
  </li>
  {% if race %}
  {% if results %}
  <li id="compare">
    <a href="/rowers/virtualevent/{{ race.id }}/compare/">
      <i class="fas fa-balance-scale fa-fw"></i>&nbsp;Compare Results</a>
  </li>
  {% endif %}
  {% if reguest.user.is_anonymous %}
  <li id="race-register">
    {% if race.sessiontype == 'race' %}
    <a href="/rowers/virtualevent/{{ race.id }}/register/">
      <i class="fas fa-user-plus fa-fw"></i>&nbsp;Register</a>
    {% else %}
    <a href="/rowers/virtualevent/{{ race.id }}/registerindoor/">
      <i class="fas fa-user-plus fa-fw"></i>&nbsp;Register</a>
    {% endif %}
  </li>
  {% endif %}
  {% for button in buttons %}
  {% if button == 'registerbutton' %}
  <li>
    {% if race.sessiontype == 'race' %}
    <a href="/rowers/virtualevent/{{ race.id }}/register/">
      <i class="fas fa-user-plus fa-fw"></i>&nbsp;Register</a>
    {% else %}
    <a href="/rowers/virtualevent/{{ race.id }}/registerindoor/">
      <i class="fas fa-user-plus fa-fw"></i>&nbsp;Register</a>
    {% endif %}
  </li>
  {% endif %}
  {% if button == 'submitbutton' %}
  <li>
    <a href="/rowers/virtualevent/{{ race.id }}/submit/">
      <i class="fas fa-file-plus fa-fw"></i>&nbsp;Submit Workout</a>
  </li>
  <li>
    <a href="/rowers/workout/upload/{{ race.id }}/">
      <i class="fas fa-file-upload fa-fw"></i>&nbsp;Upload your Challenge result
    </a>
  </li>
  {% if race.sessiontype != 'race' %}
  <li>
    <a href="/rowers/workout/addmanual/{{ race.id }}/">
      <i class="fas fa-file-plus fa-fw"></i>&nbsp;Enter Result
    </a>
  </li>
  {% endif %}
  {% endif %}
  {% if button == 'resubmitbutton' %}
  <li>
    <a href="/rowers/virtualevent/{{ race.id }}/submit/">
    <i class="fas fa-file-plus fa-fw"></i>&nbsp;Submit New Result
  </a>
  </li>
  {% endif %}
  {% if button == 'withdrawbutton' %}
  <a href="/rowers/virtualevent/{{ race.id }}/withdraw/">
    <i class="fas fa-user-minus fa-fw"></i>&nbsp;Withdraw</a>
  {% endif %}
  {% if button == 'adddisciplinebutton' %}
  <a href="/rowers/virtualevent/{{ race.id }}/adddiscipline/">
    <i class="fas fa-users fa-fw"></i>&nbsp;Register New Boat
  </a>
  {% endif %}
  {% if button == 'editbutton' %}
  <li>
    {% if race.sessiontype == 'race' %}
    <a href="/rowers/virtualevent/{{ race.id }}/edit/"><i class="fas fa-pencil-alt fa-fw"></i>&nbsp;Edit Challenge
    </a>
    {% else  %}
    <a href="/rowers/virtualevent/{{ race.id }}/editindoor/"><i class="fas fa-pencil-alt fa-fw"></i>&nbsp;Edit Challenge
    </a>
    {% endif %}
  </li>
  {% endif %}
  {% endfor %}
  {% endif %}
  <li id="courses">
    <a href="/rowers/list-courses/">
      <i class="fas fa-route fa-fw"></i>&nbsp;Courses
    </a>
  </li>
  {% if course %}
  <li class="has-children" id="course">
    <input type="checkbox" name="group-course" id="group-course" checked>
    <label for="group-course"><i class="fas fa-route fa-fw"></i>&nbsp;{{ course.name }}</label>
    <ul>
      <li id="course-view">
        <a href="/rowers/courses/{{ course.id }}/">
          <i class="fas fa-search fa-fw"></i>&nbsp;View
        </a>
      </li>
      <li id="course-mapview">
        <a href="/rowers/courses/{{ course.id }}/map/">
          <i class="fas fa-map fa-fw"></i>&nbsp;Map View
        </a>
      </li>
      {% if course.manager == rower %}
      <li id="course-emailkml">
        <a href="/rowers/courses/{{ course.id }}/downloadkml/">
          <i class="fas fa-globe-americas fa-fw"></i>&nbsp;Download as KML</a>
      </li>
      <li id="course-editview">
        <a href="/rowers/courses/{{ course.id }}/edit/">
          <i class="fas fa-pencil-alt fa-fw"></i>&nbsp;Edit</a>
      </li>
      {% if nosessions %}
      <li id="course-deleteview">
        <a href="/rowers/courses/{{ course.id }}/delete/">
          <i class="fas fa-trash-alt fa-fw"></i>&nbsp;Delete</a>
      </li>
      {% endif %}
      <li id="course-view">
        <a href="/rowers/courses/{{ course.id }}/replace/">
          <i class="fas fa-map-marked-alt fa-fw"></i>&nbsp;Update Markers</a>
      </li>
      {% endif %}
    </ul>
  </li>
  {% endif %}
  <li id="standards">
    <a href="/rowers/list-standards/">
      <i class="fas fa-award fa-fw"></i>&nbsp;Course Time Standards
    </a>
  </li>
</ul> <!-- cd-accordion-menu -->

{% include 'menuscript.html' %}
