add progression

This commit is contained in:
BRAMAS Arthur
2025-10-24 16:14:44 +02:00
commit 1b0601d724
94 changed files with 12994 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
{{ form_start(form, {'action': action, 'attr': {'class': 'ajax-form'}}) }}
{{ form_widget(form) }}
<div class="mt-3 text-end">
<button class="btn btn-success">Enregistrer</button>
</div>
{{ form_end(form) }}

View File

@@ -0,0 +1,19 @@
<table class="table table-bordered">
<thead>
<tr><th>ID</th><th>Nom</th><th>Actions</th></tr>
</thead>
<tbody>
{% for assistant in assistants %}
<tr>
<td>{{ assistant.id }}</td>
<td>{{ assistant.nom }}</td>
<td>
<button class="btn btn-warning btn-edit" data-url="{{ path('assistantia_edit', {'id': assistant.id}) }}">Modifier</button>
<form style="display:inline" method="post" action="{{ path('assistantia_delete', {'id': assistant.id}) }}">
<button class="btn btn-danger" onclick="return confirm('Supprimer ?')">Supprimer</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -0,0 +1,44 @@
{% extends 'base.html.twig' %}
{% block title %}CRUD Assistant IA{% endblock %}
{% block body %}
<h1>CRUD Assistant IA</h1>
<div class="d-flex gap-3">
<div style="flex:1;">
<h2>Ajouter / Modifier</h2>
<button class="btn btn-primary mb-3" id="btnAdd">+ Nouvel assistant IA</button>
{% if form is defined %}
{% include 'assistantia/_form.html.twig' with {'form': form, 'action': path('assistantia_new')} %}
{% endif %}
</div>
<div style="flex:2;">
<h2>Liste</h2>
{% include 'assistantia/_list.html.twig' %}
</div>
</div>
<div class="modal fade" id="crudModal" tabindex="-1">
<div class="modal-dialog"><div class="modal-content">
<div class="modal-header"><h5 class="modal-title">Formulaire</h5></div>
<div class="modal-body" id="modal-body"></div>
</div></div>
</div>
<script>
document.addEventListener('click', async e => {
if(e.target.id === 'btnAdd'){
const res = await fetch('{{ path("assistantia_new") }}');
const html = await res.text();
document.getElementById('modal-body').innerHTML = html;
new bootstrap.Modal(document.getElementById('crudModal')).show();
}
if(e.target.classList.contains('btn-edit')){
const url = e.target.dataset.url;
const res = await fetch(url);
const html = await res.text();
document.getElementById('modal-body').innerHTML = html;
new bootstrap.Modal(document.getElementById('crudModal')).show();
}
});
</script>
{% endblock %}

39
templates/base.html.twig Normal file
View File

@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}My Application{% endblock %}</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="{{ asset('css/styles.css') }}">
{% block stylesheets %}{% endblock %}
</head>
<body>
<header class="bg-light mb-4 shadow-sm">
<nav class="container py-3">
<ul class="nav justify-content-center">
<li class="nav-item"><a class="nav-link btn btn-primary me-2" href="{{ path('home') }}">Accueil</a></li>
<li class="nav-item"><a class="nav-link btn btn-primary me-2" href="{{ path('assistantia_index') }}">Assistant IA</a></li>
<li class="nav-item"><a class="nav-link btn btn-primary me-2" href="{{ path('contribia_index') }}">Contrib IA</a></li>
<li class="nav-item"><a class="nav-link btn btn-primary me-2" href="{{ path('contribution_index') }}">Contribution</a></li>
<li class="nav-item"><a class="nav-link btn btn-primary me-2" href="{{ path('membre_index') }}">Membre</a></li>
<li class="nav-item"><a class="nav-link btn btn-primary" href="{{ path('projet_index') }}">Projet</a></li>
</ul>
</nav>
</header>
<main class="container my-4">
{% block body %}{% endblock %}
</main>
<footer class="bg-light text-center py-3 mt-auto shadow-top">
<p class="mb-0">&copy; {{ "now"|date("Y") }} My Application</p>
{% block footer %}{% endblock %}
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="{{ asset('js/scripts.js') }}"></script>
{% block javascripts %}{% endblock %}
</body>
</html>

View File

View File

