167 lines
6.4 KiB
Twig
167 lines
6.4 KiB
Twig
{% extends '@CadolesCore/base.html.twig' %}
|
|
|
|
{% block pagewrapper %}
|
|
{{ form_start(form) }}
|
|
<h1 class="page-header">
|
|
{% if mode=="update" or mode=="updatetemplate" %}
|
|
Modification Widget
|
|
{% elseif mode=="submit" or mode=="submittemplate" %}
|
|
Création Widget
|
|
{% endif %}
|
|
</h1>
|
|
|
|
<p>
|
|
{{ form_widget(form.submit) }}
|
|
|
|
{% if access=="config" %}
|
|
{% if mode=="update" %}
|
|
<a class="btn btn-default" href="{{ path('cadoles_portal_config_page_view',{id:idpage}) }}">Annuler</a>
|
|
{% else %}
|
|
<a class="btn btn-default" href="{{ path('cadoles_portal_config_pagetemplate_view',{id:idpage}) }}">Annuler</a>
|
|
{% endif %}
|
|
{% else %}
|
|
{% if mode=="update" %}
|
|
<a class="btn btn-default" href="{{ path('cadoles_portal_user_page_view',{id:idpage,usage:usage,group:group}) }}">Annuler</a>
|
|
{% else %}
|
|
<a class="btn btn-default" href="{{ path('cadoles_core_home',{id:idpage}) }}">Annuler</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
|
|
</p>
|
|
|
|
{% 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="row" style="margin:0px 0px 15px 0px">
|
|
<div id="col1" class="col-xs-8">
|
|
{{ form_row(form.name) }}
|
|
</div>
|
|
|
|
<div class="col-xs-4">
|
|
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: #{{ color["main"] }};">
|
|
{% if entity.icon %}
|
|
<img src="/{{ alias }}/{{ entity.icon.label }}" height="100" />
|
|
{% endif %}
|
|
</div>
|
|
<div class="col-md-12" style="text-align:center;padding:0px">
|
|
{{ form_row(form.idicon) }}
|
|
<a class="btn btn-success" data-toggle="modal" data-target="#selicon" title='Ajouter' style="width:100%">Selectionner une Icône</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="col2" class="col-xs-4">
|
|
{{ form_row(form.height) }}
|
|
{{ form_row(form.autoajust) }}
|
|
{{ form_row(form.border) }}
|
|
{{ form_row(form.opened) }}
|
|
</div>
|
|
|
|
<div id="col3" class="col-xs-4">
|
|
{{ form_row(form.colorheaderback) }}
|
|
{{ form_row(form.colorheaderfont) }}
|
|
{{ form_row(form.colorbodyback) }}
|
|
{{ form_row(form.colorbodyfont) }}
|
|
</div>
|
|
|
|
<div id="col4" class="col-xs-4">
|
|
|
|
</div>
|
|
|
|
<div id="col5" class="col-md-12" style="clear:both">
|
|
{{ form_widget(form) }}
|
|
</div>
|
|
|
|
<div id="selicon" class="modal fade bs-item-modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h4 class="modal-title">SELECTIONNER UNE ICONE</h4>
|
|
</div>
|
|
|
|
<div class="modal-body" style="height: 480px; overflow-y: scroll;">
|
|
<div class="form-group row clearfix">
|
|
<div class="col-md-12" style="margin-bottom:15px">
|
|
<a onclick="$('#selicon').modal('hide');" class="btn btn-default">Annuler</a>
|
|
{% if access=="user" %}
|
|
<a href="{{ path('cadoles_portal_user_icon') }}" target="_parent" class="btn btn-default">Gérer mes Icônes</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
{% if iconsuser is not empty %}
|
|
<h3>Mes Icônes</h3>
|
|
{% for icon in iconsuser %}
|
|
<a style="cursor:pointer" onClick="selIcon({{ icon.id }})">
|
|
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
|
|
</a>
|
|
{% endfor %}
|
|
|
|
<h3>Icônes Communs</h3>
|
|
{% endif %}
|
|
|
|
{% for icon in icons %}
|
|
<a href="#" onClick="selIcon({{ icon.id }})">
|
|
<img id="icon-{{ icon.id }}" class="grid-item-img" height="40" src="/{{ alias }}/{{ icon.label }}" style="padding:2px; margin-bottom:2px; background-color: #{{ color["main"]}}">
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{ form_end(form) }}
|
|
{% endblock %}
|
|
|
|
{% block localjavascript %}
|
|
|
|
$(document).ready(function() {
|
|
$(".control-label").each(function( element ) {
|
|
var loc = $(this).attr('loc');
|
|
if (typeof loc !== typeof undefined && loc !== false) {
|
|
$(this).parent().appendTo("#"+loc);
|
|
}
|
|
});
|
|
|
|
$("#col2").children(".form-group").each(function( element ) {
|
|
$(this).css("zoom","80%");
|
|
});
|
|
|
|
$("#col3").children(".form-group").each(function( element ) {
|
|
$(this).css("zoom","80%");
|
|
});
|
|
|
|
$("#col4").children(".form-group").each(function( element ) {
|
|
$(this).css("zoom","80%");
|
|
});
|
|
});
|
|
|
|
function selIcon(idicon) {
|
|
$("#pagewidget_idicon").val(idicon);
|
|
$("#diviconsel img").remove();
|
|
|
|
$("#icon-"+idicon).clone().appendTo($("#diviconsel"));
|
|
$("#diviconsel img").attr("height","100px");
|
|
$('#selicon').modal('hide');
|
|
}
|
|
|
|
{% endblock %} |