ajustements des calendriers, ajout de matchs jouer vs joueur

This commit is contained in:
cedrick2711
2026-07-14 14:50:48 -04:00
parent 83ee10ca64
commit 4e7ecf0ab9
13 changed files with 338 additions and 41 deletions
+81 -2
View File
@@ -53,6 +53,7 @@
<textarea name="description" id="description" class="form-textarea" placeholder="Optional notes about this match">{{ match.description or '' }}</textarea>
</div>
<!-- Team vs Team Selection -->
{% if match.match_type == 'team_vs_team' %}
<hr class="section-divider">
<h4 class="section-title"><i class="fas fa-users"></i> Teams</h4>
@@ -77,9 +78,69 @@
</select>
</div>
</div>
<!-- Show team rosters -->
<div class="team-rosters mt-3">
{% if match.team1 %}
<div class="team-roster">
<h5>{{ match.team1.name }} Players</h5>
<ul class="team-members-list">
{% for member in match.team1.members %}
<li>{{ member.player.full_name }}{% if member.position %} <span class="position-tag">{{ member.position }}</span>{% endif %}</li>
{% else %}
<li class="text-muted">No players assigned</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if match.team2 %}
<div class="team-roster">
<h5>{{ match.team2.name }} Players</h5>
<ul class="team-members-list">
{% for member in match.team2.members %}
<li>{{ member.player.full_name }}{% if member.position %} <span class="position-tag">{{ member.position }}</span>{% endif %}</li>
{% else %}
<li class="text-muted">No players assigned</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
<!-- Player vs Player Selection -->
{% elif match.match_type == 'player_vs_player' %}
<hr class="section-divider">
<h4 class="section-title"><i class="fas fa-user-friends"></i> Select Players</h4>
<div class="form-row">
<div class="form-group">
<label>Team 1 Players</label>
<div class="checkbox-grid">
{% for player in all_players %}
<label class="checkbox-label">
<input type="checkbox" name="team1_player_ids" value="{{ player.id }}" {% if player.id in team1_player_ids %}checked{% endif %} onchange="handleTeamSelection(this, 1)">
{{ player.full_name }}
</label>
{% endfor %}
</div>
</div>
<div class="form-group">
<label>Team 2 Players</label>
<div class="checkbox-grid">
{% for player in all_players %}
<label class="checkbox-label">
<input type="checkbox" name="team2_player_ids" value="{{ player.id }}" {% if player.id in team2_player_ids %}checked{% endif %} onchange="handleTeamSelection(this, 2)">
{{ player.full_name }}
</label>
{% endfor %}
</div>
</div>
</div>
<!-- Player Scrim Selection -->
{% else %}
<hr class="section-divider">
<h4 class="section-title"><i class="fas fa-user-friends"></i> Players</h4>
<h4 class="section-title"><i class="fas fa-users"></i> Select Players</h4>
<div class="form-group">
<label>Players</label>
@@ -105,4 +166,22 @@
</form>
</div>
</div>
{% endblock %}
{% endblock %}
{% block scripts %}
<script>
function handleTeamSelection(checkbox, teamSide) {
// When selecting from one team, deselect from the other team
var otherSide = teamSide === 1 ? 2 : 1;
var otherCheckboxes = document.querySelectorAll('input[name="team' + otherSide + '_player_ids"]');
var playerId = checkbox.value;
// Find the corresponding checkbox in the other team and uncheck it
otherCheckboxes.forEach(function(other) {
if (other.value === playerId) {
other.checked = false;
}
});
}
</script>
{% endblock %}