@@ -0,0 +1,22 @@
<table class="table table-bordered">
<thead>
<tr><th>ID</th><th>Assistant IA</th><th>Contribution</th><th>Pertinence</th><th>Temps</th><th>Actions</th></tr>
</thead>
<tbody>
{% for contrib in contribIas %}
<tr>
<td>{{ contrib.id }}</td>
<td>{{ contrib.assistantIa.nom }}</td>
<td>{{ contrib.contribution.titre }}</td>
<td>{{ contrib.getLibellePertinence() }}</td>
<td>{{ contrib.getLibelleTemps() }}</td>
<td>
<button class="btn btn-warning btn-edit" data-url="{{ path('contribia_edit', {'id': contrib.id}) }}">Modifier</button>
<form style="display:inline" method="post" action="{{ path('contribia_delete', {'id': contrib.id}) }}">
<button class="btn btn-danger" onclick="return confirm('Supprimer ?')">Supprimer</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -0,0 +1,44 @@
{% extends 'base.html.twig' %}
{% block title %}CRUD Contrib IA{% endblock %}
{% block body %}
<h1>CRUD Contrib IA</h1>
<div class="d-flex gap-3">
<div style="flex:1;">
<h2>Ajouter / Modifier</h2>
<button class="btn btn-primary mb-3" id="btnAdd">+ Nouvelle contribution IA</button>
{% if form is defined %}
{% include 'contribia/_form.html.twig' with {'form': form, 'action': path('contribia_new')} %}
{% endif %}
</div>
<div style="flex:2;">
<h2>Liste</h2>
{% include 'contribia/_list.html.twig' %}
</div>
</div>
<div class="modal fade" id="crudModal" tabindex="-1">
<div class="modal-dialog"><div class="modal-content">
<div class="modal-header"><h5 class="modal-title">Formulaire</h5></div>
<div class="modal-body" id="modal-body"></div>
</div></div>
</div>
<script>
document.addEventListener('click', async e => {
if(e.target.id === 'btnAdd'){
const res = await fetch('{{ path("contribia_new") }}');
const html = await res.text();
document.getElementById('modal-body').innerHTML = html;
new bootstrap.Modal(document.getElementById('crudModal')).show();
}
if(e.target.classList.contains('btn-edit')){
const url = e.target.dataset.url;
const res = await fetch(url);
const html = await res.text();
document.getElementById('modal-body').innerHTML = html;
new bootstrap.Modal(document.getElementById('crudModal')).show();
}
});
</script>
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% extends 'base.html.twig' %}
{% block title %}Liste des Contributions{% endblock %}
{% block body %}
<h2>Liste des Contributions</h2>
<ul>
{% for c in contributions %}
<li><a href="{{ path('contribution_show', {'id': c.id}) }}">Contribution #{{ c.id }}</a></li>
{% else %}
<li>Aucune contribution trouvée.</li>
{% endfor %}
</ul>
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends 'base.html.twig' %}
{% block title %}Détail Contribution{% endblock %}
{% block body %}
<h2>Détail Contribution</h2>
<pre>{{ dump(contribution) }}</pre>
<a href="{{ path('contribution_index') }}">Retour à la liste</a>
{% endblock %}

View File

@@ -0,0 +1,8 @@
{% extends 'base.html.twig' %}
{% block title %}Accueil{% endblock %}
{% block body %}
<h1>Bienvenue sur la page d'accueil</h1>
<p>Utilisez la barre de navigation pour accéder aux différentes sections.</p>
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% extends 'base.html.twig' %}
{% block title %}Liste des Membres{% endblock %}
{% block body %}
<h2>Liste des Membres</h2>
<ul>
{% for m in membres %}
<li><a href="{{ path('membre_show', {'id': m.id}) }}">Membre #{{ m.id }}</a></li>
{% else %}
<li>Aucun membre trouvé.</li>
{% endfor %}
</ul>
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends 'base.html.twig' %}
{% block title %}Détail Membre{% endblock %}
{% block body %}
<h2>Détail Membre</h2>
<pre>{{ dump(membre) }}</pre>
<a href="{{ path('membre_index') }}">Retour à la liste</a>
{% endblock %}

View File

@@ -0,0 +1,6 @@
{{ form_start(form, {'action': action}) }}
{{ form_widget(form) }}
<div class="mt-3 text-end">
<button class="btn btn-success">Enregistrer</button>
</div>
{{ form_end(form) }}

View File

@@ -0,0 +1,14 @@
<table class="table">
<thead><tr><th>ID</th><th>Nom</th><th>Actions</th></tr></thead>
<tbody>
{% for projet in projets %}
<tr>
<td>{{ projet.id }}</td>
<td>{{ projet.nom }}</td>
<td>
<button data-bs-toggle="modal" data-bs-target="#modal" data-action="{{ path('projet_edit', {'id': projet.id}) }}">Edit</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -0,0 +1,51 @@
{% extends 'base.html.twig' %}
{% block body %}
<div class="container mt-4">
<h1>Gestion des projets</h1>
<button class="btn btn-primary mb-3" id="btnAdd">+ Nouveau projet</button>
<table class="table table-bordered">
<thead><tr><th>ID</th><th>Nom</th><th>Statut</th><th>Actions</th></tr></thead>
<tbody>
{% for projet in projets %}
<tr>
<td>{{ projet.id }}</td>
<td>{{ projet.nom }}</td>
<td>{{ projet.statut }}</td>
<td>
<button class="btn btn-warning btn-edit" data-url="{{ path('projet_edit', {'id': projet.id}) }}">Modifier</button>
<form style="display:inline" method="post" action="{{ path('projet_delete', {'id': projet.id}) }}">
<button class="btn btn-danger" onclick="return confirm('Supprimer ?')">Supprimer</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="modal fade" id="crudModal" tabindex="-1">
<div class="modal-dialog"><div class="modal-content">
<div class="modal-header"><h5 class="modal-title">Formulaire</h5></div>
<div class="modal-body" id="modal-body"></div>
</div></div>
</div>
<script>
document.addEventListener('click', async e => {
if(e.target.id === 'btnAdd'){
const res = await fetch('{{ path("projet_new") }}');
const html = await res.text();
document.getElementById('modal-body').innerHTML = html;
new bootstrap.Modal(document.getElementById('crudModal')).show();
}
if(e.target.classList.contains('btn-edit')){
const url = e.target.dataset.url;
const res = await fetch(url);
const html = await res.text();
document.getElementById('modal-body').innerHTML = html;
new bootstrap.Modal(document.getElementById('crudModal')).show();
}
});
</script>
{% endblock %}