This commit is contained in:
2024-09-17 14:02:17 +02:00
commit 111fac9a42
2886 changed files with 189561 additions and 0 deletions

94
templates/Config/edit.html.twig Executable file
View File

@ -0,0 +1,94 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ form_start(form) }}
<h1 class="page-header">
{% if mode=="update" %}
Modification CONFIGURATION
{% elseif mode=="submit" %}
Création CONFIGURATION
{% endif %}
</h1>
{{ form_widget(form.submit) }}
<a class="btn btn-secondary" href={{ path('app_config') }}>Annuler</a>
{% if mode=="update" and not config.required %}
<a href="{{ path('app_config_delete',{'id':config.id}) }}"
class="btn btn-danger float-right"
data-method="delete"
data-confirm="Êtes-vous sûr de vouloir supprimer cet entregistrement ?">
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.id) }}
{{ form_row(form.value) }}
{% if config.type=="logo" %}
<div style="width:90px; margin:10px auto;">
{% set color = "" %}
{% if config.id=='logodark' %}
{% set color = app.session.get('colorbgbodydark') %}
{% elseif config.id=='logolight' %}
{% set color = app.session.get('colorbgbodylight') %}
{% endif %}
<img id="config_value_img" src="/{{ appAlias }}/uploads/logo/{{ config.value }}" style="background-color: {{color}}; width:90px;height:90px; margin:auto;display:block;">
<a class="btn btn-info" style="width:90px" onClick="ModalLoad('extraLargeModal','Logo','{{ path('app_config_logo') }}');" title='Ajouter un Logo'>Modifier</a>
</div>
{% elseif config.type=="hero" %}
<div style="margin:10px auto;">
<img id="config_value_img" src="/{{ appAlias }}/uploads/hero/{{ config.value }}" style="width:100%;margin:auto;display:block;">
<a class="btn btn-info" style="width:100%" onClick="ModalLoad('extraLargeModal','Carrousel','{{ path('app_crop01', {"type": "hero", "reportinput": "config_value" }) }}');" title='Ajouter une Bannière'>Modifier</a>
</div>
{% elseif config.type=="image" %}
<div style="margin:10px auto;">
<img id="config_value_img" src="/{{ appAlias }}/uploads/hero/{{ config.value }}" style="width:100%;margin:auto;display:block;">
<a class="btn btn-info" style="width:100%" onClick="ModalLoad('extraLargeModal','Image','{{ path('app_crop01', {"type": "image", "reportinput": "config_value" }) }}');" title='Ajouter une Image'>Modifier</a>
</div>
{% endif %}
{{ form_row(form.help) }}
</div>
</div>
{{ form_end(form) }}
{% endblock %}
{% block localjavascript %}
$("#config_value_img").on('error', function(){
var imgSrc = $(this).attr('src');
if(imgSrc!="/{{appAlias}}/uploads/{{config.type}}/")
$(this).attr('src',imgSrc);
});
$('#extraLargeModal').on('hidden.bs.modal', function () {
var imgSrc = $("#config_value_img").attr('src');
$("#config_value_img").attr('src',imgSrc);
});
{% endblock %}

View File

@ -0,0 +1,71 @@
{% extends "base.html.twig" %}
{% block body %}
<h1 class="page-header">
CONFIGURATIONS
</h1>
<div class="row mt-4">
<div class="col-md-12">
<h3>Générale</h3>
{{ render(path("app_config_render",{category:"site"})) }}
</div>
<div class="col-md-6">
<h3>Couleurs des fonds de page</h3>
{{ render(path("app_config_render",{category:"colorbgbody"})) }}
</div>
<div class="col-md-6">
<h3>Polices</h3>
{{ render(path("app_config_render",{category:"font"})) }}
</div>
<div class="col-md-6">
<h3>Couleurs des titres </h3>
{{ render(path("app_config_render",{category:"colorfttitle"})) }}
</div>
<div class="col-md-6">
<h3>Couleurs de la police </h3>
{{ render(path("app_config_render",{category:"colorftbody"})) }}
</div>
<div class="col-md-6">
<h3>Logo</h3>
{{ render(path("app_config_render",{category:"logo"})) }}
<h3>Social</h3>
{{ render(path("app_config_render",{category:"social"})) }}
</div>
<div class="col-md-6">
<h3>Carrousel</h3>
{{ render(path("app_config_render",{category:"hero"})) }}
<h3>Image</h3>
{{ render(path("app_config_render",{category:"image"})) }}
</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 %}

View File

