{% load staticfiles %}
{% load rowerfilters %}
<h1><a href="/rowers/me/edit/">Profile</a></h1>
<ul class="cd-accordion-menu animated">
  <li id="manage-prefs">
    <a href="/rowers/me/preferences/">
      <i class="fas fa-cog fa-fw"></i>&nbsp;Zones
    </a>
  </li>
  <li id="manage-impex">
    <a href="/rowers/me/exportsettings/">
      <i class="fas fa-cloud-download fa-fw"></i>&nbsp;Import/Export
    </a>
  </li>
  <li id="manage-account">
    <a href="/rowers/me/edit/">
      <i class="fas fa-user fa-fw"></i>&nbsp;Account
    </a>
  </li>
  <li id="manage-favs">
    <a href="/rowers/me/favoritecharts/">
      <i class="fas fa-chart-area fa-fw"></i>&nbsp;Charts Settings
    </a>
  </li>
  <li id="manage-workflow">
    <a href="/rowers/me/workflowconfig2/">
      <i class="fas fa-tachometer-alt-slow fa-fw"></i>&nbsp;Manage Workflow
    </a>
  </li>
  {% if user.is_authenticated and user.is_staff %}
  <li id="manage-transactions">
    <a href="/rowers/me/transactions/">
      <i class="fas fa-credit-card fa-fw"></i>&nbsp;Transactions
    </a>
  </li>
  <li id="manage-jobs">
    <a href="/rowers/failedjobs/">
      <i class="fas fa-tasks fa-fw"></i>&nbsp;Failed Tasks
    </a>
  </li>
  {% endif %}
</ul><!-- cd-accordion-menu -->


{% if user.is_authenticated and user|is_manager and rower %}
<p>&nbsp;</p>
{% if request.user|coach_rowers %}
<ul class="cd-accordion-menu animated">
  <li class="has-children" id="athletes">
    <input type="checkbox" name="athlete-selector" id="athlete-selector">
    <label for="athlete-selector"><i class="fas fa-users fa-fw"></i>&nbsp;Athletes</label>
    <ul>
      {% for member in request.user|coach_rowers %}
      <a href={{ request.path|userurl:member.user }}>
        <i class="fas fa-user fa-fw"></i>
        {% if member.user == rower.user %}
        &bull;
        {% else %}
        &nbsp;
        {% endif %}
        {{ member.user.first_name }} {{ member.user.last_name }}
      </a>
      {% endfor %}
    </ul>
  </li>
</ul>
{% endif %}
{% endif %}

{% include 'menuscript.html' %}
