{% extends 'base.html.twig' %}
{% block title %}Liste des domaines OVH{% endblock %}
{% block body %}
<div class="container-fluid listing-project">
<div class="row">
{% if domainsDb is defined %}
<div class="col-12 col-lg-8 offset-lg-2">
Il y a <strong>{{ domainsNbr }} domaines</strong> ({{ date }}) - <i>{{ domainsNbrToDelete }} domaines en suppression</i>
{# {{ dump(domainsDb) }} #}
<table id="domains_list" class="table table-bordered table-hover tablesorter">
<thead>
<tr class="bg-secondary text-white">
<th>Domaine {# ({{ websites|length }}) #}</th>
<th>Date expiration</th>
<th>Renouvellement auto</th>
<th>Suppresion à date</th>
</tr>
</thead>
<tbody>
{% for domainDb in domainsDb %}
{# {% if domainDb.isDeleteToExpired() %} #}
<tr data-index="{{ loop.index }}">
<td>
<a class="btn-domain-infos"
data-toggle="modal" data-bs-toggle="modal"
data-bs-target="#domainInfos"
href="/domain-infos/{{ domainDb.getNameDomain() }}"
title="Infos du domaine {{ domainDb.getNameDomain() }}">
{{ domainDb.getNameDomain() }}
</a>
</td>
<td>{{ domainDb.getDateRenew() | date('Y-m-d') }}</td>
<td class="text-center">
{% if domainDb.isRenewAutomatic() %}
Oui
{% endif %}
</td>
<td class="text-center">
{% if domainDb.isDeleteToExpired() %}
<span style="display:none;">{{ domainDb.getDateRenew() | date_modify("+2 month") | date_modify("+6 day") | date('Ymd') }}</span>
{{ domainDb.getDateRenew() | date_modify("+2 month") | date_modify("+6 day") | date('Y-m-d') }}
{% else %}
<span style="display:none;">99999999</span>
{% endif %}
</td>
</tr>
{# {% endif %} #}
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="domainInfos" tabindex="-1" role="dialog" aria-labelledby="domainInfosLabel" 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">Infos du 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>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
{% endblock %}