init
This commit is contained in:
101
templates/Category/edit.html.twig
Executable file
101
templates/Category/edit.html.twig
Executable file
@ -0,0 +1,101 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification CATEGORIE
|
||||
{% elseif mode=="submit" %}
|
||||
Création CATEGORIE
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
|
||||
<a class="btn btn-secondary" href={{ path('app_category') }}>Annuler</a>
|
||||
|
||||
{% if mode=="update" and category.id >= 0 %}
|
||||
<a href="{{ path('app_category_delete',{'id':category.id}) }}"
|
||||
class="btn btn-danger float-right"
|
||||
data-method="delete"
|
||||
data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?">
|
||||
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-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.order) }}
|
||||
{{ form_row(form.name) }}
|
||||
|
||||
{{ form_row(form.usecategoryconfig) }}
|
||||
<div id="blockconfig">
|
||||
{{ form_row(form.appthumbwidth) }}
|
||||
{{ form_row(form.appthumbheight) }}
|
||||
{{ form_row(form.appthumbfilter) }}
|
||||
<div id="blockfilter">
|
||||
{{ form_row(form.appthumbfiltergrayscale) }}
|
||||
{{ form_row(form.appthumbfilteropacity) }}
|
||||
{{ form_row(form.appthumbfiltersepia) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
function showhide() {
|
||||
if($("#category_usecategoryconfig").val()==0) {
|
||||
$("#blockconfig").hide();
|
||||
}
|
||||
else {
|
||||
$("#blockconfig").show();
|
||||
|
||||
if($("#category_appthumbfilter").val()==0) {
|
||||
$("#blockfilter").hide();
|
||||
}
|
||||
else {
|
||||
$("#blockfilter").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$( "#category_usecategoryconfig" ).change(function() {
|
||||
showhide();
|
||||
});
|
||||
|
||||
$( "#category_appthumbfilter" ).change(function() {
|
||||
showhide();
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
showhide();
|
||||
$("#category_order").focus();
|
||||
});
|
||||
{% endblock %}
|
54
templates/Category/list.html.twig
Normal file
54
templates/Category/list.html.twig
Normal file
@ -0,0 +1,54 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">
|
||||
CATEGORIES
|
||||
</h1>
|
||||
|
||||
<p><a class="btn btn-success" href={{ path('app_category_submit') }}>Ajouter</a></p>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des Catégories
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="dataTable_wrapper">
|
||||
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="70px" class="no-sort">Action</th>
|
||||
<th width="70px">Ordre</th>
|
||||
<th>Nom</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for category in categorys %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{path("app_category_update",{id:category.id})}}"><i class="fa fa-file"></i></a>
|
||||
{% if category.id >=0 %}
|
||||
<a href="{{path("app_category_delete",{id:category.id})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{category.order}}</td>
|
||||
<td>{{category.name}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
$('#dataTables').DataTable({
|
||||
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
|
||||
responsive: true,
|
||||
iDisplayLength: 100,
|
||||
order: [[ 1, "asc" ]]
|
||||
});
|
||||
});
|
||||
{% endblock %}
|
Reference in New Issue
Block a user