{% extends 'base.html.twig' %}
{% block title %}Liste sites web{% endblock %}
{% block body %}
<div class="container-fluid listing-project">
<div class="row">
<div class="col-12 col-md-3">
<p><button class="btn bg-secondary text-white" data-bs-toggle="modal" data-bs-target="#confirmeAdd">Ajouter un site</button></p>
</div>
<div class="col-12 col-md-9">
<div class="filters d-flex justify-content-end">
<!-- <button type="button" class="btn btn-default btn-sm check-stats" aria-label="Left Align">Vérif Stats <span class="glyphicon glyphicon-signal" aria-hidden="true"></span></button> -->
<label for="filter-active-website" class="mx-2"><select id="filter-active-website" class="form-select" >
<option value="-">Etat du site</option>
<option value="actif">actif</option>
<option value="inactif">inactif</option>
<option value="en-cours">en cours</option>
<option value="mail_only">mail only</option>
</select></label>
{# <label for="filter-stat_system" class="mx-2"><select id="filter-stat_system" class="form-select" >
<option value="-">Système de stat</option>
<option value="ficon-piwik_logo">Piwik</option>
<option value="ficon-google_logo">Google analytics</option>
<option value="ficon-myvisit_logo">phpMyVisites</option>
<option value="glyphicon-remove">aucun</option>
</select></label> #}
<label for="filter-server" class="mx-2"><select id="filter-server" class="form-select" >
<option value="-">Serveur</option>
<option value="mutu01">Mutu01</option>
<option value="mutu02">Mutu02</option>
<option value="mutu03">Mutu03</option>
<option value="mutu04">Mutu04</option>
<option value="mutu05">Mutu05</option>
<option value="mutu06">Mutu06</option>
<option value="mutu07">Mutu07</option>
<option value="mutu08">Mutu08</option>
<option value="ovhicom06">ovhicom06</option>
<option value="vm-icom.planetb">vm-icom.planetb</option>
<option value="castral-roc.mh">castral-roc.mh</option>
<option value="Wix">Wix</option>
</select></label>
<label for="filter-phpversion" class="mx-2"><select id="filter-phpversion" class="form-select" >
<option value="-">PHP</option>
</select></label>
<label for="filter-type" class="mx-2"><select id="filter-type" class="form-select" >
<option value="-">Type CMS</option>
<option value="CMSMS">CMSMS</option>
<option value="Contenu PLESK">Contenu PLESK</option>
<option value="Other CMS">Other CMS</option>
<option value="OwnCloud">OwnCloud</option>
<option value="Prestashop">Prestashop</option>
<option value="Symfony">Symfony</option>
<option value="Wordpress">Wordpress</option>
<option value="Shop">Woocommerce</option>
<option value="Wordpress GENESIS">Wordpress GENESIS</option>
<option value="Wordpress WPMS">Wordpress WPMS</option>
<option value="Wordpress WebSity">Wordpress WebSity</option>
<option value="Wordpress WebSity Shop">Wordpress WebSity Shop</option>
<option value="Wordpress OnePage">Wordpress OnePage</option>
<option value="Wix">Wix</option>
</select></label>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
{# {{ dump(websites) }} #}
<table id="table_listing_projects" class="table table-bordered table-hover tablesorter">
<thead>
<tr class="bg-secondary text-white">
<th>Domaine {# ({{ websites|length }}) #}</th>
{# <th class="header-stats">Stats</th> #}
<th>Type</th>
<th>Version</th>
<th>Date de création</th>
<th>Date MAJ tech</th>
<th>Serveur</th>
<th>HTTPS</th>
<th>PHP</th>
<th>RGPD</th>
<th>Taille</th>
<th>{# action #}</th>
</tr>
</thead>
<tbody>
{% set total_size = 0 %}
{% for website in websites %}
<tr data-index="{{ loop.index }}">
{# <i class="bi bi-globe"></i> #}
{# <i class="bi bi-exclamation-triangle-fill"></i> #}
<td class="{{ website.getStatut() }}">
{% if website.getStatut() == 'actif' %}
<span class="text-success">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-globe" viewBox="0 0 16 16">
<path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm7.5-6.923c-.67.204-1.335.82-1.887 1.855A7.97 7.97 0 0 0 5.145 4H7.5V1.077zM4.09 4a9.267 9.267 0 0 1 .64-1.539 6.7 6.7 0 0 1 .597-.933A7.025 7.025 0 0 0 2.255 4H4.09zm-.582 3.5c.03-.877.138-1.718.312-2.5H1.674a6.958 6.958 0 0 0-.656 2.5h2.49zM4.847 5a12.5 12.5 0 0 0-.338 2.5H7.5V5H4.847zM8.5 5v2.5h2.99a12.495 12.495 0 0 0-.337-2.5H8.5zM4.51 8.5a12.5 12.5 0 0 0 .337 2.5H7.5V8.5H4.51zm3.99 0V11h2.653c.187-.765.306-1.608.338-2.5H8.5zM5.145 12c.138.386.295.744.468 1.068.552 1.035 1.218 1.65 1.887 1.855V12H5.145zm.182 2.472a6.696 6.696 0 0 1-.597-.933A9.268 9.268 0 0 1 4.09 12H2.255a7.024 7.024 0 0 0 3.072 2.472zM3.82 11a13.652 13.652 0 0 1-.312-2.5h-2.49c.062.89.291 1.733.656 2.5H3.82zm6.853 3.472A7.024 7.024 0 0 0 13.745 12H11.91a9.27 9.27 0 0 1-.64 1.539 6.688 6.688 0 0 1-.597.933zM8.5 12v2.923c.67-.204 1.335-.82 1.887-1.855.173-.324.33-.682.468-1.068H8.5zm3.68-1h2.146c.365-.767.594-1.61.656-2.5h-2.49a13.65 13.65 0 0 1-.312 2.5zm2.802-3.5a6.959 6.959 0 0 0-.656-2.5H12.18c.174.782.282 1.623.312 2.5h2.49zM11.27 2.461c.247.464.462.98.64 1.539h1.835a7.024 7.024 0 0 0-3.072-2.472c.218.284.418.598.597.933zM10.855 4a7.966 7.966 0 0 0-.468-1.068C9.835 1.897 9.17 1.282 8.5 1.077V4h2.355z"/>
</svg>
</span>
{% elseif website.getStatut() == 'en-cours' %}
<span class="text-warning">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clock-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/>
</svg>
</span>
{% elseif website.getStatut() == 'mail_only' %}
<span class="text-info">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-fill" viewBox="0 0 16 16">
<path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z"/>
</svg>
</span>
{% elseif website.getStatut() == 'archive' %}
<span class="text-secondary">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-archive-fill" viewBox="0 0 16 16">
<path d="M12.643 15C13.979 15 15 13.845 15 12.5V5H1v7.5C1 13.845 2.021 15 3.357 15h9.286zM5.5 7h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zM.8 1a.8.8 0 0 0-.8.8V3a.8.8 0 0 0 .8.8h14.4A.8.8 0 0 0 16 3V1.8a.8.8 0 0 0-.8-.8H.8z"/>
</svg>
</span>
{% else %}
<span class="text-danger">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-triangle-fill" viewBox="0 0 16 16">
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</svg>
</span>
{% endif %}
<a target="_blank" href="http://{{ website.getUrlPrincipal() }}" title="Voir le site">{{ website.getUrlPrincipal() }}</a>
</td>
{# <td class="have_stats">
{% if website.getStatsArray() is defined %}
{% endif %}
</td> #}
<td class="type_cms"><small>{{ website.getCmsType() }}</small></td>
<td class="v_cms"><small>{{ website.getCmsVersion() }}</small></td>
<td class="date_create"><small>{{ website.getDateCreation() | date('YC-m-d') }}</small></td>
<td class="date_upd">
<small>
{% if website.getDateUpdate() %}
{{ website.getDateUpdate() | date('Y-m-d H:i:s') }}
{% else %}
{% endif %}
</small>
</td>
<td class="server">{{ website.getServeur() }}</td>
<td class="https text-center">
{% if website.isIsHttps() %}
<small><span class="badge bg-success">OUI</span></small>
{% else %}
<small><span class="badge bg-danger">NON</span></small>
{% endif %}
</td>
<td class="phpversion"><small>{{ website.getVersionPhp() }}</small></td>
<td class="rgpd text-center">
{% if website.isIsRgpd() %}
<small><span class="badge bg-success">OUI</span></small>
{% else %}
<small><span class="badge bg-danger">NON</span></small>
{% endif %}
</td>
<td class="size">
<small>
{% if website.getSize() is not null %}{% set total_size = total_size + website.getSize() %}{% endif %}
{% if website.getSize() > 1100 %}
{{ (website.getSize()/1024)|round(2, 'floor') }}Go
{% elseif website.getSize() is not null %}
{{ website.getSize() }}Mo
{% else %}
-
{% endif %}
</small>
</td>
<td class="btn_action">
<a data-toggle="modal" data-bs-toggle="modal" data-bs-target="#updateInfos" href="/update-website/{{ website.getUrlPrincipal() }}" data-update="{{ website.getUrlPrincipal() }}" class="btn btn-sm btn-xs btn-info py-0" title="Mettre à jour les données"><i class="fas fa-sync-alt"></i></a>
|
<a data-toggle="modal" data-bs-toggle="modal" data-bs-target="#formEdit" href="#" data-id="{{ website.getId() }}" data-edit="{{ website.getUrlPrincipal() }}" class="btn btn-sm btn-xs btn-primary py-0" title="Modifier"><i class="fas fa-pen"></i></a>
<!-- |
<a data-toggle="modal" data-bs-toggle="modal" data-bs-target="#confirmeDelete" href="#" data-delete="{{ website.getUrlPrincipal() }}" class="btn btn-sm btn-xs btn-danger py-0" title="Supprimer"><i class="fas fa-trash-alt"></i></a> -->
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div>Total size : {{(total_size/1024)|round(2, 'floor') }}Go</div>
<!-- Modal -->
<div class="modal fade" id="updateInfos" tabindex="-1" aria-labelledby="Mise à jour" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="updateInfos">Mise à jour des infos</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body loading">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
<ul>
<li><b>Domaine :</b> <span data-info="domaine"></span></li>
<li><b>Type :</b> <span data-info="cms"></span></li>
<li><b>Version :</b> <span data-info="v_cms"></span></li>
<li><b>Date de création :</b> <span data-info="date_create"></span></li>
<li><b>Serveur :</b> <span data-info="serveur"></span></li>
<li><b>HTTPS :</b> <span data-info="is_https"></span></li>
<li><b>Version PHP :</b> <span data-info="v_php"></span></li>
<li><b>RGPD :</b> <span data-info="is_rgpd"></span></li>
<li><b>Taille :</b> <span data-info="size"></span></li>
</ul>
</div>
<div class="modal-footer">
<button type="button" data-bs-dismiss="modal" class="btn btn-secondary">OK</button>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="formEdit" tabindex="-1" aria-labelledby="Modification" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modification de site</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<input type="hidden" id="website-id">
<p>
<label for="urlPrincipal">
<span>Domaine</span>
<input type="text" readonly disable id="urlPrincipal" class="form-control" placeholder="domane.dtl">
</label>
<label for="edit-statut">
<span>Statut</span>
<select name="edit-statut" id="edit-statut" class="form-control">
<option value="">-</option>
<option value="inactif">Inactif</option>
<option value="en-cours">En cours</option>
<option value="actif">Actif</option>
<option value="archive">Archivé</option>
</select>
</label>
</p>
{# <label for="edit-dateUpdate">
<button type="button" class="btn btn-primary">Mise à jour techique effectuée</button>
</label> #}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Annuler</button>
<a href="#" class="btn btn-success">Modifier</a>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="confirmeAdd" tabindex="-1" aria-labelledby="confirmeAddLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirmeAddLabel">Ajout de site</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<input type="text" id="append-website" class="form-control" placeholder="domane.dtl">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Annuler</button>
<button type="button" class="btn btn-success">Ajouter</button>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="confirmeDelete" tabindex="-1" role="dialog" aria-labelledby="confirmeDeleteLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
{# <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> #}
<h5 class="modal-title" id="exampleModalLabel">Suppression de site</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
<h4 class="modal-title" id="confirmeDeleteLabel">Êtes vous sûr de vouloir supprimer le site <b>'+domaine+'</b> du listing ?</h4>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Non</button>
<a href="#" class="btn btn-success">Oui</a>
</div>
</div>
</div>
</div>
{% endblock %}