{% extends "layouts/base.html" %} {% block title %}Teams - TryoutPro{% endblock %} {% block page_title %}Teams{% endblock %} {% block breadcrumb %}Home / Teams{% endblock %} {% block header_actions %} {% if can_manage %} {% endif %} {% endblock %} {% block content %} {% if can_manage %}

Create New Team

{% endif %} {% for team in teams %} {% set can_manage_team = can_manage or (current_user.role == 'coach' and team.coach_id == current_user.id) %}

{{ team.name }}

{% if can_manage %}
{% endif %} {% if current_user.role == 'coach' and team.coach_id == current_user.id %} Notes {% endif %}
Coaches
{% set team_coaches = team.get_coaches() %} {% if team_coaches %} {% for c in team_coaches %} {{ c.username }} {% if can_manage %}
{% endif %}
{% endfor %} {% else %} None assigned {% endif %}
Managers
{% set team_managers = team.get_managers() %} {% if team_managers %} {% for m in team_managers %} {{ m.username }} {% if can_manage %}
{% endif %}
{% endfor %} {% else %} None assigned {% endif %}
Matches {% if current_user.can_schedule_matches() and (current_user.role in ['admin', 'manager'] or (current_user.role == 'coach' and team.coaches.filter_by(id=current_user.id).first()) or (current_user.role == 'coach' and team.coach_id == current_user.id)) %} Match Practice {% endif %}
{% if can_manage_team %} {% endif %} {% for entry in team.get_players_with_status() %} {% if can_manage_team %} {% endif %} {% else %} {% endfor %}
Player Status Position / Role Email PhoneActions
{{ entry.player.username[:2] | upper }}
{{ entry.player.username }}
{% if can_manage_team %} {% else %} {{ entry.status | capitalize }} {% endif %} {{ entry.player.role | capitalize }} {{ entry.player.email }} {{ entry.player.phone or '-' }}

No players assigned

{% if can_manage_team %}

Add players to this team using the form below.

{% endif %}
{% if can_manage_team %}
Add Player to {{ team.name }}
{% endif %}
{% else %}

No teams yet

{% if can_manage %}

Create organization teams and assign coaches to manage tryouts.

{% else %}

There are no teams to display.

{% endif %}
{% endfor %} {% endblock %}