{% load staticfiles %}
{% load rowerfilters %}
<h1><a href="/rowers/me/teams/">Teams</a></h1>

<ul class="cd-accordion-menu animated">
  <li id="manage">
    <a href="/rowers/me/teams/">
      <i class="fas fa-cog fa-fw"></i>&nbsp;Overview
    </a>
  </li>
  <li id="create">
    <a href="/rowers/team/create/">
      <i class="fas fa-plus fa-fw"></i>&nbsp;New Training Group
    </a>
  </li>
</ul><!-- cd-accordion-menu -->


{% if myteams %}
<h2>Managing</h2>
<ul class="cd-accordion-menu animated">
  {% for team in myteams %}
  <li class="has-children" id="team-{{ team.id }}">
    <input type="checkbox" name="group-team-{{ team.id }}" id="group-team-{{ team.id }}">
    <label for="group-team-{{ team.id }}">{{ team.name }}</label>
    <ul>
      <li id="team-{{ team.id }}-view">
        <a href="/rowers/team/{{ team.id }}/">
          <i class="fas fa-user-friends fa-fw"></i>&nbsp;View
        </a>
      </li>
      <li id="team-{{ team.id }}-edit">
        <a href="/rowers/team/{{ team.id }}/edit/">
          <i class="fas fa-user-friends fa-fw"></i>&nbsp;Edit 
        </a>
      </li>
      <li id="team-{{ team.id }}-stats">
        <a href="/rowers/team/{{ team.id }}/memberstats/">
          <i class="fas fa-pencil-alt fa-fw"></i>&nbsp;Member Stats
        </a>
      </li>
      <li id="team-{{ team.id }}-workouts">
        <a href="/rowers/list-workouts/team/{{ team.id }}/">
          <i class="fas fa-clipboard-list fa-fw"></i>&nbsp;Member Workouts
        </a>
      </li>
      <li id="team-{{ team.id }}-leave">
        <a href="/rowers/team/{{ team.id }}/leaveconfirm/">
          <i class="fas fa-sign-out fa-fw"></i>&nbsp;Leave
        </a>
      </li>
      <li id="team-{{ team.id }}-delete">
        <a href="/rowers/team/{{ team.id }}/deleteconfirm/">
          <i class="fas fa-trash fa-fw"></i>&nbsp;Delete
        </a>
      </li>
    </ul>
  </li>
  {% endfor %}
</ul>
{% endif %}


{% if memberteams %}
<h2>Member</h2>
<ul class="cd-accordion-menu animated">
  {% for team in memberteams %}
  <li class="has-children" id="team-{{ team.id }}">
    <input type="checkbox" name="group-team-{{ team.id }}" id="group-team-{{ team.id }}">
    <label for="group-team-{{ team.id }}">{{ team.name }}</label>
    <ul>
      <li id="team-{{ team.id }}-view">
        <a href="/rowers/team/{{ team.id }}/">
          <i class="fas fa-user-friends fa-fw"></i>&nbsp;View
        </a>
      </li>
      <li id="team-{{ team.id }}-workouts">
        <a href="/rowers/list-workouts/team/{{ team.id }}/">
          <i class="fas fa-clipboard-list fa-fw"></i>&nbsp;Member Workouts
        </a>
      </li>
      <li id="team-{{ team.id }}-leave">
        <a href="/rowers/team/{{ team.id }}/leaveconfirm/">
          <i class="fas fa-sign-out fa-fw"></i>&nbsp;Leave
        </a>
      </li>
    </ul>
  </li>
  {% endfor %}
</ul>
{% endif %}

{% include 'menuscript.html' %}