@ -0,0 +1,42 @@
{% extends "base.html.twig" %}
{% block encorelinktags %}
{{ encore_entry_link_tags('dropzone') }}
{% endblock encorelinktags %}
{% block body %}
<h3 class="page-header">Téléchargez votre Logo</h3>
<a class="btn btn-default" onClick="closeModal();">Annuler</a>
<form
action="{{ oneup_uploader_endpoint('logo') }}"
class="dropzone"
id="mydropzone"
data-acceptedMimeTypes="image/*"
data-maxFiles=1
style="margin-top:10px">
</form>
{% endblock %}
{% block encorescripttags %}
{{ encore_entry_script_tags('dropzone') }}
{% endblock %}
{% block localjavascript %}
function dropzoneinit( elt ) {
}
function dropzonesuccess( file, response ) {
parent.$("#config_value").val(response["file"]);
parent.$("#config_value_img").attr("src","/{{ appAlias }}/uploads/logo/"+response["file"]);
}
function dropzonequeuecomplete(file) {
closeModal();
}
function closeModal() {
window.parent.$("#extraLargeModal").modal('hide');
}
{% endblock %}

View File

@ -0,0 +1,92 @@
<table class="table table-striped table-bordered table-hover" id="" style="width:100%">
<tbody>
{% for config in configs|sort((a, b) => a.order <=> b.order) %}
{% set continue = true %}
{% if not config.grouped is empty %}
{% if app.session.get(config.grouped)==0 %}
{% set continue = false %}
{% endif %}
{% endif %}
{%if continue %}
<tr>
<td width="70px">
{% if config.changeable %}
<a href="{{path("app_config_update",{id:config.id})}}"><i class="fa fa-file"></i></a>
{% endif %}
{% if not config.required %}
<a href="{{path("app_config_delete",{id:config.id})}}"><i class="fa fa-trash"></i></a>
{% endif %}
</td>
<td width="50%">{{config.title}}</td>
{% set color = "" %}
{% set bgcolor = "" %}
{% set otherstyle = "" %}
{% if config.id=='colorbgbodydark' %}
{% set bgcolor = config.value %}
{% set color = app.session.get('colorfttitledark') %}
{% elseif config.id=='colorbgbodylight' %}
{% set bgcolor = config.value %}
{% set color = app.session.get('colorfttitlelight') %}
{% elseif config.id=='colorfttitledark' %}
{% set bgcolor = app.session.get('colorbgbodydark') %}
{% set color = config.value %}
{% elseif config.id=='colorfttitlelight' %}
{% set bgcolor = app.session.get('colorbgbodylight') %}
{% set color = config.value %}
{% elseif config.id=='colorftbodydark' %}
{% set bgcolor = app.session.get('colorbgbodydark') %}
{% set color = config.value %}
{% elseif config.id=='colorftbodylight' %}
{% set bgcolor = app.session.get('colorbgbodylight') %}
{% set color = config.value %}
{% elseif config.id=='logodark' %}
{% set bgcolor = app.session.get('colorbgbodydark') %}
{% set otherstyle = "text-align: center;" %}
{% elseif config.id=='logolight' %}
{% set bgcolor = app.session.get('colorbgbodylight') %}
{% set otherstyle = "text-align: center;" %}
{% elseif config.type=='hero' %}
{% set otherstyle = "text-align: center;" %}
{% elseif config.type=='image' %}
{% set otherstyle = "text-align: center;" %}
{% endif %}
<td style="overflow-wrap: anywhere; background-color: {{ bgcolor }}; color: {{color}}; {{otherstyle}}" >
{% if config.type=="thumbwidth" %}
{% if config.value=="0" %} Variable
{% elseif config.value=="1" %} 10%
{% elseif config.value=="2" %} 20%
{%endif%}
{% elseif config.type=="thumbheight" %}
{% if config.value=="0" %} Carrée
{% elseif config.value=="1" %} Proportionnelle
{%endif%}
{% elseif config.type=="boolean" %}
{% if config.value=="0" %} Non
{% elseif config.value=="1" %} Oui
{%endif%}
{% elseif config.type=="logo" %}
{%if not config.value is empty %}
<img src="/{{appAlias}}/uploads/logo/{{ config.value }}" height=50px>
{% endif %}
{% elseif config.type=="hero" %}
{%if not config.value is empty %}
<img src="/{{appAlias}}/uploads/hero/{{ config.value }}" style="max-width:100%">
{% endif %}
{% elseif config.type=="image" %}
{%if not config.value is empty %}
<img src="/{{appAlias}}/uploads/image/{{ config.value }}" style="max-width:100%">
{% endif %}
{% else %}
{{ config.value|raw }}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>