svg
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit

This commit is contained in:
2023-02-16 17:03:53 +01:00
parent 9554b9cdd3
commit eef04429ee
192 changed files with 9375 additions and 17414 deletions

View File

@ -0,0 +1,103 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ form_start(form) }}
<h1 class="page-header">
{% if mode=="submit" %}
Création blogtype
{% else %}
Modification blogtype
{% endif %}
</h1>
{{ form_widget(form.submit) }}
<a class="btn btn-secondary" href={{ path('app_typeblog') }}>Annuler</a>
{% if mode=="update" and blogtype.id>0 %}
<a href={{ path('app_typeblog_delete',{'id':blogtype.id}) }}
class="btn btn-danger float-end"
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
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.childtype) }}
{{ form_row(form.blog) }}
{{ form_row(form.blogtype) }}
{{ form_row(form.page) }}
{{ form_row(form.pagetype) }}
</div>
</div>
{{ form_end(form) }}
{% endblock %}
{% block localscript %}
<script>
$(document.body).on("change","#menuchild_childtype",function(){
$("#menuchild_blog").empty();
$("#menuchild_blogtype").empty();
$("#menuchild_page").empty();
$("#menuchild_pagetype").empty();
showhide();
});
function showhide() {
$("#groupfield_menuchild_blog").hide();
$("#groupfield_menuchild_blogtype").hide();
$("#groupfield_menuchild_page").hide();
$("#groupfield_menuchild_pagetype").hide();
switch ($("#menuchild_childtype").val()) {
case 'blog':
$("#groupfield_menuchild_blog").show();
break;
case 'blogtype':
$("#groupfield_menuchild_blogtype").show();
break;
case 'page':
$("#groupfield_menuchild_page").show();
break;
case 'pagetype':
$("#groupfield_menuchild_pagetype").show();
break;
}
}
showhide();
</script>
{% endblock %}

View File

@ -0,0 +1,62 @@
{% extends "base.html.twig" %}
{% block body %}
<h1 class="page-header">
menus
</h1>
{% for menu in menus %}
<div class="card mb-3">
<div class="card-header">
{{menu.name}}
<a class="btn float-end" href="{{ path('app_menu_submit',{id:menu.id}) }}" title='Ajouter une entrée au menu'><i class="fas fa-plus"></i></a>
</div>
<ul class="list-menu list-group list-group-flush">
{% for menuchild in menu.menuchilds %}
<div class="item-menu list-group-item d-flex" data-id={{menuchild.id}}>
<i class="fa fa-arrows-up-down fa-2x fa-fw me-1"></i>
<div class="me-auto">
{% if menuchild.childtype == "blog" %}
{{menuchild.blog.name}}
{% elseif menuchild.childtype == "blogtype" %}
{{menuchild.blogtype.name}}
{% elseif menuchild.childtype == "page" %}
{{menuchild.page.name}}
{% elseif menuchild.childtype == "pagetype" %}
{{menuchild.pagetype.name}}
{% endif %}
<br><small>{{menuchild.childtype}}</small>
</div>
<a href="{{ path('app_menu_delete', { id: menuchild.id }) }}" class="ms-3">
<i class="fas fa-trash fa-2x"></i>
</a>
</div>
{% endfor %}
</ul>
</div>
{% endfor %}
{% endblock %}
{% block localscript %}
<script>
function updateOrder() {
$('.item-menu').each(function(i) {
var id = $(this).data('id');
url="{{ path('app_menu_order',{id:'xxx',order:'yyy'}) }}";
url=url.replace('xxx',id);
url=url.replace('yyy',i);
// Mise à jour en base de l'order
$.ajax({
method: "POST",
url: url,
});
});
}
$( ".list-menu" ).sortable({
axis: "y",
update: updateOrder
});
</script>
{% endblock %}