modification des permissions de coach: Voit uniquement les tryouts de ses équipes.

Evaluer un joueur retourne à la page précédente au lieu de la page des evaluations
This commit is contained in:
cedrick2711
2026-07-14 12:38:57 -04:00
parent 4fd27bacfd
commit acb9bc3256
16 changed files with 56 additions and 50 deletions
+6 -5
View File
@@ -45,6 +45,7 @@
{% endif %}
{% for team in teams %}
{% set can_manage_team = can_manage or (current_user.role == 'coach' and team.coach_id == current_user.id) %}
<div class="card mb-4">
<div class="card-header">
<h3><i class="fas fa-users-cog"></i> {{ team.name }}</h3>
@@ -76,7 +77,7 @@
<th>Position / Role</th>
<th>Email</th>
<th>Phone</th>
{% if can_manage %}
{% if can_manage_team %}
<th>Actions</th>
{% endif %}
</tr>
@@ -93,7 +94,7 @@
<td>{{ player.role | capitalize }}</td>
<td>{{ player.email }}</td>
<td>{{ player.phone or '-' }}</td>
{% if can_manage %}
{% if can_manage_team %}
<td>
<form method="POST" action="{{ url_for('teams.remove_player', team_id=team.id, player_id=player.id) }}" class="inline-form" onsubmit="return confirm('Remove {{ player.full_name }} from {{ team.name }}?')">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
@@ -106,11 +107,11 @@
</tr>
{% else %}
<tr>
<td colspan="{% if can_manage %}5{% else %}4{% endif %}" class="text-center">
<td colspan="{% if can_manage_team %}5{% else %}4{% endif %}" class="text-center">
<div class="empty-state">
<i class="fas fa-users-slash"></i>
<h4>No players assigned</h4>
{% if can_manage %}
{% if can_manage_team %}
<p>Add players to this team using the form below.</p>
{% endif %}
</div>
@@ -121,7 +122,7 @@
</table>
</div>
{% if can_manage %}
{% if can_manage_team %}
<hr class="my-3">
<div class="add-player-section">
<h5 class="mb-2"><i class="fas fa-user-plus"></i> Add Player to {{ team.name }}</h5>
+6 -6
View File
@@ -9,7 +9,7 @@
<div class="card-header">
<h3>Tryout Details</h3>
<div class="card-actions">
{% if current_user.can_manage_tryouts() %}
{% if can_edit %}
<form method="POST" action="{{ url_for('tryouts.update_status', tryout_id=tryout.id) }}" class="inline-form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<select name="status" onchange="this.form.submit()" class="form-select">
@@ -73,7 +73,7 @@
</div>
{% endif %}
{% if current_user.can_manage_tryouts() %}
{% if can_edit %}
<div class="card mb-4">
<div class="card-header">
<h3><i class="fas fa-user-plus"></i> Add Player to Tryout</h3>
@@ -125,7 +125,7 @@
</div>
</td>
<td>
{% if current_user.can_manage_tryouts() %}
{% if can_edit %}
<form method="POST" action="{{ url_for('tryouts.update_registration_status', tryout_id=tryout.id, player_id=p.id) }}" class="inline-form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<select name="status" onchange="this.form.submit()" class="form-select form-select-sm">
@@ -169,14 +169,14 @@
<div class="card">
<div class="card-header">
<h3><i class="fas fa-users-cog"></i> Teams</h3>
{% if current_user.can_manage_tryouts() %}
{% if can_edit %}
<button class="btn btn-sm btn-primary" onclick="showCreateTeam()">
<i class="fas fa-plus"></i> New Team
</button>
{% endif %}
</div>
<div class="card-body">
{% if current_user.can_manage_tryouts() %}
{% if can_edit %}
<div id="createTeamForm" class="hidden mb-3">
<form method="POST" action="{{ url_for('tryouts.create_team', tryout_id=tryout.id) }}" class="form-inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
@@ -203,7 +203,7 @@
<li class="text-muted">No players assigned yet.</li>
{% endfor %}
</ul>
{% if current_user.can_manage_tryouts() and registered_players %}
{% if can_edit and registered_players %}
<form method="POST" action="{{ url_for('tryouts.add_to_team', tryout_id=tryout.id, team_id=team.team.id) }}" class="form-inline mt-2">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<select name="player_id" class="form-select" required>