139 lines
5.0 KiB
Twig
Executable File
139 lines
5.0 KiB
Twig
Executable File
{% extends '@CadolesCore/base.html.twig' %}
|
|
|
|
{% block pagewrapper %}
|
|
{{ form_start(form) }}
|
|
<h1 class="page-header">
|
|
{% if mode=="update" %}
|
|
Modification Item
|
|
{% elseif mode=="submit" %}
|
|
Création Item
|
|
{% endif %}
|
|
</h1>
|
|
|
|
{{ form_widget(form.submit) }}
|
|
<a class="btn btn-default" href={{ path('cadoles_portal_config_item') }}>Annuler</a>
|
|
|
|
{% if mode=="update" %}
|
|
<a href={{ path('cadoles_portal_config_item_delete',{'id':item.id}) }}
|
|
class="btn btn-danger pull-right"
|
|
data-method="delete" data-csrf="_token:{{ 'csrf' }}"
|
|
data-confirm="Êtes-vous sûr de vouloir supprimer cet item ?">
|
|
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="row clearfix">
|
|
<div class="col-md-8">
|
|
{{ form_row(form.title) }}
|
|
{{ form_row(form.subtitle) }}
|
|
{{ form_row(form.essential) }}
|
|
{{ form_row(form.content) }}
|
|
</div>
|
|
|
|
|
|
<div class="col-md-4">
|
|
{{ form_row(form.url) }}
|
|
<em>le mot clé #login# sera remplacé par le login de l'utilisateur</em><br><br>
|
|
{{ form_row(form.target) }}
|
|
<div id="divhelp"><em>Attention certains sites n'acceptent pas d'être encapsulés dans une frame. Si vous ne voyez pas votre site apparaître, veuillez changer de cible.<br><br></em></div>
|
|
{{ form_row(form.itemcategory) }}
|
|
{{ form_row(form.roles) }}
|
|
{{ form_row(form.niveau01s) }}
|
|
{{ form_row(form.groups) }}
|
|
{{ form_row(form.color) }}
|
|
|
|
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: {{ item.color ? "#"~item.color : '#'~color['main'] }};">
|
|
{% if item.icon %}
|
|
<img src="/{{ alias }}/{{ item.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>
|
|
<a class="btn btn-danger" onClick="delIcon()" title='Détacher' style="width:100%">Détacher l'Icône</a>
|
|
</div>
|
|
</div>
|
|
</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">
|
|
<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>
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
{% 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(){
|
|
showhide();
|
|
});
|
|
|
|
$( "#item_target" ).change(function() {
|
|
showhide();
|
|
});
|
|
|
|
function selIcon(idicon) {
|
|
$("#item_idicon").val(idicon);
|
|
$("#diviconsel img").remove();
|
|
|
|
$("#icon-"+idicon).clone().appendTo($("#diviconsel"));
|
|
$("#diviconsel img").attr("height","100px");
|
|
$('#selicon').modal('hide');
|
|
}
|
|
|
|
function delIcon() {
|
|
$("#diviconsel img").remove();
|
|
$("#item_idicon").val(null);
|
|
}
|
|
|
|
function showhide() {
|
|
$("#divhelp").hide();
|
|
if($("#item_target").val()=="frame") {
|
|
$("#divhelp").show();
|
|
}
|
|
}
|
|
{% endblock %}
|