Correction des présences et correction de plusieurs erreurs mineur de déplacement/parcours de l'utilisateur, harmonisation des processus

This commit is contained in:
cedrick2711
2026-07-28 18:11:02 -04:00
parent b982cd0318
commit a0f18a886c
19 changed files with 250 additions and 116 deletions
+64
View File
@@ -338,6 +338,18 @@
<span class="badge badge-secondary">⏳ 0/{{ item.total_count }}</span>
{% endif %}
</span>
<!-- Per-player presence toggles -->
{% if can_edit and item.player_presence %}
<div class="presence-players" style="margin-top:6px;">
{% for pp in item.player_presence %}
<button class="btn btn-xs presence-toggle-btn {% if pp.attendance_confirmed %}presence-confirmed-btn{% else %}presence-pending-btn{% endif %}"
title="{{ pp.player_name }}"
onclick="toggleTryoutPresence({{ m.id }}, {{ pp.participant_id }}, this)">
{{ pp.player_name[:2] | upper }} {% if pp.attendance_confirmed %}✅{% else %}⏳{% endif %}
</button>
{% endfor %}
</div>
{% endif %}
{% else %}
<span class="text-muted"></span>
{% endif %}
@@ -484,10 +496,62 @@
{% endif %}
</div>
<style>
.presence-toggle-btn {
padding: 2px 7px;
font-size: 0.7rem;
border-radius: 10px;
border: 1px solid #d1d5db;
cursor: pointer;
margin: 2px;
font-weight: 600;
transition: all 0.15s ease;
}
.presence-confirmed-btn {
background: #d1fae5;
color: #065f46;
border-color: #a7f3d0;
}
.presence-pending-btn {
background: #fef3c7;
color: #92400e;
border-color: #fde68a;
}
.presence-toggle-btn:hover {
transform: scale(1.08);
box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
</style>
<script>
function showCreateTeam() { document.getElementById('createTeamForm').classList.remove('hidden'); }
function hideCreateTeam() { document.getElementById('createTeamForm').classList.add('hidden'); }
function toggleTryoutPresence(matchId, participantId, btn) {
fetch('/matches/' + matchId + '/toggle-presence/' + participantId, {
method: 'POST',
headers: {
'X-CSRFToken': '{{ csrf_token() }}',
'Content-Type': 'application/json'
}
})
.then(function(r) { return r.json(); })
.then(function(data) {
if (data.attendance_confirmed) {
btn.classList.add('presence-confirmed-btn');
btn.classList.remove('presence-pending-btn');
btn.innerHTML = btn.innerHTML.replace('⏳', '✅');
} else {
btn.classList.remove('presence-confirmed-btn');
btn.classList.add('presence-pending-btn');
btn.innerHTML = btn.innerHTML.replace('✅', '⏳');
}
location.reload();
})
.catch(function(err) {
console.error('Error toggling tryout presence:', err);
});
}
// Mini calendar for matches
document.addEventListener('DOMContentLoaded', function() {
var miniCalendarEl = document.getElementById('mini-calendar');