4 Commits

3 changed files with 125 additions and 33 deletions

View File

@@ -26,11 +26,22 @@ yamllint . # YAML linting
markdownlint . # Markdown linting markdownlint . # Markdown linting
``` ```
### Testing ### Running Tests
```bash ```bash
# Run tests (no specific test framework configured) # No formal test framework configured
# Project uses manual testing with example PDF files in repository # Project uses manual testing with example PDF files in repository
# To test individual functions, run the CLI commands directly:
# myice schedule --days 7
# myice mobile-login
# myice search --help
```
### Running the Web API
```bash
# Or with poetry
poetry run fastapi run myice/webapi.py --host 127.0.0.1
``` ```
## Code Style Guidelines ## Code Style Guidelines
@@ -75,3 +86,20 @@ markdownlint . # Markdown linting
- requests for HTTP requests - requests for HTTP requests
- PyPDF2 for PDF processing - PyPDF2 for PDF processing
- Use rich for enhanced console output - Use rich for enhanced console output
- Custom rl_ai_tools package for AI functionalities
### Git Commit Messages
- Use conventional commits format
- Never mention Claude in commit messages
- Be descriptive but concise
- Use present tense ("add feature" not "added feature")
### Additional Rules
- Always use ddg-mcp to perform Web Search functionality
- Follow the existing code patterns in myice/myice.py and myice/webapi.py
- Maintain backward compatibility when modifying existing APIs
- Document new features in README.md
- Always run ruff format and ruff check after editing a python file
- use conventional commit messages

View File

