Eps2 / templates /accounts.html
Docfile's picture
Create accounts.html
42fdeaa verified
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liste des comptes générés</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body { background-color: #f5f5f5; }
.card { box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.username-cell {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.pagination { margin-bottom: 0; }
</style>
<script src="{{ url_for('serve_js') }}"></script>
</head>
<body>
<div class="container mt-5">
<div class="row">
<div class="col-md-12 mb-4">
<div class="card">
<div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
<h3 class="mb-0">Liste des comptes générés</h3>
<a href="/" class="btn btn-light">Retour au générateur</a>
</div>
<div class="card-body">
<div class="alert alert-info">
Total des comptes générés: {{ total_accounts }}
</div>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th>Nom d'utilisateur</th>
<th>Email</th>
<th>Mot de passe</th>
<th>Startup Rep</th>
<th>Date de création</th>
<th>Statut</th>
</tr>
</thead>
<tbody>
{% for account in accounts %}
<tr>
<td>{{ (page - 1) * 20 + loop.index }}</td>
<td class="username-cell" title="{{ account.username }}">{{ account.username }}</td>
<td>{{ account.email }}</td>
<td>{{ account.password }}</td>
<td>{% if account.is_startup_rep %}Oui{% else %}Non{% endif %}</td>
<td>{{ account.created_at }}</td>
<td>
{% if account.success %}
<span class="badge bg-success">Succès</span>
{% else %}
<span class="badge bg-danger">Échec</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if total_pages > 1 %}
<div class="d-flex justify-content-center mt-4">
<nav aria-label="Page navigation">
<ul class="pagination">
<li class="page-item {% if page == 1 %}disabled{% endif %}">
<a class="page-link" href="{{ url_for('view_accounts', page=page-1) if page > 1 else '#' }}">Précédent</a>
</li>
{% for p in range(1, total_pages + 1) %}
{% if p == page %}
<li class="page-item active"><span class="page-link">{{ p }}</span></li>
{% else %}
<li class="page-item"><a class="page-link" href="{{ url_for('view_accounts', page=p) }}">{{ p }}</a></li>
{% endif %}
{% endfor %}
<li class="page-item {% if page == total_pages %}disabled{% endif %}">
<a class="page-link" href="{{ url_for('view_accounts', page=page+1) if page < total_pages else '#' }}">Suivant</a>
</li>
</ul>
</nav>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>