v0 ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
This commit is contained in:
143
templates/Item/edit.html.twig
Executable file
143
templates/Item/edit.html.twig
Executable file
@ -0,0 +1,143 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Item = {{item.title}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Item
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_'~access~'_item') }}>Annuler</a>
|
||||
|
||||
{% if mode=="update" %}
|
||||
<a href={{ path('app_'~access~'_item_delete',{'id':item.id}) }}
|
||||
class="btn btn-danger float-end"
|
||||
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">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.title) }}
|
||||
{{ form_row(form.subtitle) }}
|
||||
{{ form_row(form.url) }}
|
||||
<div><em>le mot clé #login# sera remplacé par le login de l'utilisateur</em></div>
|
||||
{{ 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.</em></div>
|
||||
|
||||
{{ form_row(form.essential) }}
|
||||
{{ form_row(form.protected) }}
|
||||
{{ form_row(form.content) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-link fa-fw"></i> Affectations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.itemcategory) }}
|
||||
{{ form_row(form.roles) }}
|
||||
{{ form_row(form.groups) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-glasses fa-fw"></i> Appararence
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.color) }}
|
||||
|
||||
|
||||
<div id="diviconsel" class="col-md-12 text-center mb-1 mt-1" style="height:140px; padding:20px; background-color: {{ item.color ? item.color : 'var(--colorbgbodydark)' }};">
|
||||
{% if item.icon %}
|
||||
<img src="{{ path('app_minio_image',{file: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 btn-modal" data-modalid="mymodallarge" data-modaltitle="Icône" data-modalurl="{{ path('app_all_icon_select') }}" title='Selectionner un Icône'>Selectionner un Icône</a>
|
||||
<a class="btn btn-danger" onClick="delIcon()" title='Détacher'>Détacher l'Icône</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$('document').ready(function(){
|
||||
showhide();
|
||||
});
|
||||
|
||||
$("#item_color").bind("change paste keyup", function() {
|
||||
$("#diviconsel").css("background-color",$(this).val());
|
||||
});
|
||||
|
||||
|
||||
|
||||
function selIcon(idicon,url) {
|
||||
$("#item_idicon").val(idicon);
|
||||
$("#diviconsel img").remove();
|
||||
|
||||
$("#diviconsel").append("<img src='"+url+"'>");
|
||||
$("#diviconsel img").attr("height","100px");
|
||||
$("#mymodallarge").modal("hide");
|
||||
}
|
||||
|
||||
function delIcon() {
|
||||
$("#diviconsel img").remove();
|
||||
$("#item_idicon").val(null);
|
||||
}
|
||||
|
||||
function showhide() {
|
||||
$("#divhelp").hide();
|
||||
if($("#item_target").val()=="frame") {
|
||||
$("#divhelp").show();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
223
templates/Item/list.html.twig
Normal file
223
templates/Item/list.html.twig
Normal file
@ -0,0 +1,223 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">
|
||||
Gestion des Items
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<a href="{{ path('app_'~access~'_item_submit') }}" class="btn btn-success">Ajouter un Item</a>
|
||||
<a href="{{ path('app_'~access~'_itemcategory_submit') }}" class="btn btn-success">Ajouter une Categorie</a>
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 list-categorysitem">
|
||||
{% for itemcategory in itemcategorys %}
|
||||
<div class="card list-categoryitem mb-3" data-itemcategory-id="{{ itemcategory.id }}">
|
||||
<div class="card-header">
|
||||
<h3 class="m-0">
|
||||
<a href="{{ path('app_'~access~'_itemcategory_update', { id: itemcategory.id }) }}">
|
||||
<small><i class="fa fa-arrows-v" style="display: inline-block; margin-top: -26px;"></i></small>
|
||||
{{ itemcategory.label }}
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="card-body items-list">
|
||||
{% for item in itemcategory.items %}
|
||||
<div class="item item-medium
|
||||
{% for group in item.groups %}{{ ' group-' ~ group.id }}{% endfor %}
|
||||
{% for role in item.roles %}{{ ' group-' ~ role }}{% endfor %}"
|
||||
|
||||
data-item-id="{{ item.id }}" style="background-color: {{ item.color ? item.color : "var(--colorbgbodydark)" }};">
|
||||
|
||||
|
||||
<div class="item-container">
|
||||
<div class="item-content">
|
||||
<a class="item-link" href="{{ path('app_'~access~'_item_update', {"id": item.id}) }}">
|
||||
{% if item.icon %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:item.icon.label}) }}">
|
||||
{% else %}
|
||||
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_pin.png"}) }}">
|
||||
{% endif %}
|
||||
|
||||
<div class="item-title">
|
||||
<h3 >{{ item.title }}</h3>
|
||||
<div class="item-subtitle">{{ item.subtitle|nl2br }}</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="item-action">
|
||||
<a style="display:none"><i class="item-info fas fa-circle-info"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-description hide">{{ item.content|raw }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-filter"></i>
|
||||
Afficher par Rôle
|
||||
</div>
|
||||
<ul id="group-filter" class="list-group list-group-flush">
|
||||
<a class="active list-group-item" id="allrole" style="cursor:pointer">
|
||||
<i class="fa fa-users"></i>
|
||||
Toutes les Rôles
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_ANONYME" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Visiteur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_USER" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Utilisateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_ANIM" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Animateur de Groupe
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_MODO" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Modérateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
<a class="list-group-item" data-role="ROLE_ADMIN" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
Administrateur
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-filter"></i>
|
||||
Afficher par Groupe
|
||||
</div>
|
||||
|
||||
<ul id="group-filter" class="list-group list-group-flush">
|
||||
<a class="active list-group-item" style="cursor:pointer" id="allgroup">
|
||||
<i class="fa fa-users"></i>
|
||||
Toutes les Groupes
|
||||
<span class="badge bg-success float-end"></span>
|
||||
</a>
|
||||
|
||||
{% for group in groups %}
|
||||
<a class="list-group-item" data-role="{{ group.id }}" style="cursor:pointer">
|
||||
<i class="fa fa-user"></i>
|
||||
{{ group.label }}
|
||||
<span class="badge bg-success float-end">{{ group.items|length }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$( function() {
|
||||
var changes = false;
|
||||
|
||||
$("#allrole").children("span").html($('.grid-item').length);
|
||||
$("#allgroup").children("span").html($('.grid-item').length);
|
||||
|
||||
$("a[data-role='ROLE_ANONYME']").children("span").html($('.group-ROLE_ANONYME').length);
|
||||
$("a[data-role='ROLE_USER']").children("span").html($('.group-ROLE_USER').length);
|
||||
$("a[data-role='ROLE_ANIM']").children("span").html($('.group-ROLE_ANIM').length);
|
||||
$("a[data-role='ROLE_MODO']").children("span").html($('.group-ROLE_MODO').length);
|
||||
$("a[data-role='ROLE_ADMIN']").children("span").html($('.group-ROLE_ADMIN').length);
|
||||
|
||||
function updateItems() {
|
||||
// Pour chaque catégorie
|
||||
$('.list-categoryitem').each(function(i) {
|
||||
// On récupère id et order
|
||||
var categoryid = $(this).data('itemcategory-id');
|
||||
$(this).find('input[name="itemcategory[rowOrder][]"]').val(i);
|
||||
|
||||
// Mise à jour en base de l'order
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_'~access~'_itemcategory_order') }}",
|
||||
data: {
|
||||
id:categoryid,
|
||||
order:i
|
||||
}
|
||||
});
|
||||
|
||||
// Pour chaque item de la catégorie
|
||||
$(this).find('.item').each(function(j) {
|
||||
// On récupère les id
|
||||
var itemid = $(this).data('item-id');
|
||||
|
||||
// Mise à jour en base de l'order
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_'~access~'_item_order') }}",
|
||||
data: {
|
||||
id:itemid,
|
||||
categoryid:categoryid,
|
||||
order:j
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$( ".items-list" ).sortable({
|
||||
connectWith: ".items-list",
|
||||
placeholder: "item placeholder",
|
||||
update: updateItems
|
||||
});
|
||||
|
||||
$( ".list-categorysitem" ).sortable({
|
||||
axis: "y",
|
||||
placeholder: "category-list placeholder",
|
||||
update: updateItems
|
||||
});
|
||||
|
||||
$('a.list-group-item').click(function(){
|
||||
$('#group-filter a.list-group-item').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
console.log('.group-'+$(this).attr('data-role'));
|
||||
if($(this).attr('data-role')){
|
||||
$('.item').hide();
|
||||
$('.group-'+$(this).attr('data-role')).show();
|
||||
} else {
|
||||
$('.item').show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user