Compare commits
26
Commits
v0.5.8
..
b016d58d84
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b016d58d84
|
||
|
|
6232e91925
|
||
|
|
7ce4fbd756 | ||
|
|
bb62acfc7f | ||
|
|
5f6ae79bf0
|
||
|
|
697788c20f
|
||
|
|
5c5828cfc1
|
||
|
|
0a88217443
|
||
|
|
2d783778a7
|
||
|
|
a3d4114044
|
||
|
|
cec54a45d7
|
||
|
|
3efa7101e1
|
||
|
|
861ff0650f
|
||
|
|
73f72d1bbe
|
||
|
|
a407a108ed
|
||
|
|
d6277d7766
|
||
|
|
5b1d741a16
|
||
|
|
5957868e0f
|
||
|
|
525d3bf326
|
||
|
|
0e1eb0da3f
|
||
|
|
4b81cc7f9f
|
||
|
|
c4d9236b16
|
||
|
|
2a5883375f
|
||
|
|
c4b6e39e9e
|
||
|
|
d3b5b6b6fd
|
||
|
|
bcde9fccf5
|
No files matched your search
@@ -3,7 +3,6 @@
|
|||||||
## Build/Lint/Test Commands
|
## Build/Lint/Test Commands
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install dependencies with Poetry
|
# Install dependencies with Poetry
|
||||||
poetry install
|
poetry install
|
||||||
@@ -13,7 +12,6 @@ pre-commit install
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Linting and Formatting
|
### Linting and Formatting
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run all pre-commit checks (linting, formatting, type checking)
|
# Run all pre-commit checks (linting, formatting, type checking)
|
||||||
pre-commit run --all-files
|
pre-commit run --all-files
|
||||||
@@ -27,7 +25,6 @@ markdownlint . # Markdown linting
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Running Tests
|
### Running Tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# No formal 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
|
||||||
@@ -38,7 +35,6 @@ markdownlint . # Markdown linting
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Running the Web API
|
### Running the Web API
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Or with poetry
|
# Or with poetry
|
||||||
poetry run fastapi run myice/webapi.py --host 127.0.0.1
|
poetry run fastapi run myice/webapi.py --host 127.0.0.1
|
||||||
@@ -47,40 +43,34 @@ poetry run fastapi run myice/webapi.py --host 127.0.0.1
|
|||||||
## Code Style Guidelines
|
## Code Style Guidelines
|
||||||
|
|
||||||
### Imports
|
### Imports
|
||||||
|
|
||||||
- Standard library imports first, then third-party, then local imports
|
- Standard library imports first, then third-party, then local imports
|
||||||
- Use explicit imports rather than wildcard imports
|
- Use explicit imports rather than wildcard imports
|
||||||
- Group imports logically with blank lines between groups
|
- Group imports logically with blank lines between groups
|
||||||
|
|
||||||
### Formatting
|
### Formatting
|
||||||
|
|
||||||
- Use ruff-format for automatic formatting
|
- Use ruff-format for automatic formatting
|
||||||
- Follow PEP 8 style guide
|
- Follow PEP 8 style guide
|
||||||
- Maximum line length: 88 characters (default ruff setting)
|
- Maximum line length: 88 characters (default ruff setting)
|
||||||
- Use 4 spaces for indentation
|
- Use 4 spaces for indentation
|
||||||
|
|
||||||
### Types
|
### Types
|
||||||
|
|
||||||
- Use type hints for function parameters and return values
|
- Use type hints for function parameters and return values
|
||||||
- Prefer built-in types (str, int, list, dict) over typing aliases when possible
|
- Prefer built-in types (str, int, list, dict) over typing aliases when possible
|
||||||
- Use typing.Annotated for Typer command options
|
- Use typing.Annotated for Typer command options
|
||||||
|
|
||||||
### Naming Conventions
|
### Naming Conventions
|
||||||
|
|
||||||
- Variables and functions: snake_case
|
- Variables and functions: snake_case
|
||||||
- Classes: PascalCase
|
- Classes: PascalCase
|
||||||
- Constants: UPPER_SNAKE_CASE
|
- Constants: UPPER_SNAKE_CASE
|
||||||
- Private members: prefixed with underscore (_private)
|
- Private members: prefixed with underscore (_private)
|
||||||
|
|
||||||
### Error Handling
|
### Error Handling
|
||||||
|
|
||||||
- Use try/except blocks for expected exceptions
|
- Use try/except blocks for expected exceptions
|
||||||
- Raise appropriate HTTPException for API errors
|
- Raise appropriate HTTPException for API errors
|
||||||
- Include descriptive error messages
|
- Include descriptive error messages
|
||||||
- Use sys.exit(1) for command-line tool errors
|
- Use sys.exit(1) for command-line tool errors
|
||||||
|
|
||||||
### Frameworks and Libraries
|
### Frameworks and Libraries
|
||||||
|
|
||||||
- Typer for CLI interface
|
- Typer for CLI interface
|
||||||
- FastAPI for web API
|
- FastAPI for web API
|
||||||
- requests for HTTP requests
|
- requests for HTTP requests
|
||||||
@@ -89,17 +79,15 @@ poetry run fastapi run myice/webapi.py --host 127.0.0.1
|
|||||||
- Custom rl_ai_tools package for AI functionalities
|
- Custom rl_ai_tools package for AI functionalities
|
||||||
|
|
||||||
### Git Commit Messages
|
### Git Commit Messages
|
||||||
|
|
||||||
- Use conventional commits format
|
- Use conventional commits format
|
||||||
- Never mention Claude in commit messages
|
- Never mention Claude in commit messages
|
||||||
- Be descriptive but concise
|
- Be descriptive but concise
|
||||||
- Use present tense ("add feature" not "added feature")
|
- Use present tense ("add feature" not "added feature")
|
||||||
|
|
||||||
### Additional Rules
|
### Additional Rules
|
||||||
|
|
||||||
- Always use ddg-mcp to perform Web Search functionality
|
- Always use ddg-mcp to perform Web Search functionality
|
||||||
- Follow the existing code patterns in myice/myice.py and myice/webapi.py
|
- Follow the existing code patterns in myice/myice.py and myice/webapi.py
|
||||||
- Maintain backward compatibility when modifying existing APIs
|
- Maintain backward compatibility when modifying existing APIs
|
||||||
- Document new features in README.md
|
- Document new features in README.md
|
||||||
- Always run ruff format and ruff check after editing a python file
|
- Always run ruff format and ruff check after editing a python file
|
||||||
- use conventional commit messages
|
- use conventional commit messages
|
||||||
+16
-72
@@ -518,11 +518,9 @@
|
|||||||
headers: { "Authorization": `Bearer ${storedApiKey}` }
|
headers: { "Authorization": `Bearer ${storedApiKey}` }
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
// Check if available players data exists
|
const sortedPlayers = data.convocation.available
|
||||||
const availablePlayers = data.convocation.available || [];
|
.sort((a, b) => (a.number || 0) - (b.number || 0));
|
||||||
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;
|
||||||
@@ -553,73 +551,19 @@
|
|||||||
return numA - numB;
|
return numA - numB;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Process staff data
|
eventDetailsContent.innerHTML = `
|
||||||
const staffList = data.convocation.staff || [];
|
<h5>${data.title}</h5>
|
||||||
const totalStaff = staffList.length;
|
<p><strong>Type:</strong> ${data.type}</p>
|
||||||
|
<p><strong>Lieu:</strong> ${data.place}</p>
|
||||||
// Check if there are no players
|
<p><strong>Heure:</strong> ${data.time_start} - ${data.time_end}</p>
|
||||||
if (totalPlayers === 0 && totalStaff === 0) {
|
<p><strong>Joueurs convoqués:</strong> ${totalPlayers} joueur${totalPlayers > 1 ? 's' : ''} (${positionBreakdown})</p>
|
||||||
eventDetailsContent.innerHTML = `
|
<h6>Liste des joueurs:</h6>
|
||||||
<div class="card border-warning">
|
<ul>${playersByPosition.map(player => {
|
||||||
<div class="card-body text-center">
|
let number = player.number ? player.number : "N/A";
|
||||||
<h5 class="card-title">${data.title}</h5>
|
let position = player.position ? player.position : "N/A";
|
||||||
<p class="card-text"><strong>Type:</strong> ${data.type}</p>
|
return `<li>[${position}] ${number} - ${player.fname} ${player.lname} (${player.dob})</li>`;
|
||||||
<p class="card-text"><strong>Lieu:</strong> ${data.place}</p>
|
}).join('')}</ul>
|
||||||
<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));
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ from . import myice
|
|||||||
# OIDC Configuration
|
# OIDC Configuration
|
||||||
CLIENT_ID = os.environ.get("CLIENT_ID", "8ea04fbb-4237-4b1d-a895-0b3575a3af3f")
|
CLIENT_ID = os.environ.get("CLIENT_ID", "8ea04fbb-4237-4b1d-a895-0b3575a3af3f")
|
||||||
CLIENT_SECRET = os.environ.get(
|
CLIENT_SECRET = os.environ.get(
|
||||||
"CLIENT_SECRET", "REDACTED_CLIENT_SECRET"
|
"CLIENT_SECRET", "5iXycu7aU6o9e17NNTOUeetQkRkBqQlomoD2hTyLGLTAcwj0dwkkLH3mz1IrZSmJ"
|
||||||
)
|
)
|
||||||
REDIRECT_URI = os.environ.get("REDIRECT_URI", "http://localhost:8000/callback")
|
REDIRECT_URI = os.environ.get("REDIRECT_URI", "http://localhost:8000/callback")
|
||||||
AUTHORIZATION_ENDPOINT = "https://login.infomaniak.com/authorize"
|
AUTHORIZATION_ENDPOINT = "https://login.infomaniak.com/authorize"
|
||||||
|
|||||||
Reference in new issue
Block a user