dockerisation
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_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="{{ asset("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('mymodallarge','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="{{ asset("uploads/hero/"~config.value) }}" style="width:100%;margin:auto;display:block;">
|
||||
<a class="btn btn-info" style="width:100%" onClick="ModalLoad('mymodallarge','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="{{ asset("uploads/hero/"~config.value) }}" style="width:100%;margin:auto;display:block;">
|
||||
<a class="btn btn-info" style="width:100%" onClick="ModalLoad('mymodallarge','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!="{{ asset("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 %}
|
60
templates/Config/list.html.twig
Normal file
60
templates/Config/list.html.twig
Normal file
@ -0,0 +1,60 @@
|
||||
{% 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"})) }}
|
||||
</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 %}
|
40
templates/Config/logo.html.twig
Normal file
40
templates/Config/logo.html.twig
Normal file
@ -0,0 +1,40 @@
|
||||
{% 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","{{ asset("uploads/logo/") }}"+response["file"]);
|
||||
closeModal();
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
window.parent.$("#mymodallarge").modal('hide');
|
||||
}
|
||||
{% endblock %}
|
81
templates/Config/render.html.twig
Normal file
81
templates/Config/render.html.twig
Normal file
@ -0,0 +1,81 @@
|
||||
<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 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="{{ asset("uploads/logo/"~val) }}" height=50px>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ val|raw }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
Reference in New Issue
Block a user