svg
This commit is contained in:
68
templates/group/edit.html.twig
Normal file
68
templates/group/edit.html.twig
Normal file
@@ -0,0 +1,68 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %} = {{title}}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>{{title}}</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form.submit) }}
|
||||
<a href="{{ path(routecancel) }}" class="btn btn-secondary me-5">Annuler</a>
|
||||
{% if mode=="update" and is_granted('DELETE', group) %}
|
||||
<a href="{{ path(routedelete,{id:group.id}) }}" class="btn btn-danger float-end" onclick="return confirm('Confirmez-vous la suppression de cet enregistrement ?')">Supprimer</a>
|
||||
{% endif %}
|
||||
|
||||
{% include('include/error.html.twig') %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 mx-auto">
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Information</div>
|
||||
<div class="card-body">
|
||||
{{ form_row(form.title) }}
|
||||
{{ form_row(form.dueDate) }}
|
||||
{{ form_row(form.users) }}
|
||||
{{ form_row(form.summary) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if mode=="update" %}
|
||||
{{ render(path("bninefiles_files",{domain:'group',id:group.id, editable:1})) }}
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Timeline</div>
|
||||
<div class="card-body">
|
||||
{% include('group/timeline.html.twig') %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if mode=="update" %}
|
||||
<div class="col-md-8 mx-auto">
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Pad du Groupe</div>
|
||||
<div class="card-body">
|
||||
{{ form_widget(form.description) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#group_title").focus();
|
||||
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
44
templates/group/list.html.twig
Normal file
44
templates/group/list.html.twig
Normal file
@@ -0,0 +1,44 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %} = {{title}}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>{{title}}</h1>
|
||||
<a href="{{ path(routesubmit) }}" class="btn btn-success">Ajouter</a>
|
||||
|
||||
<div class="dataTable_wrapper">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="100px" class="no-sort">Action</th>
|
||||
<th>Title</th>
|
||||
<th width="200px">Modifié le</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for project in projects %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ path(routeupdate,{id:project.id}) }}" class="me-2"><i class="fas fa-file fa-2x"></i></a>
|
||||
</td>
|
||||
<td>{{project.title}}</td>
|
||||
<td>{{project.timelines.first ? project.timelines.first.createdAt|date('d/m/Y H:i') : '' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 2, "asc" ]]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
57
templates/group/timeline.html.twig
Normal file
57
templates/group/timeline.html.twig
Normal file
@@ -0,0 +1,57 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
|
||||
|
||||
<div class="timeline">
|
||||
{% for event in group.timelines %}
|
||||
<div class="timeline-item">
|
||||
<div class="timeline-marker"></div>
|
||||
<div class="timeline-content">
|
||||
<p class="text-muted small mb-1">
|
||||
{{ event.createdAt|date('d/m/Y H:i') }} par <strong>{{ event.user.username }}</strong><br>
|
||||
{% for field, change in event.description %}
|
||||
<strong>{{ field }}</strong>
|
||||
{% if field=="status" %}
|
||||
<span class="text-danger">{{ change.old ?? '' }}</span>
|
||||
→
|
||||
<span class="text-success">{{ change.new ?? '' }}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if not change.old is defined and change[0] is defined %}
|
||||
<span>{{ change[0] }}</span>
|
||||
{% endif %}
|
||||
<br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.timeline {
|
||||
border-left: 3px solid #dee2e6;
|
||||
padding-left: 2rem;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
}
|
||||
.timeline-item {
|
||||
position: relative;
|
||||
margin-bottom: 10px;
|
||||
margin-left: -23px;
|
||||
}
|
||||
.timeline-content {
|
||||
line-height:14px;
|
||||
}
|
||||
.timeline-marker {
|
||||
position: absolute;
|
||||
left: -1.1rem;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
border-radius: 50%;
|
||||
background: #0d6efd;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0 0 0 3px #0d6efd44;
|
||||
}
|
||||
.timeline-content {
|
||||
padding-left: 1rem;
|
||||
}
|
||||
</style>
|
73
templates/group/view.html.twig
Normal file
73
templates/group/view.html.twig
Normal file
@@ -0,0 +1,73 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %} = {{title}}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1 style="display:flex;">
|
||||
<div style="flex-grow:1">{{title}}</div>
|
||||
<div class="">{{group.status}}</div>
|
||||
</h1>
|
||||
|
||||
<div class="mb-3">
|
||||
{% if is_granted('UPDATE', group) %}
|
||||
<a href="{{ path(routeupdate,{id:group.id}) }}" class="btn btn-success me-1">Modifier</a>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path(routecancel) }}" class="btn btn-secondary me-5">Retour</a>
|
||||
|
||||
{% if is_granted('MOVETOINACTIF', group) and group.status=="Actif"%}
|
||||
<a href="{{ path(routemove,{id:group.id, status:"INACTIF"}) }}" class="btn btn-primary me-1" onclick="return confirm('Statut = Inactif ?')">
|
||||
<i class="fas fa-angle-double-right"></i> Statut = Inactif
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if is_granted('DELETE', group) %}
|
||||
<a href="{{ path(routedelete,{id:group.id}) }}" class="btn btn-danger float-end" onclick="return confirm('Confirmez-vous la suppression de cet enregistrement ?')">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if is_granted('MOVETOACTIF', group) and group.status=="Inactif" %}
|
||||
<a href="{{ path(routemove,{id:group.id, status:"ACTIF"}) }}" class="btn btn-warning me-1 float-end" onclick="return confirm('Statut = Actif ?')">
|
||||
<i class="fas fa-angle-double-left"></i> Statut = Actif
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 mx-auto">
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Information</div>
|
||||
<div class="card-body">
|
||||
<b>Titre</b> = {{ group.title }}<br>
|
||||
<b>A Voter pour le</b> = {{ group.dueDate ? group.dueDate|date("d/m/Y"):"" }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Résumé</div>
|
||||
<div class="card-body">
|
||||
{{ group.summary|nl2br }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ render(path("bninefiles_files",{domain:'group',id:group.id, editable:0})) }}
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Timeline</div>
|
||||
<div class="card-body">
|
||||
{% include('group/timeline.html.twig') %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 mx-auto">
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">Pad du Group</div>
|
||||
<div class="card-body">
|
||||
{{ group.description ? group.description|markdown_to_html : "" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -3,115 +3,174 @@
|
||||
|
||||
|
||||
{%block body%}
|
||||
<h2>Projets</h2>
|
||||
<ul id="tabProjects" class="nav nav-tabs">
|
||||
<li class="me-5">
|
||||
<a href="{{ path('app_user_project_submit') }}" class="btn btn-success">Ajouter</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#" data-status="A Voter"">A Voter</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" data-status="Brouillon">Brouillon</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" data-status="Voté">Voté</a>
|
||||
</li>
|
||||
<li class="nav-item ms-auto">
|
||||
<a class="nav-link" href="#" data-status="Archivé">Archivé</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-success nav-tome" href="#">Mes Projets</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h2>Projets</h2>
|
||||
<ul id="tabProjects" class="nav nav-tabs">
|
||||
<li class="me-5">
|
||||
<a href="{{ path('app_user_project_submit') }}" class="btn btn-success">Ajouter</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#" data-status="A Voter"">A Voter</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" data-status="Brouillon">Brouillon</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" data-status="Voté">Voté</a>
|
||||
</li>
|
||||
<li class="nav-item ms-auto">
|
||||
<a class="nav-link" href="#" data-status="Archivé">Archivé</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-success nav-tome" href="#">Mes Projets</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="containerdraft" data-status="Brouillon" class='containerStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">Brouillon</h3>
|
||||
</div>
|
||||
<div id="containervoted" data-status="A Voter" class='containerStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">A Voter</h3>
|
||||
</div>
|
||||
<div id="containertovote" data-status="Voté" class='containerStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">Voté</h3>
|
||||
</div>
|
||||
<div id="containerarchived" data-status="Archivé" class='containerStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">Archivé</h3>
|
||||
</div>
|
||||
<div id="containerdraft" data-status="Brouillon" class='containerProjectStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">Brouillon</h3>
|
||||
</div>
|
||||
<div id="containervoted" data-status="A Voter" class='containerProjectStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">A Voter</h3>
|
||||
</div>
|
||||
<div id="containertovote" data-status="Voté" class='containerProjectStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">Voté</h3>
|
||||
</div>
|
||||
<div id="containerarchived" data-status="Archivé" class='containerProjectStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">Archivé</h3>
|
||||
</div>
|
||||
|
||||
<div style="display:none">
|
||||
{% for project in projects %}
|
||||
{% if is_granted('VIEW', project) %}
|
||||
<div class='card cardProject' data-status="{{project.status}}" data-tome="{{is_granted('TOME', project)}}" style='width:300px; margin-right:10px;'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h5>{{project.title}}</h5>
|
||||
<div style="display:none">
|
||||
{% for project in projects %}
|
||||
{% if is_granted('VIEW', project) %}
|
||||
<div class='card cardProject' data-status="{{project.status}}" data-tome="{{is_granted('TOME', project)}}" style='width:300px; margin-right:10px;'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h5>{{project.title}}</h5>
|
||||
|
||||
<div>
|
||||
<a href="{{ path("app_user_project_view",{id:project.id}) }}" class="btn btn-secondary btn-sm"><i class="fas fa-eye"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
{{project.summary|nl2br}}
|
||||
|
||||
{% if project.status=="Voté" or project.status=="Archivé" %}
|
||||
<small>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
{% for option in project.options %}
|
||||
{{ option.title|title }} = {{ option.nbVote }}<br>
|
||||
{% endfor %}
|
||||
<div>
|
||||
<a href="{{ path("app_user_project_view",{id:project.id}) }}" class="btn btn-secondary btn-sm"><i class="fas fa-eye"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
Votes Blancs = {{ project.nbVoteWhite }}<br>
|
||||
Votes Nuls = {{ project.nbVoteNull }}
|
||||
<div class='card-body'>
|
||||
{{project.summary|nl2br}}
|
||||
|
||||
{% if project.status=="Voté" or project.status=="Archivé" %}
|
||||
<small>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
{% for option in project.options %}
|
||||
{{ option.title|title }} = {{ option.nbVote }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
Votes Blancs = {{ project.nbVoteWhite }}<br>
|
||||
Votes Nuls = {{ project.nbVoteNull }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<strong>Résultat = </strong><br>
|
||||
{{ project.resultVote|nl2br }}
|
||||
</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class='card-footer' style="line-height:14px">
|
||||
<small><em>
|
||||
{% if project.dueDate %}
|
||||
<b>A Voter pour le</b> = {{ project.dueDate|date("d/m/Y") }}<br>
|
||||
{% endif %}
|
||||
<b>Nature</b> = {{ project.nature }}<br>
|
||||
<b>Propriétaires</b> =
|
||||
{%for user in project.users%}
|
||||
{{loop.first ? user.username : ' - '~user.username}}
|
||||
{%endfor%}
|
||||
</em></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<strong>Résultat = </strong><br>
|
||||
{{ project.resultVote|nl2br }}
|
||||
</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class='card-footer' style="line-height:14px">
|
||||
<small><em>
|
||||
{% if project.dueDate %}
|
||||
<b>A Voter pour le</b> = {{ project.dueDate|date("d/m/Y") }}<br>
|
||||
{% endif %}
|
||||
<b>Nature</b> = {{ project.nature }}<br>
|
||||
<b>Propriétaires</b> =
|
||||
{%for user in project.users%}
|
||||
{{loop.first ? user.username : ' - '~user.username}}
|
||||
{%endfor%}
|
||||
</em></small>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<h2>Groupes</h2>
|
||||
<ul id="tabGroups" class="nav nav-tabs">
|
||||
<li class="me-5">
|
||||
<a href="{{ path('app_user_group_submit') }}" class="btn btn-success">Ajouter</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="#" data-status="Actif"">Actif</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#" data-status="Brouillon">Inactif</a>
|
||||
</li>
|
||||
<li class="nav-item ms-auto">
|
||||
<a class="nav-link text-success nav-tome" href="#">Mes Groupes</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="containeractif" data-status="Actif" class='containerGroupStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">Actif</h3>
|
||||
</div>
|
||||
<div id="containerinactif" data-status="Inactif" class='containerGroupStatus d-flex flex-wrap mt-3' style='justify-content: left'>
|
||||
<h3 style="width:100%">Inactif</h3>
|
||||
</div>
|
||||
|
||||
<div style="display:none">
|
||||
{% for group in groups %}
|
||||
{% if is_granted('VIEW', group) %}
|
||||
<div class='card cardGroup' data-status="{{group.status}}" data-tome="{{is_granted('TOME', group)}}" style='width:300px; margin-right:10px;'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h5>{{group.title}}</h5>
|
||||
|
||||
<div>
|
||||
<a href="{{ path("app_user_group_view",{id:group.id}) }}" class="btn btn-secondary btn-sm"><i class="fas fa-eye"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
{{group.summary|nl2br}}
|
||||
</div>
|
||||
|
||||
<div class='card-footer' style="line-height:14px">
|
||||
<small><em>
|
||||
{% if group.dueDate %}
|
||||
<b>A Voter pour le</b> = {{ group.dueDate|date("d/m/Y") }}<br>
|
||||
{% endif %}
|
||||
<b>Propriétaires</b> =
|
||||
{%for user in group.users%}
|
||||
{{loop.first ? user.username : ' - '~user.username}}
|
||||
{%endfor%}
|
||||
</em></small>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%endblock%}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Cacher tous les containers sauf celui actif au chargement
|
||||
let initialStatus = $('.nav-link.active').data('status');
|
||||
$('.containerStatus').removeClass("d-flex");
|
||||
$('.containerStatus').hide();
|
||||
let initialStatus = $('#tabProjects .nav-link.active').data('status');
|
||||
$('.containerProjectStatus').removeClass("d-flex");
|
||||
$('.containerProjectStatus').hide();
|
||||
|
||||
$('.cardProject').each(function () {
|
||||
const $card = $(this);
|
||||
const status = $card.data('status');
|
||||
const $container = $('.containerStatus[data-status="' + status + '"]')
|
||||
const $container = $('.containerProjectStatus[data-status="' + status + '"]')
|
||||
|
||||
if ($container.length) {
|
||||
$container.append($card);
|
||||
}
|
||||
});
|
||||
|
||||
console.log(initialStatus);
|
||||
$('.containerStatus[data-status="' + initialStatus + '"]').addClass("d-flex");
|
||||
$('.containerProjectStatus[data-status="' + initialStatus + '"]').addClass("d-flex");
|
||||
|
||||
$('#tabProjects .nav-link').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
@@ -127,7 +186,7 @@
|
||||
// On affiche que les cardProject avec tome
|
||||
$(".cardProject[data-tome='1']").show();
|
||||
|
||||
$('.containerStatus').each(function () {
|
||||
$('.containerProjectStatus').each(function () {
|
||||
const $container = $(this);
|
||||
const hasTome = $container.find('.cardProject[data-tome="1"]').length > 0;
|
||||
|
||||
@@ -146,11 +205,69 @@
|
||||
let status = $(this).data('status');
|
||||
|
||||
// Cache tous les containers, puis affiche celui correspondant au data-status
|
||||
$('.containerStatus').removeClass('d-flex').hide();
|
||||
$('.containerStatus[data-status="' + status + '"]').addClass("d-flex").show();
|
||||
$('.containerProjectStatus').removeClass('d-flex').hide();
|
||||
$('.containerProjectStatus[data-status="' + status + '"]').addClass("d-flex").show();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
// Cacher tous les containers sauf celui actif au chargement
|
||||
let initialStatus = $('#tabGroups .nav-link.active').data('status');
|
||||
$('.containerGroupStatus').removeClass("d-flex");
|
||||
$('.containerGroupStatus').hide();
|
||||
|
||||
$('.cardGroup').each(function () {
|
||||
const $card = $(this);
|
||||
const status = $card.data('status');
|
||||
const $container = $('.containerGroupStatus[data-status="' + status + '"]')
|
||||
|
||||
if ($container.length) {
|
||||
$container.append($card);
|
||||
}
|
||||
});
|
||||
|
||||
$('.containerGroupStatus[data-status="' + initialStatus + '"]').addClass("d-flex");
|
||||
|
||||
$('#tabGroups .nav-link').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Gère les onglets actifs
|
||||
$('.nav-link').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
if ($(this).hasClass('nav-tome')) {
|
||||
// On masque tt les cardGroup
|
||||
$(".cardGroup").hide();
|
||||
|
||||
// On affiche que les cardGroup avec tome
|
||||
$(".cardGroup[data-tome='1']").show();
|
||||
|
||||
$('.containerGroupStatus').each(function () {
|
||||
const $container = $(this);
|
||||
const hasTome = $container.find('.cardGroup[data-tome="1"]').length > 0;
|
||||
|
||||
if (hasTome) {
|
||||
$container.addClass('d-flex').show();
|
||||
} else {
|
||||
$container.removeClass('d-flex').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
// On affiche tt les cardGroup
|
||||
$(".cardGroup").show();
|
||||
|
||||
// Récupère le data-status sélectionné
|
||||
let status = $(this).data('status');
|
||||
|
||||
// Cache tous les containers, puis affiche celui correspondant au data-status
|
||||
$('.containerGroupStatus').removeClass('d-flex').hide();
|
||||
$('.containerGroupStatus[data-status="' + status + '"]').addClass("d-flex").show();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
Reference in New Issue
Block a user