traduction + alert

This commit is contained in:
maher
2025-12-29 16:41:58 +01:00
parent fc2c7a3d25
commit fef43c222d
19 changed files with 206 additions and 718 deletions

View File

@@ -1,75 +1,70 @@
{% extends 'base.html.twig' %}
{% block title %}Enquête{% endblock %}
{% block title %}Admin Validation{% endblock %}
{% set navbarTitle = "Enquête" %}
{% set navbarPages = [{'page':"Gestion", 'url':null }] %}
{% block content %}
<!-- Page Content -->
<div id="content-page" class="content-page">
<div class="container-fluid">
<div class="iq-card">
<div class="iq-card-header d-flex justify-content-between">
<div class="iq-header-title">
<h4 class="card-title">Liste des enquêtes à activer</h4>
</div>
<!-- az-header -->
<div class="az-content">
<div class="container">
<div class="az-content-body d-flex flex-column">
<div class="az-content-breadcrumb">
<span>Admin</span>
<span>Enquête</span>
</div>
<div class="iq-card-body">
<div class="table-responsive">
<table id="user-list-table" class="table table-striped table-bordered" role="grid" aria-describedby="user-list-page-info">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Date Create</th>
<th>Questions</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for investigation in investigations %}
<tr>
<td>{{ investigation.getId() }}</td>
<td>{{ investigation.getNameEn() }}</td>
<td>{{ investigation.getDateCreate()|date("d/m/Y H:i") }}</td>
<td>{{ investigation.getNbrQuestions() }}</td>
<td>
{% if investigation.getLastState() == 10 %}
<div class="badge badge-info">Création Terminer </div>
{% elseif investigation.getLastState() == 11 %}
<div class="badge badge-light">Encour de Création</div>
{% elseif investigation.getLastState() == 12 %}
<div class="badge badge-dark">Dupliquer</div>
{% elseif investigation.getLastState() == 20 %}
<div class="badge badge-success">Demande Valider</div>
{% elseif investigation.getLastState() == 21 %}
<div class="badge badge-warning text-white">Demande Envoyer</div>
{% elseif investigation.getLastState() == 22 %}
<div class="badge badge-danger text-white">Demande Rejeter</div>
{% else %}
--
{% endif %}
</td>
<td>
<a href="{{ path('app_investigation_admin_active', {id:investigation.getId()}) }}" class="">activer</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<h2 class="az-content-title">Validation</h2>
{% include 'basic/alert.html.twig' %}
<p class="mg-b-20">Liste des Enquête a valider par l'admin</p>
<div class="table-responsive">
<table class="table mg-b-0">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Date Create</th>
<th>Questions</th>
<th>Afficher</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for investigation in investigations %}
<tr>
<td>{{ investigation.getId() }}</td>
<td>{{ investigation.getNameEn() }}</td>
<td>{{ investigation.getDateCreate()|date("d/m/Y H:i") }}</td>
<td>{{ investigation.getNbrQuestions() }}</td>
<td>
<a href=""class="badge badge-warning text-white" >
Afficher l'enquête
</a>
</td>
<td>
<a href="{{ path('app_investigation_admin_active', {id:investigation.getId()}) }}" class="">Activer</a>
<a href="#" class="">Réfuser</a>
</td>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Wrapper END -->
{% endblock %}

View File

@@ -16,6 +16,8 @@
</div>
<h2 class="az-content-title">Enquête</h2>
{% include 'basic/alert.html.twig' %}
<div class="az-content-label mg-b-5"></div>
<p class="mg-b-20">Liste des enquêtes prêt a envoyer à ladministration pour valider</p>
@@ -23,9 +25,9 @@
<table class="table mg-b-0">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Demande de validation</th>
<th>ID</th>
<th>Name</th>
<th>Demande de validation</th>
</tr>
</thead>
<tbody>
@@ -84,10 +86,25 @@
</td>
<td>
<div class="btn-icon-list">
<a class="btn btn-indigo btn-icon" title="duplicate" href="{{ path('app_investigation_duplicate', {id:investigation.getId()}) }}"><i class="ion ion-ios-git-branch"></i></a>
<a class="btn btn-indigo btn-icon" title="Edit" href="{{ path('app_investigation_edit', {id:investigation.getId()}) }}"><i class="typcn typcn-edit"></i></a>
{% if investigation.getLastState() != 12 %}
<a class="btn btn-dark btn-icon" title="duplicate" href="{{ path('app_investigation_duplicate', {id:investigation.getId()}) }}"><i class="ion ion-ios-git-branch"></i></a>
{% endif %}
{% if investigation.getLastState() not in [20, 21] %}
<a class="btn btn-indigo btn-icon" title="Edit" href="{{ path('app_investigation_edit', {id:investigation.getId()}) }}"><i class="typcn typcn-edit"></i></a>
{% endif %}
<a class="btn btn-indigo btn-icon" title="Afficher" href="{{ path('app_investigation_show', {id:investigation.getId()}) }}"><i class="ion ion-ios-tv"></i></a>
<a class="btn btn-danger btn-icon" title="Delete" href="{{ path('app_investigation_delete', {id:investigation.getId()}) }}"><i class="ion ion-md-trash"></i></a>
{% if investigation.getLastState() in [10, 11, 12] %}
<button type="button"
class="btn btn-danger btn-icon"
data-toggle="modal"
data-target="#deleteModal"
data-url="{{ path('app_investigation_delete', {id:investigation.getId()}) }}">
<i class="ion ion-md-trash"></i>
</button>
{% endif %}
</div>
</td>
</tr>
@@ -102,4 +119,43 @@
</div>
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Confirmation de suppression</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Êtes-vous sûr de vouloir supprimer cet élément ? cette action est irréversible.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
{# Le formulaire de suppression réel #}
<form id="delete-form" method="post" action="">
<input type="hidden" name="_token" value="{{ csrf_token('delete') }}">
<button class="btn btn-danger">Confirmer la suppression</button>
</form>
</div>
</div>
</div>
</div>
{% block javascripts %}
<script type="text/javascript">
$('#deleteModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget); // Bouton qui a déclenché la modal
var url = button.data('url'); // Extraction de l'URL via l'attribut data-url
console.log(url);
var modal = $(this);
modal.find('#delete-form').attr('action', url);
});
</script>
{% endblock %}
{% endblock %}