{% extends "layouts/base.html" %} {% block title %}{{ _('Teams') }} - UdeS team manager{% 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') }} {{ _('Phone') }}{{ _('Actions') }}
{{ 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 %}