replacer les modifs écrasées

This commit is contained in:
afornerot 2021-06-17 15:01:57 +02:00
parent e3188b1732
commit 5271f992a7
1 changed files with 160 additions and 42 deletions

View File

@ -11,50 +11,164 @@
<a href="{{ path('cadoles_portal_config_alert_submit') }}" class="btn btn-success">Ajouter une Annonce</a> <a href="{{ path('cadoles_portal_config_alert_submit') }}" class="btn btn-success">Ajouter une Annonce</a>
<a href="{{ path('cadoles_portal_config_alertcategory_submit') }}" class="btn btn-success">Ajouter une Catégorie</a> <a href="{{ path('cadoles_portal_config_alertcategory_submit') }}" class="btn btn-success">Ajouter une Catégorie</a>
</p> </p>
<div id="listpending" class="panel panel-default">
<div class="panel-heading">
<h3 style="margin:0px">En Attente Publication</h2>
</div>
<div id="list" class="panel-group"> <div class="panel-body">
{% for alert in alerts %} <div class="list panel-group">
<div {% for alert in alerts if alert.isPending %}
class=" <div
panel class="
list-item panel
alertcategory-{{ alert.alertcategory.id }} list-item
{{ alert.isOnline ? "alertstatut-online" : ""}} alertcategory-{{ alert.alertcategory.id }}
{{ alert.isPending ? "alertstatut-pending" : ""}} {{ alert.isOnline ? "alertstatut-online" : ""}}
{{ alert.isArchived ? "alertstatut-archived" : ""}} {{ alert.isPending ? "alertstatut-pending" : ""}}
{% for group in alert.groups %}{{ ' group-' ~ group.id }}{% endfor %} {{ alert.isArchived ? "alertstatut-archived" : ""}}
{% for role in alert.roles %}{{ ' role-' ~ role }}{% endfor %} {% for group in alert.groups %}{{ ' group-' ~ group.id }}{% endfor %}
" {% for role in alert.roles %}{{ ' role-' ~ role }}{% endfor %}
data-alert-category-id="{{ alert.alertcategory.id }}" "
data-alert-id="{{ alert.id }}" data-alert-category-id="{{ alert.alertcategory.id }}"
style="background: {{ alert.alertcategory.color ? '#'~alert.alertcategory.color : '#'~color['main'] }};" data-alert-id="{{ alert.id }}"
> style="background: {{ alert.alertcategory.color ? '#'~alert.alertcategory.color : '#'~color['main'] }};"
<div class="panel-heading" role="tab"> >
<a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}" class="panel-heading-icon pull-left"> <div class="panel-heading" role="tab">
{% if alert.alertcategory.icon %} <a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}" class="panel-heading-icon pull-left">
<img height="25" src="/{{ alias }}/{{ alert.alertcategory.icon.label }}"> {% if alert.alertcategory.icon %}
{% else %} <img height="25" src="/{{ alias }}/{{ alert.alertcategory.icon.label }}">
<img height="25" src="/{{ alias }}/uploads/icon/icon_megaphone.png"> {% else %}
{% endif %} <img height="25" src="/{{ alias }}/uploads/icon/icon_megaphone.png">
</a> {% endif %}
</a>
<a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}">
<i class="fa fa-arrows-v" style="color: rgba(255,255,255,.5);"></i> <a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}">
{{ alert.title }} <i class="fa fa-arrows-v" style="color: rgba(255,255,255,.5);"></i>
</a> {{ alert.title }}
</a>
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#alert-{{ alert.id }}" aria-expanded="true" aria-controls="collapseOne" class="panel-heading-chevron pull-right">
<i class="fa fa-chevron-down"></i> <a role="button" data-toggle="collapse" data-parent="#accordion" href="#alert-{{ alert.id }}" aria-expanded="true" aria-controls="collapseOne" class="panel-heading-chevron pull-right">
</a> <i class="fa fa-chevron-down"></i>
</div> </a>
</div>
<div id="alert-{{ alert.id }}" class="panel-body panel-collapse collapse">
{{ alert.content|raw }}
</div>
<input type="hidden" name="alert_item[id][]" value="{{ alert.id }}" /> <div id="alert-{{ alert.id }}" class="panel-body panel-collapse collapse">
{{ alert.content|raw }}
</div>
<input type="hidden" name="alert_item[id][]" value="{{ alert.id }}" />
</div>
{% endfor %}
</div> </div>
{% endfor %} </div>
</div>
<div id="listonline" class="panel panel-default">
<div class="panel-heading">
<h3 style="margin:0px">En Ligne</h2>
</div>
<div class="panel-body">
<div id="listonline" class="list panel-group">
{% for alert in alerts if alert.isOnline %}
<div
class="
panel
list-item
alertcategory-{{ alert.alertcategory.id }}
{{ alert.isOnline ? "alertstatut-online" : ""}}
{{ alert.isPending ? "alertstatut-pending" : ""}}
{{ alert.isArchived ? "alertstatut-archived" : ""}}
{% for group in alert.groups %}{{ ' group-' ~ group.id }}{% endfor %}
{% for role in alert.roles %}{{ ' role-' ~ role }}{% endfor %}
"
data-alert-category-id="{{ alert.alertcategory.id }}"
data-alert-id="{{ alert.id }}"
style="background: {{ alert.alertcategory.color ? '#'~alert.alertcategory.color : '#'~color['main'] }};"
>
<div class="panel-heading" role="tab">
<a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}" class="panel-heading-icon pull-left">
{% if alert.alertcategory.icon %}
<img height="25" src="/{{ alias }}/{{ alert.alertcategory.icon.label }}">
{% else %}
<img height="25" src="/{{ alias }}/uploads/icon/icon_megaphone.png">
{% endif %}
</a>
<a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}">
<i class="fa fa-arrows-v" style="color: rgba(255,255,255,.5);"></i>
{{ alert.title }}
</a>
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#alert-{{ alert.id }}" aria-expanded="true" aria-controls="collapseOne" class="panel-heading-chevron pull-right">
<i class="fa fa-chevron-down"></i>
</a>
</div>
<div id="alert-{{ alert.id }}" class="panel-body panel-collapse collapse">
{{ alert.content|raw }}
</div>
<input type="hidden" name="alert_item[id][]" value="{{ alert.id }}" />
</div>
{% endfor %}
</div>
</div>
</div>
<div id="listarchived" class="panel panel-default">
<div class="panel-heading">
<h3 style="margin:0px">Archivées</h2>
</div>
<div class="panel-body">
<div id="listarchived" class="list panel-group">
{% for alert in alerts if alert.isArchived %}
<div
class="
panel
list-item
alertcategory-{{ alert.alertcategory.id }}
{{ alert.isOnline ? "alertstatut-online" : ""}}
{{ alert.isPending ? "alertstatut-pending" : ""}}
{{ alert.isArchived ? "alertstatut-archived" : ""}}
{% for group in alert.groups %}{{ ' group-' ~ group.id }}{% endfor %}
{% for role in alert.roles %}{{ ' role-' ~ role }}{% endfor %}
"
data-alert-category-id="{{ alert.alertcategory.id }}"
data-alert-id="{{ alert.id }}"
style="background: {{ alert.alertcategory.color ? '#'~alert.alertcategory.color : '#'~color['main'] }};"
>
<div class="panel-heading" role="tab">
<a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}" class="panel-heading-icon pull-left">
{% if alert.alertcategory.icon %}
<img height="25" src="/{{ alias }}/{{ alert.alertcategory.icon.label }}">
{% else %}
<img height="25" src="/{{ alias }}/uploads/icon/icon_megaphone.png">
{% endif %}
</a>
<a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}">
<i class="fa fa-arrows-v" style="color: rgba(255,255,255,.5);"></i>
{{ alert.title }}
</a>
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#alert-{{ alert.id }}" aria-expanded="true" aria-controls="collapseOne" class="panel-heading-chevron pull-right">
<i class="fa fa-chevron-down"></i>
</a>
</div>
<div id="alert-{{ alert.id }}" class="panel-body panel-collapse collapse">
{{ alert.content|raw }}
</div>
<input type="hidden" name="alert_item[id][]" value="{{ alert.id }}" />
</div>
{% endfor %}
</div>
</div>
</div> </div>
</div> </div>
@ -219,7 +333,11 @@
}); });
} }
$( "#list" ).sortable({ if($(".alertstatut-pending").length==0) $("#listpending").hide();
if($(".alertstatut-online").length==0) $("#listonline").hide();
if($(".alertstatut-archived").length==0) $("#listarchived").hide();
$( ".list" ).sortable({
axis: "y", axis: "y",
placeholder: "list-item placeholder", placeholder: "list-item placeholder",
update: updateItems update: updateItems