v0 ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
This commit is contained in:
78
templates/Alert/edit.html.twig
Executable file
78
templates/Alert/edit.html.twig
Executable file
@ -0,0 +1,78 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Annonces = {{alert.title}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Annonces
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_alert') }}>Annuler</a>
|
||||
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('app_'~access~'_alert_delete',{'id':alert.id}) }}
|
||||
class="btn btn-danger float-end"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cette annonce ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="form-group row clearfix">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.title) }}
|
||||
{{ form_row(form.fghideable) }}
|
||||
{{ form_row(form.publishedat) }}
|
||||
{{ form_row(form.unpublishedat) }}
|
||||
{{ form_row(form.content) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-link fa-fw"></i> Affectations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.alertcategory) }}
|
||||
{{ form_row(form.roles) }}
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
431
templates/Alert/list.html.twig
Normal file
431
templates/Alert/list.html.twig
Normal file
@ -0,0 +1,431 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">
|
||||
Gestion des Annonces
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<a href="{{ path('app_'~access~'_alert_submit') }}" class="btn btn-success">Ajouter une Annonce</a>
|
||||
<a href="{{ path('app_'~access~'_alertcategory_submit') }}" class="btn btn-success">Ajouter une Catégorie</a>
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div id="listpending" class="card mb-5">
|
||||
<div class="card-header"><h3 style="margin:0px"><i class="fa fa-pause fa-fw"></i> En Attente Publication</h3></div>
|
||||
<ul class="list-alert list-group list-group-flush">
|
||||
{% for alert in alerts %}
|
||||
{% if alert.isPending %}
|
||||
<div
|
||||
class="alert-item list-group-item d-flex flex-column
|
||||
alertcategory-{{ alert.alertcategory.id }}
|
||||
{{ alert.isOnline ? "alertstatut-online" : ""}}
|
||||
{{ alert.isPending ? "alertstatut-pending" : ""}}
|
||||
{{ alert.isArchived ? "alertstatut-archived" : ""}}
|
||||
{% for group in alert.groups %}{{ ' group-' ~ group.id }}{% endfor %}
|
||||
{% for role in alert.roles %}{{ ' role-' ~ role }}{% endfor %}
|
||||
"
|
||||
data-alert-category-id="{{ alert.alertcategory.id }}"
|
||||
data-alert-id="{{ alert.id }}"
|
||||
style="background: {{ alert.alertcategory.color ? alert.alertcategory.color : 'var(--colorbgbodydark)' }};"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="d-flex align-items-center w-100" style="color: var(--colorftbodydark) !important">
|
||||
<i class="fa fa-arrows-up-down fa-2x fa-fw me-1"></i>
|
||||
|
||||
{% if alert.alertcategory.icon %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:alert.alertcategory.icon.label}) }}">
|
||||
{% else %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_megaphone.png"}) }}">
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path('app_'~access~'_alert_update', { id: alert.id }) }}" class="ms-3" style="color: var(--colorftbodydark) !important; font-family: var(--fonttitle); font-size:var(--fontsizeh3)">
|
||||
{{ alert.title }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a class="float-end" data-bs-toggle="collapse" href="#alert-{{ alert.id }}" role="button" aria-expanded="false" aria-controls="alert-{{ alert.id }}" style="color: var(--colorftbodydark) !important;">
|
||||
<i class="fa fa-chevron-down fa-2x"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="alert-{{ alert.id }}" class="ckeditor-content collapse pt-3" style="color: var(--colorftbodydark) !important;">
|
||||
{{ alert.content|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="listonline" class="card mb-5">
|
||||
<div class="card-header"><h3 style="margin:0px"><i class="fa fa-eye fa-fw"></i> En Ligne</h3></div>
|
||||
|
||||
<ul class="list-alert list-group list-group-flush">
|
||||
{% for alert in alerts %}
|
||||
{% if alert.isOnline %}
|
||||
<div
|
||||
class="alert-item list-group-item d-flex flex-column
|
||||
alertcategory-{{ alert.alertcategory.id }}
|
||||
{{ alert.isOnline ? "alertstatut-online" : ""}}
|
||||
{{ alert.isPending ? "alertstatut-pending" : ""}}
|
||||
{{ alert.isArchived ? "alertstatut-archived" : ""}}
|
||||
{% for group in alert.groups %}{{ ' group-' ~ group.id }}{% endfor %}
|
||||
{% for role in alert.roles %}{{ ' role-' ~ role }}{% endfor %}
|
||||
"
|
||||
data-alert-category-id="{{ alert.alertcategory.id }}"
|
||||
data-alert-id="{{ alert.id }}"
|
||||
style="background: {{ alert.alertcategory.color ? alert.alertcategory.color : 'var(--colorbgbodydark)' }};"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="d-flex align-items-center w-100" style="color: var(--colorftbodydark) !important">
|
||||
<i class="fa fa-arrows-up-down fa-2x fa-fw me-1"></i>
|
||||
|
||||
{% if alert.alertcategory.icon %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:alert.alertcategory.icon.label}) }}">
|
||||
{% else %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_megaphone.png"}) }}">
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path('app_'~access~'_alert_update', { id: alert.id }) }}" class="ms-3" style="color: var(--colorftbodydark) !important; font-family: var(--fonttitle); font-size:var(--fontsizeh3)">
|
||||
{{ alert.title }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a class="float-end" data-bs-toggle="collapse" href="#alert-{{ alert.id }}" role="button" aria-expanded="false" aria-controls="alert-{{ alert.id }}" style="color: var(--colorftbodydark) !important;">
|
||||
<i class="fa fa-chevron-down fa-2x"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="alert-{{ alert.id }}" class="ckeditor-content collapse pt-3" style="color: var(--colorftbodydark) !important;">
|
||||
{{ alert.content|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="listarchived" class="card mb-5">
|
||||
<div class="card-header"><h3 style="margin:0px"><i class="fa fa-history fa-fw"></i>Archivées</h3></div>
|
||||
|
||||
<ul class="list-alert list-group list-group-flush">
|
||||
{% for alert in alerts %}
|
||||
{% if alert.isArchived %}
|
||||
<div
|
||||
class="alert-item list-group-item d-flex flex-column
|
||||
alertcategory-{{ alert.alertcategory.id }}
|
||||
{{ alert.isOnline ? "alertstatut-online" : ""}}
|
||||
{{ alert.isPending ? "alertstatut-pending" : ""}}
|
||||
{{ alert.isArchived ? "alertstatut-archived" : ""}}
|
||||
{% for group in alert.groups %}{{ ' group-' ~ group.id }}{% endfor %}
|
||||
{% for role in alert.roles %}{{ ' role-' ~ role }}{% endfor %}
|
||||
"
|
||||
data-alert-category-id="{{ alert.alertcategory.id }}"
|
||||
data-alert-id="{{ alert.id }}"
|
||||
style="background: {{ alert.alertcategory.color ? alert.alertcategory.color : 'var(--colorbgbodydark)' }};"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="d-flex align-items-center w-100" style="color: var(--colorftbodydark) !important">
|
||||
<i class="fa fa-arrows-up-down fa-2x fa-fw me-1"></i>
|
||||
|
||||
{% if alert.alertcategory.icon %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:alert.alertcategory.icon.label}) }}">
|
||||
{% else %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_megaphone.png"}) }}">
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path('app_'~access~'_alert_update', { id: alert.id }) }}" class="ms-3" style="color: var(--colorftbodydark) !important; font-family: var(--fonttitle); font-size:var(--fontsizeh3)">
|
||||
{{ alert.title }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a class="float-end" data-bs-toggle="collapse" href="#alert-{{ alert.id }}" role="button" aria-expanded="false" aria-controls="alert-{{ alert.id }}" style="color: var(--colorftbodydark) !important;">
|
||||
<i class="fa fa-chevron-down fa-2x"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="alert-{{ alert.id }}" class="ckeditor-content collapse pt-3" style="color: var(--colorftbodydark) !important;">
|
||||
{{ alert.content|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-filter"></i>
|
||||
Afficher par Catégorie
|
||||
</div>
|
||||
|
||||
<div id="category-filter" class="list-group list-group-flush">
|
||||
{% for alertcategory in alertcategorys %}
|
||||
<div class="d-flex">
|
||||
<a href="#" class="list-group-item active category-alert-item" data-category="{{ alertcategory.id }}" style="width:100%; border-left: 15px solid {{ alertcategory.color ? alertcategory.color : 'var(--colorbgbodydark)' }}; position: inherit;">
|
||||
{% if alertcategory.icon %}
|
||||
<img height="25" src="{{ path('app_minio_image',{file:alertcategory.icon.label}) }}">
|
||||
{% else %}
|
||||
<img height="25" src="{{ path('app_minio_image',{file:"icon/icon_megaphone.png"}) }}">
|
||||
{% endif %}
|
||||
|
||||
{{ alertcategory.label }}
|
||||
</a>
|
||||
|
||||
<a class="btn btn-primary float-right" href="{{ path('app_'~access~'_alertcategory_update', { id: alertcategory.id }) }}" style="margin:4px">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-filter"></i>
|
||||
Afficher par Rôle
|
||||
</div>
|
||||
<ul id="role-filter" class="list-group list-group-flush">
|
||||
<a class="active list-group-item filterfgall" id="allrole" style="cursor:pointer">
|
||||
<i class="fa fa-users"></i>
|
||||
Toutes les Rôles
|
||||
<span class="badge bg-success float-end">{{ alerts|length }}</span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_ANONYME" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Visiteur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_USER" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Utilisateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_MANAGER" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Manager
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_MASTER" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Master
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_MODO" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Modérateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_ADMIN" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Administrateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-filter"></i>
|
||||
Afficher par Groupes
|
||||
</div>
|
||||
|
||||
<div id="group-filter" class="list-group list-group-flush">
|
||||
<a href="#" class="active list-group-item filterfgall">
|
||||
<i class="fa fa-users"></i>
|
||||
Tout les groupes
|
||||
<span class="badge bg-success float-end">{{ alerts|length }}</span>
|
||||
</a>
|
||||
|
||||
{% for group in groups %}
|
||||
<a class="list-group-item" href="#" data-role="{{ group.id }}">
|
||||
<i class="fa fa-user"></i>
|
||||
{{ group.label }}
|
||||
<span class="badge bg-success float-end">{{ group.alerts|length }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-filter"></i>
|
||||
Afficher par statut
|
||||
</div>
|
||||
|
||||
<div id="statut-filter" class="list-group list-group-flush">
|
||||
<a class="list-group-item active filterfgall" data-statut="all" href="#">
|
||||
<i class="fa fa-eye-slash"></i>
|
||||
Toutes
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-statut="online" href="#">
|
||||
<i class="fa fa-eye"></i>
|
||||
En ligne
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-statut="pending" href="#">
|
||||
<i class="fas fa-pause"></i>
|
||||
En attente de publication
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-statut="archived" href="#">
|
||||
<i class="fa fa-history"></i>
|
||||
Archivées
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("a[data-role='ROLE_ANONYME']").children("span").html($('.role-ROLE_ANONYME').length);
|
||||
$("a[data-role='ROLE_USER']").children("span").html($('.role-ROLE_USER').length);
|
||||
$("a[data-role='ROLE_MANAGER']").children("span").html($('.role-ROLE_MANAGER').length);
|
||||
$("a[data-role='ROLE_MASTER']").children("span").html($('.role-ROLE_ANIM').length);
|
||||
$("a[data-role='ROLE_MODO']").children("span").html($('.role-ROLE_MODO').length);
|
||||
$("a[data-role='ROLE_ADMIN']").children("span").html($('.role-ROLE_ADMIN').length);
|
||||
|
||||
|
||||
function updateItems() {
|
||||
$('.alert-item').each(function(i) {
|
||||
var itemid = $(this).data('alert-id');
|
||||
$(this).find('input[name="alert_item[rowOrder][]"]').val(i);
|
||||
|
||||
// Mise à jour en base de l'order
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_'~access~'_alert_order') }}",
|
||||
data: {
|
||||
id:itemid,
|
||||
order:i
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if($(".alertstatut-pending").length==0) $("#listpending").hide();
|
||||
if($(".alertstatut-online").length==0) $("#listonline").hide();
|
||||
if($(".alertstatut-archived").length==0) $("#listarchived").hide();
|
||||
|
||||
$( ".list-alert" ).sortable({
|
||||
axis: "y",
|
||||
placeholder: "alert.item placeholder",
|
||||
update: updateItems
|
||||
});
|
||||
|
||||
$("#category-filter a.category-alert-item").click(function(){
|
||||
// On réactive les auters filtres à tout
|
||||
$('#role-filter a').removeClass('active');
|
||||
$('#group-filter a').removeClass('active');
|
||||
$('#statut-filter a').removeClass('active');
|
||||
$(".filterfgall").addClass('active');
|
||||
$(this).toggleClass('active');
|
||||
|
||||
$('.category-alert-item').each(function(i) {
|
||||
var $alerts = $('.alertcategory-'+$(this).data('category'));
|
||||
|
||||
|
||||
if($(this).hasClass('active')){
|
||||
$alerts.each(function(i) { $(this).removeClass("hide"); });
|
||||
} else {
|
||||
$alerts.each(function(i) { $(this).addClass("hide"); });
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#role-filter a').click(function(){
|
||||
// On réactive les auters filtres à tout
|
||||
$(".category-alert-item").addClass('active');
|
||||
$('#group-filter a').removeClass('active');
|
||||
$('#statut-filter a').removeClass('active');
|
||||
$(".filterfgall").addClass('active');
|
||||
|
||||
// On rend actif la zone cliquée
|
||||
$('#role-filter a').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
// On cache l'ensemble des elements
|
||||
$('.alert-item').each(function(i) { $(this).addClass("hide"); });
|
||||
|
||||
// On affiche les elements filtrés
|
||||
if($(this).hasClass('filterfgall'))
|
||||
var $alerts = $('.alert-item');
|
||||
else
|
||||
var $alerts = $('.role-'+$(this).data('role'));
|
||||
|
||||
$alerts.each(function(i) { $(this).removeClass("hide"); });
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#group-filter a').click(function(){
|
||||
// On réactive les auters filtres à tout
|
||||
$(".category-alert-item").addClass('active');
|
||||
$('#role-filter a').removeClass('active');
|
||||
$('#statut-filter a').removeClass('active');
|
||||
$(".filterfgall").addClass('active');
|
||||
|
||||
// On rend actif la zone cliquée
|
||||
$('#group-filter a').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
// On cache l'ensemble des elements
|
||||
$('.alert-item').each(function(i) { $(this).addClass("hide"); });
|
||||
|
||||
// On affiche les elements filtrés
|
||||
if($(this).hasClass('filterfgall'))
|
||||
var $alerts = $('.alert-item');
|
||||
else
|
||||
var $alerts = $('.group-'+$(this).data('role'));
|
||||
|
||||
$alerts.each(function(i) { $(this).removeClass("hide"); });
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#statut-filter a").click(function(){
|
||||
// On réactive les auters filtres à tout
|
||||
$(".category-alert-item").addClass('active');
|
||||
$('#group-filter a').removeClass('active');
|
||||
$("#group-filter .filterfgall").addClass('active');
|
||||
|
||||
// On rend actif la zone cliquée
|
||||
$('#statut-filter a').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
// On cache l'ensemble des elements
|
||||
$('.alert-item').each(function(i) { $(this).addClass("hide"); });
|
||||
|
||||
// On affiche les elements filtrés
|
||||
if($(this).hasClass('filterfgall'))
|
||||
var $alerts = $('.alert-item');
|
||||
else
|
||||
var $alerts = $('.alertstatut-'+$(this).data('statut'));
|
||||
|
||||
$alerts.each(function(i) { $(this).removeClass("hide"); });
|
||||
return false;
|
||||
});
|
||||
|
||||
} );
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
91
templates/Alertcategory/edit.html.twig
Executable file
91
templates/Alertcategory/edit.html.twig
Executable file
@ -0,0 +1,91 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Catégorie d'Annonce = {{alertcategory.label}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Catégorie d'Annonce
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_alert') }}>Annuler</a>
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('app_'~access~'_alertcategory_delete',{'id':alertcategory.id}) }}
|
||||
class="btn btn-danger float-end"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cette catégorie ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.label) }}
|
||||
{{ form_row(form.color) }}
|
||||
|
||||
<div id="diviconsel" class="col-md-12 text-center mt-1 mb-1" style="height:140px; padding:20px; background-color: {{ alertcategory.color ? alertcategory.color : 'var(--colorbgbodydark)' }};">
|
||||
{% if alertcategory.icon %}
|
||||
<img src="{{ path('app_minio_image',{file:alertcategory.icon.label}) }}" height="100" />
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="text-align:center;padding:0px">
|
||||
{{ form_row(form.idicon) }}
|
||||
<a class="btn btn-success btn-modal" data-modalid="mymodallarge" data-modaltitle="Icône" data-modalurl="{{ path('app_all_icon_select') }}" title='Selectionner un Icône'>Selectionner un Icône</a>
|
||||
<a class="btn btn-danger" onClick="delIcon()" title='Détacher'>Détacher l'Icône</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
function selIcon(idicon,url) {
|
||||
$("#alertcategory_idicon").val(idicon);
|
||||
$("#diviconsel img").remove();
|
||||
|
||||
$("#diviconsel").append("<img src='"+url+"'>");
|
||||
$("#diviconsel img").attr("height","100px");
|
||||
$("#mymodallarge").modal("hide");
|
||||
}
|
||||
|
||||
function delIcon() {
|
||||
$("#diviconsel img").remove();
|
||||
$("#alertcategory_idicon").val(null);
|
||||
}
|
||||
|
||||
|
||||
$("#alertcategory_color").bind("change paste keyup", function() {
|
||||
$("#diviconsel").css("background-color",$(this).val());
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
51
templates/Home/page.html.twig
Normal file
51
templates/Home/page.html.twig
Normal file
@ -0,0 +1,51 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block body %}
|
||||
{% if app.user %}
|
||||
{% set username = app.user.username %}
|
||||
{% else %}
|
||||
{% set username = "" %}
|
||||
{% endif %}
|
||||
|
||||
{% for bookmark in bookmarks %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% for itemcategory in itemcategorys %}
|
||||
{% if itemcategorys|length > 1 %} <h2>{{itemcategory.label}}</h2> {% endif %}
|
||||
|
||||
<div class="items-list">
|
||||
{% for item in items %}
|
||||
{% if item.itemcategory==itemcategory %}
|
||||
<div class="item item-large" style="background-color: {{ item.color ? item.color : "var(--colorbgbodydark)" }};">
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
<a class="item-link" href="{{ item.url|replace({'#login#': username}) }}" target="{{ item.target }}">
|
||||
{% if item.icon %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:item.icon.label}) }}">
|
||||
{% else %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_pin.png"}) }}">
|
||||
{% endif %}
|
||||
|
||||
<div class="item-title">
|
||||
<h3 >{{ item.title }}</h3>
|
||||
<div class="item-subtitle">{{ item.subtitle|nl2br }}</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="item-action">
|
||||
{% if item.content %}
|
||||
<a style="display:none"><i class="item-info fas fa-circle-info"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-description hide">{{ item.content|raw }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
78
templates/Icon/edit.html.twig
Executable file
78
templates/Icon/edit.html.twig
Executable file
@ -0,0 +1,78 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
{% if not inframe %}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Icône
|
||||
{% elseif mode=="submit" %}
|
||||
Création Icône
|
||||
{% endif %}
|
||||
</h1>
|
||||
{%endif%}
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_icon',{'inframe':inframe}) }}>Annuler</a>
|
||||
|
||||
{% if mode=="update" and not issystem %}
|
||||
<a href={{ path('app_'~access~'_icon_delete',{'id':icon.id,'inframe':inframe}) }}
|
||||
class="btn btn-danger float-end"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cet icône ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div style="width:110px; margin:10px auto;">
|
||||
<img id="icon_label_img" src="{{ path("app_minio_image",{file:icon.label}) }}" style="padding:10px; width:110px;height:auto;margin:auto;display:block;margin-bottom:5px;background-color: var(--colorbgbodydark)">
|
||||
{{ form_widget(form.label) }}
|
||||
{% if mode=="submit" or not issystem %}
|
||||
<a class="btn btn-info btn-modal" style="width:110px" data-modalid="mymodallarge" data-modaltitle="Icône" data-modalurl="{{ path('app_'~access~'_icon_upload', {"type": "icon", "reportinput": "#icon_label" }) }}" title='Ajouter un Icône'>Modifier</a>
|
||||
{%endif%}
|
||||
</div>
|
||||
|
||||
{% if mode=="submit" or not issystem %}
|
||||
<div style="width:200px; margin: 10px auto;text-align:center;">
|
||||
Privilégiez des images carrées de minimum 90px par 90px et avec un fond transparent
|
||||
</div>
|
||||
{%endif%}
|
||||
|
||||
{{ form_row(form.tags) }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if auditUse and mode=="update" and (access=="admin" or access=="modo" or access=="audit") %}
|
||||
<div class="float-end" style="width:700px;max-width:100%">
|
||||
{{ render(path("app_"~access~"_audit_renderid",{entityname:"Icon",entityid:icon.id})) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
25
templates/Icon/list.html.twig
Normal file
25
templates/Icon/list.html.twig
Normal file
@ -0,0 +1,25 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block body %}
|
||||
{% if not inframe %}
|
||||
<h1 class="page-header">Gestion des Icônes</h1>
|
||||
{% endif %}
|
||||
{% if auditUse and (access=="admin" or access=="audit") %}
|
||||
<a class="btn btn-secondary float-end" href="{{ path("app_"~access~"_audit_render",{entityname:"Icon"}) }}"><i class="fas fa-eye fa-fw"></i> Audit</a>
|
||||
{% endif %}
|
||||
|
||||
<p>
|
||||
<a class="btn btn-success" href={{ path('app_'~access~'_icon_submit',{'inframe': inframe}) }}>Ajouter</a>
|
||||
{% if inframe %}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_icon_select') }}>Fermer</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div class="flex wrap">
|
||||
{% for icon in icons %}
|
||||
<a href="{{ path('app_'~access~'_icon_update', {id : icon.id, 'inframe': inframe}) }}"><img class="icon" height="90" src="{{ path('app_minio_image',{file:icon.label}) }}"" style="padding:10px; margin-bottom:2px; background-color: var(--colorbgbodydark"></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
70
templates/Icon/select.html.twig
Normal file
70
templates/Icon/select.html.twig
Normal file
@ -0,0 +1,70 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="margin-bottom:15px">
|
||||
<a onclick="window.parent.$('#mymodal').modal('hide');" class="btn btn-secondary">Fermer</a>
|
||||
<a href="{{ path('app_'~access~'_icon',{'inframe':true}) }}" class="btn btn-secondary">Gérer les Icônes</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<label class="control-label" for="group_label">Recherche</label>
|
||||
<input type="text" id="icon_search" name="icon_search" class="form-control form-control" style="margin-bottom:15px">
|
||||
|
||||
{% if iconsuser is not empty %}
|
||||
<h3>Mes Icônes</h3>
|
||||
{% for icon in iconsuser %}
|
||||
{% set tag = "" %}
|
||||
{% if icon.tags %}
|
||||
{% set tag = icon.tags %}
|
||||
{% endif %}
|
||||
{% if icon.label starts with 'icon/icon_' %}
|
||||
{% set tag = tag ~ icon.label|replace({'icon/icon_':'', '.png':''}) %}
|
||||
{% endif %}
|
||||
|
||||
<img onClick="window.parent.selIcon({{ icon.id }},'{{ path('app_minio_image',{file:icon.label}) }}')" data="{{tag}}" id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="{{ path('app_minio_image',{file:icon.label}) }}" style="cursor:pointer; padding:2px; margin-bottom:2px; background-color: var(--colorbgbodydark">
|
||||
{% endfor %}
|
||||
|
||||
<h3 class="mt-3">Icônes Communs</h3>
|
||||
{% endif %}
|
||||
{% for icon in icons %}
|
||||
{% set tag = "" %}
|
||||
{% if icon.tags %}
|
||||
{% set tag = icon.tags %}
|
||||
{% endif %}
|
||||
{% if icon.label starts with 'icon/icon_' %}
|
||||
{% set tag = tag ~ icon.label|replace({'icon/icon_':'', '.png':''}) %}
|
||||
{% endif %}
|
||||
<img onClick="window.parent.selIcon({{ icon.id }},'{{ path('app_minio_image',{file:icon.label}) }}')" data="{{tag}}" id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="{{ path('app_minio_image',{file:icon.label}) }}" style="cursor:pointer; padding:2px; margin-bottom:2px; background-color: var(--colorbgbodydark">
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$('document').ready(function(){
|
||||
$( "#icon_search" ).focus();
|
||||
});
|
||||
|
||||
$( "#icon_search" ).on("keyup", function() {
|
||||
if($( "#icon_search" ).val()=="")
|
||||
$(".grid-item-img").show();
|
||||
else {
|
||||
tags=$( "#icon_search" ).val().toLowerCase().split(' ');
|
||||
|
||||
$(".grid-item-img").hide();
|
||||
tags.forEach(function(tag){
|
||||
$(".grid-item-img").each(function(index) {
|
||||
icontags=$( this ).attr("data");
|
||||
if (typeof icontags !== 'undefined') {
|
||||
if(icontags.includes(tag)) $(this).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
37
templates/Icon/upload.html.twig
Executable file
37
templates/Icon/upload.html.twig
Executable file
@ -0,0 +1,37 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block encoretags %}
|
||||
{{ encore_entry_link_tags('dropzone') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<a class="btn btn-secondary" onClick="closeModal();">Annuler</a>
|
||||
|
||||
<form
|
||||
action="{{ oneup_uploader_endpoint('icon') }}"
|
||||
class="dropzone"
|
||||
id="mydropzone"
|
||||
data-acceptedMimeTypes="image/*"
|
||||
data-maxFiles=1
|
||||
|
||||
style="margin-top:10px">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block localscript %}
|
||||
{{ encore_entry_script_tags('dropzone') }}
|
||||
|
||||
<script>
|
||||
function dropzonesuccess( file, response ) {
|
||||
parent.$("#icon_label").val("icon/"+response["file"]);
|
||||
parent.$("#icon_label_img").attr("src","{{ path("app_minio_image",{file:"icon/"}) }}"+response["file"]);
|
||||
closeModal();
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
window.parent.$("#mymodallarge").modal('hide');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
@ -64,6 +64,28 @@
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
'id': 'sidebar-portal',
|
||||
'icon': 'fa fa-door-closed',
|
||||
'name' : 'PORTAIL',
|
||||
'items' : [
|
||||
{
|
||||
icon: 'fa fa-bell',
|
||||
route: 'app_admin_alert',
|
||||
name: 'Annonces',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-desktop',
|
||||
route: 'app_admin_item',
|
||||
name: 'Items',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-bug',
|
||||
route: 'app_admin_icon',
|
||||
name: 'Icônes',
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
'id': 'sidebar-cron',
|
||||
'icon': 'fa fa-wrench',
|
||||
|
143
templates/Item/edit.html.twig
Executable file
143
templates/Item/edit.html.twig
Executable file
@ -0,0 +1,143 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Item = {{item.title}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Item
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_item') }}>Annuler</a>
|
||||
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('app_'~access~'_item_delete',{'id':item.id}) }}
|
||||
class="btn btn-danger float-end"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cet item ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.title) }}
|
||||
{{ form_row(form.subtitle) }}
|
||||
{{ form_row(form.url) }}
|
||||
<div><em>le mot clé #login# sera remplacé par le login de l'utilisateur</em></div>
|
||||
{{ form_row(form.target) }}
|
||||
<div id="divhelp"><em>Attention certains sites n'acceptent pas d'être encapsulés dans une frame. Si vous ne voyez pas votre site apparaître, veuillez changer de cible.</em></div>
|
||||
|
||||
{{ form_row(form.essential) }}
|
||||
{{ form_row(form.protected) }}
|
||||
{{ form_row(form.content) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-link fa-fw"></i> Affectations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.itemcategory) }}
|
||||
{{ form_row(form.roles) }}
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-glasses fa-fw"></i> Appararence
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.color) }}
|
||||
|
||||
|
||||
<div id="diviconsel" class="col-md-12 text-center mb-1 mt-1" style="height:140px; padding:20px; background-color: {{ item.color ? item.color : 'var(--colorbgbodydark)' }};">
|
||||
{% if item.icon %}
|
||||
<img src="{{ path('app_minio_image',{file:item.icon.label}) }}" height="100" />
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12" style="text-align:center;padding:0px">
|
||||
{{ form_row(form.idicon) }}
|
||||
<a class="btn btn-success btn-modal" data-modalid="mymodallarge" data-modaltitle="Icône" data-modalurl="{{ path('app_all_icon_select') }}" title='Selectionner un Icône'>Selectionner un Icône</a>
|
||||
<a class="btn btn-danger" onClick="delIcon()" title='Détacher'>Détacher l'Icône</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$('document').ready(function(){
|
||||
showhide();
|
||||
});
|
||||
|
||||
$("#item_color").bind("change paste keyup", function() {
|
||||
$("#diviconsel").css("background-color",$(this).val());
|
||||
});
|
||||
|
||||
|
||||
|
||||
function selIcon(idicon,url) {
|
||||
$("#item_idicon").val(idicon);
|
||||
$("#diviconsel img").remove();
|
||||
|
||||
$("#diviconsel").append("<img src='"+url+"'>");
|
||||
$("#diviconsel img").attr("height","100px");
|
||||
$("#mymodallarge").modal("hide");
|
||||
}
|
||||
|
||||
function delIcon() {
|
||||
$("#diviconsel img").remove();
|
||||
$("#item_idicon").val(null);
|
||||
}
|
||||
|
||||
function showhide() {
|
||||
$("#divhelp").hide();
|
||||
if($("#item_target").val()=="frame") {
|
||||
$("#divhelp").show();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
223
templates/Item/list.html.twig
Normal file
223
templates/Item/list.html.twig
Normal file
@ -0,0 +1,223 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">
|
||||
Gestion des Items
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<a href="{{ path('app_'~access~'_item_submit') }}" class="btn btn-success">Ajouter un Item</a>
|
||||
<a href="{{ path('app_'~access~'_itemcategory_submit') }}" class="btn btn-success">Ajouter une Categorie</a>
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 list-categorysitem">
|
||||
{% for itemcategory in itemcategorys %}
|
||||
<div class="card list-categoryitem mb-3" data-itemcategory-id="{{ itemcategory.id }}">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0">
|
||||
<a href="{{ path('app_'~access~'_itemcategory_update', { id: itemcategory.id }) }}">
|
||||
<small><i class="fa fa-arrows-v" style="display: inline-block; margin-top: -26px;"></i></small>
|
||||
{{ itemcategory.label }}
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="card-body items-list">
|
||||
{% for item in itemcategory.items %}
|
||||
<div class="item item-medium
|
||||
{% for group in item.groups %}{{ ' group-' ~ group.id }}{% endfor %}
|
||||
{% for role in item.roles %}{{ ' group-' ~ role }}{% endfor %}"
|
||||
|
||||
data-item-id="{{ item.id }}" style="background-color: {{ item.color ? item.color : "var(--colorbgbodydark)" }};">
|
||||
|
||||
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
<a class="item-link" href="{{ path('app_'~access~'_item_update', {"id": item.id}) }}">
|
||||
{% if item.icon %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:item.icon.label}) }}">
|
||||
{% else %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_pin.png"}) }}">
|
||||
{% endif %}
|
||||
|
||||
<div class="item-title">
|
||||
<h3 >{{ item.title }}</h3>
|
||||
<div class="item-subtitle">{{ item.subtitle|nl2br }}</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="item-action">
|
||||
<a style="display:none"><i class="item-info fas fa-circle-info"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-description hide">{{ item.content|raw }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-filter"></i>
|
||||
Afficher par Rôle
|
||||
</div>
|
||||
<ul id="group-filter" class="list-group list-group-flush">
|
||||
<a class="active list-group-item" id="allrole" style="cursor:pointer">
|
||||
<i class="fa fa-users"></i>
|
||||
Toutes les Rôles
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_ANONYME" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Visiteur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_USER" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Utilisateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_ANIM" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Animateur de Groupe
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_MODO" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Modérateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_ADMIN" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Administrateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-filter"></i>
|
||||
Afficher par Groupe
|
||||
</div>
|
||||
|
||||
<ul id="group-filter" class="list-group list-group-flush">
|
||||
<a class="active list-group-item" style="cursor:pointer" id="allgroup">
|
||||
<i class="fa fa-users"></i>
|
||||
Toutes les Groupes
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
{% for group in groups %}
|
||||
<a class="list-group-item" data-role="{{ group.id }}" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
{{ group.label }}
|
||||
<span class="badge bg-success float-end">{{ group.items|length }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$( function() {
|
||||
var changes = false;
|
||||
|
||||
$("#allrole").children("span").html($('.grid-item').length);
|
||||
$("#allgroup").children("span").html($('.grid-item').length);
|
||||
|
||||
$("a[data-role='ROLE_ANONYME']").children("span").html($('.group-ROLE_ANONYME').length);
|
||||
$("a[data-role='ROLE_USER']").children("span").html($('.group-ROLE_USER').length);
|
||||
$("a[data-role='ROLE_ANIM']").children("span").html($('.group-ROLE_ANIM').length);
|
||||
$("a[data-role='ROLE_MODO']").children("span").html($('.group-ROLE_MODO').length);
|
||||
$("a[data-role='ROLE_ADMIN']").children("span").html($('.group-ROLE_ADMIN').length);
|
||||
|
||||
function updateItems() {
|
||||
// Pour chaque catégorie
|
||||
$('.list-categoryitem').each(function(i) {
|
||||
// On récupère id et order
|
||||
var categoryid = $(this).data('itemcategory-id');
|
||||
$(this).find('input[name="itemcategory[rowOrder][]"]').val(i);
|
||||
|
||||
// Mise à jour en base de l'order
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_'~access~'_itemcategory_order') }}",
|
||||
data: {
|
||||
id:categoryid,
|
||||
order:i
|
||||
}
|
||||
});
|
||||
|
||||
// Pour chaque item de la catégorie
|
||||
$(this).find('.item').each(function(j) {
|
||||
// On récupère les id
|
||||
var itemid = $(this).data('item-id');
|
||||
|
||||
// Mise à jour en base de l'order
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_'~access~'_item_order') }}",
|
||||
data: {
|
||||
id:itemid,
|
||||
categoryid:categoryid,
|
||||
order:j
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$( ".items-list" ).sortable({
|
||||
connectWith: ".items-list",
|
||||
placeholder: "item placeholder",
|
||||
update: updateItems
|
||||
});
|
||||
|
||||
$( ".list-categorysitem" ).sortable({
|
||||
axis: "y",
|
||||
placeholder: "category-list placeholder",
|
||||
update: updateItems
|
||||
});
|
||||
|
||||
$('a.list-group-item').click(function(){
|
||||
$('#group-filter a.list-group-item').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
console.log('.group-'+$(this).attr('data-role'));
|
||||
if($(this).attr('data-role')){
|
||||
$('.item').hide();
|
||||
$('.group-'+$(this).attr('data-role')).show();
|
||||
} else {
|
||||
$('.item').show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
60
templates/Itemcategory/edit.html.twig
Executable file
60
templates/Itemcategory/edit.html.twig
Executable file
@ -0,0 +1,60 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Catégorie d'Item = {{itemcategory.label}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Catégorie d'Item
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_item') }}>Annuler</a>
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('app_'~access~'_itemcategory_delete',{'id':itemcategory.id}) }}
|
||||
class="btn btn-danger float-end"
|
||||
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cette catégorie ?">
|
||||
Supprimer
|
||||
</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.label) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
{% endblock %}
|
Reference in New Issue
Block a user