mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-09 17:02:46 +02:00
handle missing elements in scripts, simplify stats page
This commit is contained in:
parent
1e30f360a1
commit
344e71d38f
9 changed files with 247 additions and 47 deletions
|
@ -13,9 +13,13 @@
|
|||
<!-- JavaScript Bootstrap avec Popper.js -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<link rel="icon" type="image/png" href="{{ asset('logo-osm.png') }}">
|
||||
<!-- Script pour le tri automatique des tableaux -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.0/Sortable.min.js"></script>
|
||||
{# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
|
||||
{% block stylesheets %}
|
||||
{{ encore_entry_link_tags('app') }}
|
||||
|
||||
<link href='https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.css' rel='stylesheet' />
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
|
@ -91,7 +95,7 @@
|
|||
|
||||
{% block javascripts %}
|
||||
{{ encore_entry_script_tags('app') }}
|
||||
<script src="{{ asset('js/main.js') }}"></script>
|
||||
{# <script src="{{ asset('js/main.js') }}"></script> #}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js" integrity="sha512-CNgIRecGo7nphbeZ04Sc13ka07paqdeTu0WR1IM4kNcpmBAUSHSQX0FslNhTDadL4O5SAGapGt4FodqL8My0mA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script>
|
||||
new QRCode(document.getElementById('qrcode'), {
|
||||
|
@ -102,6 +106,26 @@
|
|||
colorLight : '#ffffff',
|
||||
correctLevel : QRCode.CorrectLevel.H
|
||||
});
|
||||
|
||||
|
||||
// Tri automatique des tableaux
|
||||
// Sélectionner la première table du document
|
||||
if( Sortable) {
|
||||
const firstTable = document.querySelector('table');
|
||||
if (firstTable) {
|
||||
console.log('première table trouvée', firstTable);
|
||||
var sortable = new Sortable(firstTable, {
|
||||
animation: 150,
|
||||
ghostClass: 'sortable-ghost',
|
||||
chosenClass: 'sortable-chosen',
|
||||
dragClass: 'sortable-drag'
|
||||
});
|
||||
} else {
|
||||
console.log('pas de table trouvée');
|
||||
}
|
||||
}else{
|
||||
console.log('Sortable non trouvé');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue