Refonte design V1
This commit is contained in:
@@ -1,40 +1,74 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', 'Agents — Signatures CABM')
|
||||
@section('title', 'Agents — Signatures')
|
||||
@section('content')
|
||||
<h1>Agents</h1>
|
||||
@php
|
||||
$initials = fn (?string $name) => mb_strtoupper(collect(preg_split('/[\s\-]+/u', trim((string) $name)))->filter()->take(2)->map(fn ($w) => mb_substr($w, 0, 1))->join(''));
|
||||
@endphp
|
||||
<header class="page-head">
|
||||
<div>
|
||||
<h1>Agents</h1>
|
||||
<p class="lead">Qui reçoit quoi : le template appliqué à chaque agent selon ses groupes. Ouvrez un agent pour voir sa signature.</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<form method="get" class="row" style="margin-bottom:16px">
|
||||
<input type="search" name="q" value="{{ $q }}" placeholder="Nom, adresse ou service" style="max-width:360px" aria-label="Rechercher un agent">
|
||||
<button class="btn" type="submit">Rechercher</button>
|
||||
<span class="muted">{{ $agents->total() }} agent(s)</span>
|
||||
<div class="search">
|
||||
<x-icon name="search" :size="16" />
|
||||
<input type="search" name="q" value="{{ $q }}" placeholder="Nom, adresse ou service" aria-label="Rechercher un agent">
|
||||
</div>
|
||||
<button class="btn secondary" type="submit">Rechercher</button>
|
||||
<span class="muted">{{ $agents->total() }} agent{{ $agents->total() > 1 ? 's' : '' }}</span>
|
||||
</form>
|
||||
<div class="card">
|
||||
<table class="list">
|
||||
<thead><tr><th>Agent</th><th>Service</th><th>Groupes signature_*</th><th>Template appliqué</th></tr></thead>
|
||||
<tbody>
|
||||
@forelse ($agents as $a)
|
||||
<tr>
|
||||
<td><a href="{{ route('admin.agents.show', $a) }}">{{ $a->display_name }}</a><div class="muted">{{ $a->mail }}</div></td>
|
||||
<td>{{ $a->department }}</td>
|
||||
<td class="muted">{{ $a->groups->pluck('display_name')->join(', ') ?: '—' }}</td>
|
||||
<td>{{ $resolved[$a->id] ?? '— aucun —' }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4" class="muted">Aucun agent trouvé.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="card card--flush">
|
||||
<div class="table-wrap">
|
||||
<table class="list">
|
||||
<thead><tr><th>Agent</th><th>Service</th><th>Groupes signature_*</th><th>Template appliqué</th></tr></thead>
|
||||
<tbody>
|
||||
@forelse ($agents as $a)
|
||||
<tr>
|
||||
<td>
|
||||
<div class="person">
|
||||
<span class="avatar" aria-hidden="true">{{ $initials($a->display_name) }}</span>
|
||||
<div>
|
||||
<a class="cell-title" href="{{ route('admin.agents.show', $a) }}">{{ $a->display_name }}</a>
|
||||
<div class="muted">{{ $a->mail }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ $a->department }}</td>
|
||||
<td class="muted">{{ $a->groups->pluck('display_name')->join(', ') ?: '—' }}</td>
|
||||
<td>
|
||||
@if ($resolved[$a->id] ?? null)
|
||||
{{ $resolved[$a->id] }}
|
||||
@else
|
||||
<span class="badge warn">aucun</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4">
|
||||
<div class="empty">
|
||||
<x-icon name="search" :size="32" />
|
||||
<p><strong>Aucun agent trouvé</strong>{{ $q !== '' ? 'Essayez un autre nom, une adresse ou un service.' : 'Lancez une synchronisation de l\'annuaire depuis le tableau de bord.' }}</p>
|
||||
</div>
|
||||
</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ($agents->hasPages())
|
||||
<nav class="row" style="margin-top:12px" aria-label="Pagination">
|
||||
<nav class="card-foot pager" aria-label="Pagination">
|
||||
@if ($agents->onFirstPage())
|
||||
<span class="muted">← Précédent</span>
|
||||
<span class="btn secondary small" aria-disabled="true"><x-icon name="chevron-left" :size="15" />Précédent</span>
|
||||
@else
|
||||
<a href="{{ $agents->previousPageUrl() }}" rel="prev">← Précédent</a>
|
||||
<a class="btn secondary small" href="{{ $agents->previousPageUrl() }}" rel="prev"><x-icon name="chevron-left" :size="15" />Précédent</a>
|
||||
@endif
|
||||
<span class="muted">Page {{ $agents->currentPage() }} / {{ $agents->lastPage() }}</span>
|
||||
<span class="muted">Page {{ $agents->currentPage() }} sur {{ $agents->lastPage() }}</span>
|
||||
@if ($agents->hasMorePages())
|
||||
<a href="{{ $agents->nextPageUrl() }}" rel="next">Suivant →</a>
|
||||
<a class="btn secondary small" href="{{ $agents->nextPageUrl() }}" rel="next">Suivant<x-icon name="chevron-right" :size="15" /></a>
|
||||
@else
|
||||
<span class="muted">Suivant →</span>
|
||||
<span class="btn secondary small" aria-disabled="true">Suivant<x-icon name="chevron-right" :size="15" /></span>
|
||||
@endif
|
||||
</nav>
|
||||
@endif
|
||||
|
||||
@@ -1,41 +1,51 @@
|
||||
@extends('layouts.app')
|
||||
@section('title', $agent->display_name.' — Signatures CABM')
|
||||
@section('title', $agent->display_name.' — Signatures')
|
||||
@section('content')
|
||||
<div class="row" style="margin-bottom:16px">
|
||||
<a href="{{ route('admin.agents.index') }}">← Agents</a>
|
||||
<h1 style="margin:0 0 0 12px">{{ $agent->display_name }}</h1>
|
||||
</div>
|
||||
<header class="page-head">
|
||||
<div>
|
||||
<a class="back" href="{{ route('admin.agents.index') }}"><x-icon name="chevron-left" :size="16" />Agents</a>
|
||||
<h1>{{ $agent->display_name }}</h1>
|
||||
<p class="lead">{{ collect([$agent->job_title, $agent->department])->filter()->join(', ') }}</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="split">
|
||||
<div class="card">
|
||||
<h2>Annuaire (Entra)</h2>
|
||||
<table class="list">
|
||||
<tr><th>Adresse</th><td>{{ $agent->mail }}</td></tr>
|
||||
<tr><th>Fonction</th><td>{{ $agent->job_title }}</td></tr>
|
||||
<tr><th>Service</th><td>{{ $agent->department }}</td></tr>
|
||||
<tr><th>Téléphone</th><td>{{ $agent->business_phone }}</td></tr>
|
||||
<tr><th>Mobile</th><td>{{ $agent->mobile_phone }}</td></tr>
|
||||
<tr><th>Groupes signature_*</th><td>{{ $agent->groups->pluck('display_name')->join(', ') ?: '—' }}</td></tr>
|
||||
<tr><th>Template appliqué</th><td>
|
||||
<dl class="facts">
|
||||
<dt>Adresse</dt><dd>{{ $agent->mail ?: '—' }}</dd>
|
||||
<dt>Fonction</dt><dd>{{ $agent->job_title ?: '—' }}</dd>
|
||||
<dt>Service</dt><dd>{{ $agent->department ?: '—' }}</dd>
|
||||
<dt>Téléphone</dt><dd>{{ $agent->business_phone ?: '—' }}</dd>
|
||||
<dt>Mobile</dt><dd>{{ $agent->mobile_phone ?: '—' }}</dd>
|
||||
<dt>Groupes signature_*</dt><dd>{{ $agent->groups->pluck('display_name')->join(', ') ?: '—' }}</dd>
|
||||
<dt>Template appliqué</dt>
|
||||
<dd>
|
||||
@if ($template)
|
||||
<a href="{{ route('admin.templates.edit', $template) }}">{{ $template->name }}</a>
|
||||
@else — aucun (pas de template par défaut publié) — @endif
|
||||
</td></tr>
|
||||
<tr><th>Bannière</th><td>
|
||||
@else
|
||||
<span class="badge warn">aucun</span> <span class="muted">pas de template par défaut publié</span>
|
||||
@endif
|
||||
</dd>
|
||||
<dt>Bannière</dt>
|
||||
<dd>
|
||||
@if ($campaign)
|
||||
<a href="{{ route('admin.campaigns.edit', $campaign) }}">{{ $campaign->name }}</a>
|
||||
@if ($template && ! str_contains((string) $template->html_full, 'banniere'))
|
||||
<span class="badge warn">non affichée : le template n'a pas de bannière</span>
|
||||
@endif
|
||||
@else — aucune campagne en cours pour cet agent — @endif
|
||||
</td></tr>
|
||||
<tr><th>Synchronisé le</th><td class="muted">{{ $agent->synced_at?->timezone('Europe/Paris')->format('d/m/Y H:i') }}</td></tr>
|
||||
</table>
|
||||
@else
|
||||
<span class="muted">Aucune campagne en cours pour cet agent</span>
|
||||
@endif
|
||||
</dd>
|
||||
<dt>Synchronisé le</dt><dd class="muted">{{ $agent->synced_at?->timezone('Europe/Paris')->format('d/m/Y H:i') ?? '—' }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>Nouveau message</h2>
|
||||
@include('partials.signature-frame', ['html' => $full['html'] ?? ''])
|
||||
<h2 style="margin-top:16px">Réponse / transfert</h2>
|
||||
@include('partials.signature-frame', ['html' => $reply['html'] ?? ''])
|
||||
<h2 style="margin-top:18px">Réponse et transfert</h2>
|
||||
@include('partials.signature-frame', ['html' => $reply['html'] ?? '', 'class' => 'short'])
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user