This commit is contained in:
2024-11-26 20:42:13 +01:00
parent 60d8b8bd1d
commit 855570b685
27 changed files with 1590 additions and 108 deletions

View File

@ -0,0 +1,30 @@
{% 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 ms-1">Annuler</a>
<div class="card mt-3">
<div class="card-header">Information</div>
<div class="card-body">
{{ form_widget(form) }}
</div>
</div>
{{ form_end(form) }}
{% endblock %}
{% block localscript %}
<script type="module">
import $ from 'jquery';
$(document).ready(function() {
$("#user_username").focus();
});
</script>
{% endblock %}

View File

@ -4,5 +4,53 @@
{% block body %}
<h1>{{title}}</h1>
<a href="{{ path(routesubmit) }}" class="btn btn-primary">Ajouter</a>
<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="70px" class="no-sort">Action</th>
<th width="70px" class="no-sort">Avatar</th>
<th>Login</th>
<th>Rôles</th>
<th>Compagnies</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td><a href="{{ path(routeupdate,{id:user.id}) }}"><i class="fas fa-file fa-2x"></i></a></td>
<td><img class="avatar" src="{{ asset(user.avatar)}}"></td>
<td>{{user.username}}</td>
<td>
{% for role in user.roles %}
{{role}}<br>
{% endfor %}
</td>
<td>
{% for company in user.companys %}
{{company.title}}<br>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
{% block localscript %}
<script type="module">
import $ from 'jquery';
$(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 %}