@@ -32,20 +32,28 @@
<div class="container mt-2" id="mainContent" style="display: none;"> <div class="container mt-2" id="mainContent" style="display: none;">
<div id="eventFilters" style="display: none;"> <div id="eventFilters" style="display: none;">
<div class="mb-3"> <div class="mb-3 row">
<label for="account" class="form-label">Compte</label> <div class="col-md-3">
<select id="account" class="form-select"> <label for="account" class="form-label">Compte</label>
<option value="default">Défaut</option> <select id="account" class="form-select">
</select> <option value="default">Défaut</option>
<label for="agegroup" class="form-label">Âge</label> </select>
<select id="agegroup" class="form-select"> </div>
<option value="">Tous</option> <div class="col-md-3">
</select> <label for="agegroup" class="form-label">Âge</label>
<label for="subgroup" class="form-label">Sous-groupe</label> <select id="agegroup" class="form-select">
<select id="subgroup" class="form-select"> <option value="">Tous</option>
<option value="">Tous</option> </select>
</select> </div>
<button id="fetchEvents" class="btn btn-primary" style="margin-top: 1.2rem;">Charger</button> <div class="col-md-3">
<label for="subgroup" class="form-label">Sous-groupe</label>
<select id="subgroup" class="form-select">
<option value="">Tous</option>
</select>
</div>
<div class="col-md-3 d-flex align-items-end">
<button id="fetchEvents" class="btn btn-primary">Charger</button>
</div>
</div> </div>
</div> </div>
@@ -510,9 +518,11 @@
headers: { "Authorization": `Bearer ${storedApiKey}` } headers: { "Authorization": `Bearer ${storedApiKey}` }
}) })
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
const sortedPlayers = data.convocation.available // Check if available players data exists
.sort((a, b) => (a.number || 0) - (b.number || 0)); const availablePlayers = data.convocation.available || [];
const sortedPlayers = availablePlayers
.sort((a, b) => (a.number || 0) - (b.number || 0));
// Calculate player statistics // Calculate player statistics
const totalPlayers = sortedPlayers.length; const totalPlayers = sortedPlayers.length;
@@ -543,19 +553,73 @@
return numA - numB; return numA - numB;
}); });
eventDetailsContent.innerHTML = ` // Process staff data
<h5>${data.title}</h5> const staffList = data.convocation.staff || [];
<p><strong>Type:</strong> ${data.type}</p> const totalStaff = staffList.length;
<p><strong>Lieu:</strong> ${data.place}</p>
<p><strong>Heure:</strong> ${data.time_start} - ${data.time_end}</p> // Check if there are no players
<p><strong>Joueurs convoqués:</strong> ${totalPlayers} joueur${totalPlayers > 1 ? 's' : ''} (${positionBreakdown})</p> if (totalPlayers === 0 && totalStaff === 0) {
<h6>Liste des joueurs:</h6> eventDetailsContent.innerHTML = `
<ul>${playersByPosition.map(player => { <div class="card border-warning">
let number = player.number ? player.number : "N/A"; <div class="card-body text-center">
let position = player.position ? player.position : "N/A"; <h5 class="card-title">${data.title}</h5>
return `<li>[${position}] ${number} - ${player.fname} ${player.lname} (${player.dob})</li>`; <p class="card-text"><strong>Type:</strong> ${data.type}</p>
}).join('')}</ul> <p class="card-text"><strong>Lieu:</strong> ${data.place}</p>
`; <p class="card-text"><strong>Heure:</strong> ${data.time_start} - ${data.time_end}</p>
<div class="alert alert-warning" role="alert">
<h6 class="alert-heading">Aucun joueur ni personnel convoqué</h6>
<p>Il n'y a actuellement aucun joueur ni personnel convoqué pour ce match.</p>
</div>
</div>
</div>
`;
} else {
let staffHtml = '';
if (totalStaff > 0) {
staffHtml = `
<h6>Personnel (${totalStaff}):</h6>
<ul>${staffList.map(staff => {
return `<li><strong>${staff.role}:</strong> ${staff.fname} ${staff.lname}</li>`;
}).join('')}</ul>
`;
} else {
staffHtml = `
<div class="alert alert-info" role="alert">
<h6>Aucun personnel convoqué</h6>
<p>Il n'y a actuellement aucun personnel convoqué pour ce match.</p>
</div>
`;
}
if (totalPlayers === 0) {
eventDetailsContent.innerHTML = `
<h5>${data.title}</h5>
<p><strong>Type:</strong> ${data.type}</p>
<p><strong>Lieu:</strong> ${data.place}</p>
<p><strong>Heure:</strong> ${data.time_start} - ${data.time_end}</p>
<div class="alert alert-warning" role="alert">
<h6 class="alert-heading">Aucun joueur convoqué</h6>
<p>Il n'y a actuellement aucun joueur convoqué pour ce match.</p>
</div>
${staffHtml}
`;
} else {
eventDetailsContent.innerHTML = `
<h5>${data.title}</h5>
<p><strong>Type:</strong> ${data.type}</p>
<p><strong>Lieu:</strong> ${data.place}</p>
<p><strong>Heure:</strong> ${data.time_start} - ${data.time_end}</p>
<p><strong>Joueurs convoqués:</strong> ${totalPlayers} joueur${totalPlayers > 1 ? 's' : ''} (${positionBreakdown})</p>
<h6>Liste des joueurs:</h6>
<ul>${playersByPosition.map(player => {
let number = player.number ? player.number : "N/A";
let position = player.position ? player.position : "N/A";
return `<li>[${position}] ${number} - ${player.fname} ${player.lname} (${player.dob})</li>`;
}).join('')}</ul>
${staffHtml}
`;
}
}
new bootstrap.Modal(document.getElementById('eventDetailsModal')).show(); new bootstrap.Modal(document.getElementById('eventDetailsModal')).show();
}) })
.catch(error => console.error("Erreur lors du chargement des détails de l'événement:", error)); .catch(error => console.error("Erreur lors du chargement des détails de l'événement:", error));

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "myice" name = "myice"
version = "v0.5.6" version = "v0.5.7"
description = "myice parsing" description = "myice parsing"
authors = [ authors = [
{ name = "Rene Luria", "email" = "<rene@luria.ch>"}, { name = "Rene Luria", "email" = "<rene@luria.ch>"},