ajout de match régulier pour les équipes et de pratiques
Ajout d'un profil public cliquable pour les utilisateurs déplacement du profil
This commit is contained in:
+204
-31
@@ -59,34 +59,6 @@
|
||||
<div class="card-header">
|
||||
<h3><i class="fas fa-users-cog"></i> {{ team.name }}</h3>
|
||||
<div class="card-actions">
|
||||
<div class="team-staff">
|
||||
{% if team.coach %}
|
||||
<span class="text-muted">Coach: {{ team.coach.username }}</span>
|
||||
{% if can_manage %}
|
||||
<form method="POST" action="{{ url_for('teams.remove_coach', team_id=team.id) }}" class="inline-form" onsubmit="return confirm('Remove coach {{ team.coach.username }} from {{ team.name }}?')">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger" title="Remove Coach">
|
||||
<i class="fas fa-user-minus"></i>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="text-muted">No coach assigned</span>
|
||||
{% endif %}
|
||||
{% if team.manager %}
|
||||
<span class="text-muted ml-2">Manager: {{ team.manager.username }}</span>
|
||||
{% if can_manage %}
|
||||
<form method="POST" action="{{ url_for('teams.remove_manager', team_id=team.id) }}" class="inline-form" onsubmit="return confirm('Remove manager {{ team.manager.username }} from {{ team.name }}?')">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger" title="Remove Manager">
|
||||
<i class="fas fa-user-minus"></i>
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="text-muted ml-2">No manager assigned</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if can_manage %}
|
||||
<button class="btn btn-sm btn-outline edit-team-btn" data-team-id="{{ team.id }}" data-team-name="{{ team.name }}" data-coach-id="{{ team.coach_id or '' }}" data-manager-id="{{ team.manager_id or '' }}">
|
||||
<i class="fas fa-edit"></i> Edit
|
||||
@@ -105,6 +77,92 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Full-width staff bar for coaches and managers -->
|
||||
<div class="team-staff-bar">
|
||||
<div class="staff-row">
|
||||
<div class="staff-group">
|
||||
<span class="staff-label"><i class="fas fa-chalkboard-teacher"></i> Coaches</span>
|
||||
<div class="staff-items">
|
||||
{% set team_coaches = team.get_coaches() %}
|
||||
{% if team_coaches %}
|
||||
{% for c in team_coaches %}
|
||||
<span class="staff-tag">
|
||||
{{ c.username }}
|
||||
{% if can_manage %}
|
||||
<form method="POST" action="{{ url_for('teams.remove_coach', team_id=team.id) }}" class="inline-form" onsubmit="return confirm('Remove coach {{ c.username }} from {{ team.name }}?')">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<input type="hidden" name="coach_id" value="{{ c.id }}"/>
|
||||
<button type="submit" class="btn-icon-sm" title="Remove Coach">×</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="text-muted text-sm">None assigned</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="staff-group">
|
||||
<span class="staff-label"><i class="fas fa-user-tie"></i> Managers</span>
|
||||
<div class="staff-items">
|
||||
{% set team_managers = team.get_managers() %}
|
||||
{% if team_managers %}
|
||||
{% for m in team_managers %}
|
||||
<span class="staff-tag manager-tag">
|
||||
{{ m.username }}
|
||||
{% if can_manage %}
|
||||
<form method="POST" action="{{ url_for('teams.remove_manager', team_id=team.id) }}" class="inline-form" onsubmit="return confirm('Remove manager {{ m.username }} from {{ team.name }}?')">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<input type="hidden" name="manager_id" value="{{ m.id }}"/>
|
||||
<button type="submit" class="btn-icon-sm" title="Remove Manager">×</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="text-muted text-sm">None assigned</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if can_manage %}
|
||||
<div class="staff-add-forms">
|
||||
<form method="POST" action="{{ url_for('teams.add_coach', team_id=team.id) }}" class="inline-form">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<select name="coach_id" class="form-select form-select-sm" onchange="if(this.value) this.form.submit()">
|
||||
<option value="">+ Add Coach</option>
|
||||
{% for c in coaches %}
|
||||
{% if c.id not in (team_coaches | map(attribute='id') | list) %}
|
||||
<option value="{{ c.id }}">{{ c.username }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</form>
|
||||
<form method="POST" action="{{ url_for('teams.add_manager', team_id=team.id) }}" class="inline-form">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<select name="manager_id" class="form-select form-select-sm" onchange="if(this.value) this.form.submit()">
|
||||
<option value="">+ Add Manager</option>
|
||||
{% for m in managers %}
|
||||
{% if m.id not in (team_managers | map(attribute='id') | list) %}
|
||||
<option value="{{ m.id }}">{{ m.username }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
<a href="{{ url_for('team_matches.list_matches') }}?team_id={{ team.id }}" class="btn btn-sm btn-outline" title="View Team Matches">
|
||||
<i class="fas fa-futbol"></i> Matches
|
||||
</a>
|
||||
{% if current_user.can_schedule_matches() and (current_user.role in ['president', '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)) %}
|
||||
<a href="{{ url_for('team_matches.create_match', team_id=team.id) }}" class="btn btn-sm btn-success" title="Schedule Team Match">
|
||||
<i class="fas fa-plus"></i> Match
|
||||
</a>
|
||||
<a href="{{ url_for('team_matches.create_match', team_id=team.id, type='practice') }}" class="btn btn-sm btn-info" title="Schedule Practice">
|
||||
<i class="fas fa-dumbbell"></i> Practice
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-container">
|
||||
<table class="table">
|
||||
@@ -126,7 +184,7 @@
|
||||
<td>
|
||||
<div class="user-mini">
|
||||
<div class="avatar-sm">{{ entry.player.username[:2] | upper }}</div>
|
||||
<span>{{ entry.player.username }}</span>
|
||||
<a href="{{ url_for('users.view_user', user_id=entry.player.id) }}">{{ entry.player.username }}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -326,14 +384,93 @@ function hideEditForm() {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.team-staff {
|
||||
/* === Full-width staff bar layout === */
|
||||
.team-staff-bar {
|
||||
padding: 10px 20px;
|
||||
background: #f8fafc;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
}
|
||||
.staff-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.staff-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.team-staff .text-muted {
|
||||
.staff-label {
|
||||
font-size: 0.8rem;
|
||||
color: #64748b;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.staff-label i {
|
||||
margin-right: 3px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
.staff-items {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.staff-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
background: #e0e7ff;
|
||||
color: #3730a3;
|
||||
padding: 3px 10px;
|
||||
border-radius: 14px;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.staff-tag.manager-tag {
|
||||
background: #fef3c7;
|
||||
color: #92400e;
|
||||
}
|
||||
.staff-tag .btn-icon-sm {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #ef4444;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
margin-left: 1px;
|
||||
}
|
||||
.staff-tag .btn-icon-sm:hover {
|
||||
color: #dc2626;
|
||||
}
|
||||
.staff-add-forms {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-left: auto;
|
||||
}
|
||||
.staff-add-forms .form-select-sm {
|
||||
font-size: 0.8rem;
|
||||
padding: 4px 28px 4px 10px;
|
||||
height: auto;
|
||||
border-radius: 6px;
|
||||
border: 1px dashed #cbd5e1;
|
||||
background: #fff;
|
||||
min-width: 150px;
|
||||
}
|
||||
.staff-add-forms .form-select-sm:focus {
|
||||
border-color: #6366f1;
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
|
||||
}
|
||||
.text-sm {
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
.ml-2 {
|
||||
margin-left: 8px;
|
||||
@@ -342,5 +479,41 @@ function hideEditForm() {
|
||||
cursor: pointer;
|
||||
min-width: 90px;
|
||||
}
|
||||
|
||||
/* === Dark mode overrides for staff bar === */
|
||||
[data-theme="dark"] .team-staff-bar {
|
||||
background: var(--bg-tertiary);
|
||||
border-bottom-color: var(--border-color);
|
||||
}
|
||||
[data-theme="dark"] .staff-label {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
[data-theme="dark"] .staff-tag {
|
||||
background: rgba(99, 102, 241, 0.2);
|
||||
color: #a5b4fc;
|
||||
}
|
||||
[data-theme="dark"] .staff-tag.manager-tag {
|
||||
background: rgba(229, 169, 57, 0.2);
|
||||
color: #fcd34d;
|
||||
}
|
||||
[data-theme="dark"] .staff-tag .btn-icon-sm {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
[data-theme="dark"] .staff-tag .btn-icon-sm:hover {
|
||||
color: var(--danger);
|
||||
}
|
||||
[data-theme="dark"] .staff-add-forms .form-select-sm {
|
||||
background: var(--input-bg);
|
||||
border-color: var(--border-color);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
[data-theme="dark"] .staff-add-forms .form-select-sm:focus {
|
||||
border-color: var(--primary);
|
||||
box-shadow: 0 0 0 2px rgba(0, 152, 76, 0.25);
|
||||
}
|
||||
[data-theme="dark"] .staff-add-forms .form-select-sm option {
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user