Merge branch 'master' into dist/envole/6/master

This commit is contained in:
Arnaud Fornerot 2021-06-17 15:08:49 +02:00
commit de04ab9bdb
1 changed files with 160 additions and 42 deletions

View File

@ -12,49 +12,163 @@
<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="list" class="panel-group"> <div id="listpending" class="panel panel-default">
{% for alert in alerts %} <div class="panel-heading">
<div <h3 style="margin:0px">En Attente Publication</h2>
class=" </div>
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 }) }}"> <div class="panel-body">
<i class="fa fa-arrows-v" style="color: rgba(255,255,255,.5);"></i> <div class="list panel-group">
{{ alert.title }} {% for alert in alerts if alert.isPending %}
</a> <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 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 href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}">
<i class="fa fa-chevron-down"></i> <i class="fa fa-arrows-v" style="color: rgba(255,255,255,.5);"></i>
</a> {{ alert.title }}
</div> </a>
<div id="alert-{{ alert.id }}" class="panel-body panel-collapse collapse"> <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">
{{ alert.content|raw }} <i class="fa fa-chevron-down"></i>
</div> </a>
</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