gmao/app_new/templates/training/detail.html
root 785c8aabcb
Some checks are pending
CI - Tests et Syntax / lint-and-test (push) Waiting to run
Refondre le RBAC multi-roles et securiser les acces
2026-08-21 16:46:19 +00:00

58 lines
3.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block title %}{{ training.name }} — GMAO{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="d-flex justify-content-between align-items-center mb-4">
<h1><i class="bi bi-mortarboard"></i> {{ training.name }}</h1>
<div>
{% if current_user.is_admin() %}
<a href="{{ url_for('trainings.edit', id=training.id) }}" class="btn btn-outline-secondary"><i class="bi bi-pencil"></i> Modifier</a>
{% endif %}
<a href="{{ url_for('trainings.index') }}" class="btn btn-secondary">Retour</a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card mb-3">
<div class="card-header"><i class="bi bi-info-circle"></i> Informations</div>
<div class="card-body">
<p><strong>Date :</strong> {{ training.start_date.strftime('%d/%m/%Y') if training.start_date else 'À confirmer' }} au {{ training.end_date.strftime('%d/%m/%Y') if training.end_date else 'À confirmer' }}</p>
{% if training.start_time or training.end_time %}<p><strong>Horaire :</strong> {{ training.start_time.strftime('%H:%M') if training.start_time else '—' }} {{ training.end_time.strftime('%H:%M') if training.end_time else '—' }}</p>{% endif %}
{% if training.source_type %}<p><strong>Source :</strong> <span class="badge bg-info">{{ training.source_type }}</span> {{ training.source_subject or '' }}{% if training.source_sender %} — {{ training.source_sender }}{% endif %}</p>{% endif %}
{% if training.location %}<p><strong>Lieu :</strong> {{ training.location }}</p>{% endif %}
{% if training.description %}<p><strong>Description :</strong> {{ training.description }}</p>{% endif %}
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header"><i class="bi bi-people"></i> Participants ({{ participants|length }})</div>
<div class="card-body">
{% if participants %}
<ul class="list-unstyled">
{% for p in participants %}
<li class="mb-2">{{ p.user.full_name }} <span class="badge bg-{{ 'success' if p.is_confirmed else 'warning' }}">{{ 'Confirmée' if p.is_confirmed else 'En attente' }}</span></li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">Aucun participant inscrit.</p>
{% endif %}
{% set is_registered = participant_users.get(current_user.id) %}
<form method="POST" action="{% if is_registered %}{{ url_for('trainings.unregister', id=training.id) }}{% else %}{{ url_for('trainings.register', id=training.id) }}{% endif %}" class="mt-3">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-{% if is_registered %}warning{% else %}success{% endif %}">
{% if is_registered %}<i class="bi bi-x-lg"></i> Se désinscrire{% else %}<i class="bi bi-plus-lg"></i> S'inscrire{% endif %}
</button>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}