first commit symfony 6
This commit is contained in:
94
templates/Config/edit.html.twig
Executable file
94
templates/Config/edit.html.twig
Executable 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_admin_config') }}>Annuler</a>
|
||||
|
||||
{% if mode=="update" and not config.required %}
|
||||
<a href="{{ path('app_admin_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 btn-modal" style="width:90px" data-modalid="mymodallarge" data-modaltitle="Logo" data-modalurl="{{ path('app_admin_config_logo') }}" title='Ajouter un Logo'>Modifier</a>
|
||||
</div>
|
||||
{% elseif config.type=="header" %}
|
||||
<div style="margin:10px auto;">
|
||||
<img id="config_value_img" src="{{ appAlias }}uploads/header/{{ config.value }}" style="width:100%;margin:auto;display:block;">
|
||||
<a class="btn btn-info btn-modal" style="width:100%" data-modalid="mymodallarge" data-modaltitle="Bannière" data-modalurl="{{ path('app_user_crop01', {"type": "header", "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 btn-modal" style="width:100%" data-modalid="mymodallarge" data-modaltitle="Image" data-modalurl="{{ path('app_user_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);
|
||||
});
|
||||
$('#mymodallarge').on('hidden.bs.modal', function () {
|
||||
var imgSrc = $("#config_value_img").attr('src');
|
||||
$("#config_value_img").attr('src',imgSrc);
|
||||
});
|
||||
{% endblock %}
|
66
templates/Config/list.html.twig
Normal file
66
templates/Config/list.html.twig
Normal file
@ -0,0 +1,66 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">
|
||||
CONFIGURATIONS
|
||||
</h1>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 mt-4">
|
||||
<h3>Générale</h3>
|
||||
{{ render(path("app_admin_config_render",{category:"site"})) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mt-4">
|
||||
<h3>Couleurs des fonds de page</h3>
|
||||
{{ render(path("app_admin_config_render",{category:"colorbgbody"})) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mt-4">
|
||||
<h3>Polices</h3>
|
||||
{{ render(path("app_admin_config_render",{category:"font"})) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mt-4">
|
||||
<h3>Couleurs des titres </h3>
|
||||
{{ render(path("app_admin_config_render",{category:"colorfttitle"})) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mt-4">
|
||||
<h3>Couleurs de la police </h3>
|
||||
{{ render(path("app_admin_config_render",{category:"colorftbody"})) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mt-4">
|
||||
<h3>Logo</h3>
|
||||
{{ render(path("app_admin_config_render",{category:"logo"})) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mt-4">
|
||||
<h3>Bannière</h3>
|
||||
{{ render(path("app_admin_config_render",{category:"header"})) }}
|
||||
</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 %}
|
35
templates/Config/logo.html.twig
Normal file
35
templates/Config/logo.html.twig
Normal file
@ -0,0 +1,35 @@
|
||||
{% extends "base.html.twig" %}
|
||||
|
||||
{% block encoretags %}
|
||||
{{ encore_entry_link_tags('dropzone') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<a class="btn btn-secondary" 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 localscript %}
|
||||
{{ encore_entry_script_tags('dropzone') }}
|
||||
|
||||
<script>
|
||||
function dropzonesuccess( file, response ) {
|
||||
parent.$("#config_value").val(response["file"]);
|
||||
parent.$("#config_value_img").attr("src","{{ appAlias }}uploads/logo/"+response["file"]);
|
||||
closeModal();
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
window.parent.$("#mymodallarge").modal('hide');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
85
templates/Config/render.html.twig
Normal file
85
templates/Config/render.html.twig
Normal file
@ -0,0 +1,85 @@
|
||||
<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_admin_config_update",{id:config.id})}}"><i class="fa fa-file"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% if not config.required %}
|
||||
<a href="{{path("app_admin_config_delete",{id:config.id})}}"><i class="fa fa-trash"></i></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td width="50%">{{config.title}}</td>
|
||||
|
||||
{% set val = config.value %}
|
||||
{% if val is empty %}
|
||||
{% set val=app.session.get(config.id) %}
|
||||
{% endif %}
|
||||
|
||||
{% set color = "" %}
|
||||
{% set bgcolor = "" %}
|
||||
{% set otherstyle = "" %}
|
||||
{% if config.id=='colorbgbodydark' %}
|
||||
{% set bgcolor = val %}
|
||||
{% set color = app.session.get('colorftbodydark') %}
|
||||
{% elseif config.id=='colorbgbodylight' %}
|
||||
{% set bgcolor = val %}
|
||||
{% set color = app.session.get('colorftbodylight') %}
|
||||
{% elseif config.id=='colorfttitledark' %}
|
||||
{% set bgcolor = app.session.get('colorbgbodydark') %}
|
||||
{% set color = val %}
|
||||
{% elseif config.id=='colorfttitlelight' %}
|
||||
{% set bgcolor = app.session.get('colorbgbodylight') %}
|
||||
{% set color = val %}
|
||||
{% elseif config.id=='colorftbodydark' %}
|
||||
{% set bgcolor = app.session.get('colorbgbodydark') %}
|
||||
{% set color = val %}
|
||||
{% elseif config.id=='colorftbodylight' %}
|
||||
{% set bgcolor = app.session.get('colorbgbodylight') %}
|
||||
{% set color = val %}
|
||||
{% elseif config.id=='fonttitle' %}
|
||||
{% set color = app.session.get('colorfttitlelight') %}
|
||||
{% set otherstyle = "font-family: "~val~";" %}
|
||||
{% 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;" %}
|
||||
{% endif %}
|
||||
|
||||
<td style="overflow-wrap: anywhere; background-color: {{ bgcolor }}; color: {{color}}; {{otherstyle}}" >
|
||||
|
||||
|
||||
{% if config.type=="boolean" %}
|
||||
{% if val=="0" %} Non
|
||||
{% elseif val=="1" %} Oui
|
||||
{%endif%}
|
||||
{% elseif config.type=="logo" %}
|
||||
{%if not val is empty %}
|
||||
<img src="{{appAlias}}uploads/logo/{{ val }}" height=50px>
|
||||
{% endif %}
|
||||
{% elseif config.type=="header" %}
|
||||
{%if not val is empty %}
|
||||
<img src="{{appAlias}}uploads/header/{{ val }}" width="100%">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ val|raw }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
Reference in New Issue
Block a user