228 lines
12 KiB
Twig
228 lines
12 KiB
Twig
{% extends 'base.html.twig' %}
|
|
|
|
{% block body %}
|
|
{% set isSA = is_granted('ROLE_SUPER_ADMIN')%}
|
|
<div class="w-100 h-100 p-5 m-auto">
|
|
{% for type, messages in app.flashes %}
|
|
{% for message in messages %}
|
|
<div class="alert alert-{{ type }}">
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
<div class="col d-flex justify-content-between align-items-center">
|
|
<div class="d-flex ">
|
|
{% if organization.logoUrl %}
|
|
<img src="{{ asset(organization.logoUrl) }}" alt="Organization logo"
|
|
class="rounded-circle" style="width:40px; height:40px;">
|
|
{% endif %}
|
|
<h1 class="mb-4 ms-3">{{ organization.name|title }} - Dashboard</h1>
|
|
</div>
|
|
<div class="d-flex gap-2">
|
|
{% if isSA %}
|
|
<a href="{{ path('organization_edit', {'id': organization.id}) }}" class="btn btn-primary">Gérer
|
|
l'organisation</a>
|
|
<form method="POST" action="{{ path('organization_delete', {'id': organization.id}) }}"
|
|
onsubmit="return confirm('Vous allez supprimer cette organisation, êtes vous sûre?');"
|
|
style="display: inline-block;">
|
|
<button class="btn btn-secondary" type="submit">Supprimer l'organisation</button>
|
|
</form>
|
|
{% if organization.active %}
|
|
<form method="POST" action="{{ path('organization_deactivate', {'id': organization.id}) }}"
|
|
onsubmit="return confirm('Vous allez désactiver cette organisation, êtes vous sûre?');"
|
|
style="display: inline-block;">
|
|
<button class="btn btn-warning" type="submit">Désactiver l'organisation</button>
|
|
</form>
|
|
{% else %}
|
|
<form method="POST" action="{{ path('organization_activate', {'id': organization.id}) }}"
|
|
onsubmit="return confirm('Vous allez re-activer cette organisation, êtes vous sûre?');"
|
|
style="display: inline-block;">
|
|
<button class="btn btn-primary" type="submit">Activer l'organisation</button>
|
|
</form>
|
|
{% endif %}
|
|
{% elseif is_granted("ROLE_ADMIN") %}
|
|
<a href="{{ path('organization_edit', {'id': organization.id}) }}" class="btn btn-primary">Gérer mon
|
|
organisation</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
{# single row so that activity and users tabs are next to each other #}
|
|
<div class="row">
|
|
{# User tables #}
|
|
<div class="col-9">
|
|
<div class="row mb-3 d-flex gap-2 ">
|
|
<div class="col mb-3 card no-header-bg">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h2>
|
|
Nouveaux utilisateurs
|
|
</h2>
|
|
<a href="{{ path('user_new', {'organizationId': organization.id}) }}"
|
|
class="btn btn-primary">Ajouter un utilisateur</a>
|
|
</div>
|
|
<div class="card-body">
|
|
<div id="tabulator-userListSmall" data-controller="user"
|
|
data-user-aws-value="{{ aws_url }}"
|
|
data-user-new-value="true"
|
|
data-user-list-small-value="true"
|
|
data-user-org-id-value="{{ organization.id }}">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col mb-3 card no-header-bg"
|
|
data-controller="user"
|
|
data-user-org-id-value="{{ organization.id }}"
|
|
data-user-admin-value="true"
|
|
data-user-list-small-value="true">
|
|
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h2>Administrateurs</h2>
|
|
<button type="button" class="btn btn-primary" data-action="click->user#openAddAdminModal">
|
|
Ajouter un administrateur
|
|
</button>
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
<div id="tabulator-userListSmallAdmin"></div>
|
|
</div>
|
|
|
|
{# Modal for Adding Admin #}
|
|
<div class="modal fade" id="addAdminModal" tabindex="-1" aria-hidden="true" data-user-target="modal">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Ajouter un administrateur</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<form data-action="submit->user#submitAddAdmin">
|
|
<div class="modal-body">
|
|
<div class="mb-3">
|
|
<label class="form-label">Sélectionner l'utilisateur</label>
|
|
<select name="userId" class="form-select" data-user-target="userSelect" required>
|
|
<option value="">Chargement...</option>
|
|
</select>
|
|
</div>
|
|
{# Hidden Fields #}
|
|
<input type="hidden" name="status" value="add">
|
|
<input type="hidden" name="organizationId" value="{{ organization.id }}">
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
|
|
<button type="submit" class="btn btn-primary">Ajouter</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row mb-3 card no-header-bg">
|
|
<div class="card-header">
|
|
<h2>
|
|
Mes utilisateurs
|
|
</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<div id="tabulator-userListOrganization" data-controller="user"
|
|
data-user-aws-value="{{ aws_url }}"
|
|
data-user-statut-value="true"
|
|
data-user-list-organization-value="true"
|
|
data-user-org-id-value="{{ organization.id }}">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{# APPLICATION ROW #}
|
|
{# TODO:remove app acces and replace wioth project overview#}
|
|
<div class="row mb-3 card no-header-bg"
|
|
data-controller="project"
|
|
data-project-list-project-value="true"
|
|
data-project-org-id-value="{{ organization.id }}"
|
|
data-project-admin-value="{{ isSA ? 'true' : 'false' }}">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h2>Mes Projets</h2>
|
|
{% if is_granted("ROLE_SUPER_ADMIN") %}
|
|
{# Trigger for the Modal #}
|
|
<button type="button" class="btn btn-primary" data-action="click->project#openCreateModal">
|
|
Crée un projet
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
<div class="card-body">
|
|
<div id="tabulator-projectListOrganization">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="createProjectModal" tabindex="-1" aria-hidden="true" data-project-target="modal">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" data-project-target="formTitle">Nouveau Projet</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<form data-action="submit->project#submitForm">
|
|
<div class="modal-body">
|
|
<div class="mb-3">
|
|
<label class="form-label">Nom du projet</label>
|
|
<input type="text" name="name"
|
|
data-project-target="nameInput"
|
|
class="form-control" required>
|
|
</div>
|
|
|
|
<label class="form-label">Applications</label>
|
|
<div class="row" data-project-target="appList">
|
|
{# Checkboxes will be injected here #}
|
|
<div class="text-center p-3">Chargement des applications...</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
|
|
<button type="submit" class="btn btn-primary">Enregistrer</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{# Activities col #}
|
|
<div class="col-3 m-auto">
|
|
<div class="card "
|
|
data-controller="organization"
|
|
data-organization-activities-value = "true"
|
|
data-organization-id-value="{{ organization.id }}">
|
|
|
|
<div class="card-header d-flex justify-content-between align-items-center border-0">
|
|
<h3>Activité récente</h3>
|
|
|
|
<button class="btn btn-sm btn-primary" data-action="organization#loadActivities">
|
|
<i class="fas fa-sync"></i> Rafraîchir
|
|
</button>
|
|
</div>
|
|
|
|
<div class="card-body bg-light">
|
|
<div class="d-flex flex-column" data-organization-target="activityList">
|
|
<div class="text-center text-muted p-5">
|
|
<span class="spinner-border" aria-hidden="true"></span>
|
|
</div>
|
|
</div>
|
|
|
|
{# Empty state #}
|
|
<div class="d-none" data-organization-target="emptyMessage">
|
|
<div class="alert alert-light text-center shadow-sm">Aucune activité récente.</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|