Files
Vasyka 7077fff3b3 feat(i18n): convert 38 hardcoded static labels + safe blade wrap + 226 keys
- Convert all remaining static \$modelLabel/\$pluralModelLabel to getter
  methods with __() (AppointmentResource, WorkOrderResource, MasterResource,
  ServiceTemplateResource, LaborResource, and 33 others)
- Safe blade wrap v2 (37 files, 201 wraps): fixed the regex to not match
  `->`, `=>`, `!<` — previous aggressive pass broke @if directives
- Bulk-translate lowercase model-label keys (programări, fișe lucru,
  tehnicieni, șabloane servicii, norme-ore, etc.) — these were the RO
  strings appearing in page titles/breadcrumbs
- Add human RU/EN for mechanic-kpi (Mecanic/Lucrări/Norma ore/etc.)
  and calendar-board words

Tests 306 green. Blade compiles cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-15 06:17:10 +00:00

56 lines
2.8 KiB
PHP

<x-filament-panels::page>
@php $rows = $this->getRows(); @endphp
<style>
.kpi-toolbar { display:flex; align-items:center; gap:12px; margin-bottom:18px; background:white; padding:12px 16px; border-radius:8px; border:1px solid #e2e8f0; }
.dark .kpi-toolbar { background:#1f2937; border-color:#374151; }
.kpi-period { font-size:16px; font-weight:600; min-width:200px; text-align:center; }
.kpi-btn { padding:6px 12px; border:1px solid #cbd5e1; border-radius:6px; background:white; cursor:pointer; }
.kpi-table { width:100%; border-collapse:collapse; background:white; border-radius:8px; overflow:hidden; border:1px solid #e2e8f0; }
.dark .kpi-table { background:#1f2937; border-color:#374151; }
.kpi-table th, .kpi-table td { padding:10px 14px; text-align:left; border-bottom:1px solid #e2e8f0; }
.kpi-table th { background:#f7fafc; font-size:12px; text-transform:uppercase; letter-spacing:.3px; color:#4a5568; }
.kpi-table tr:last-child td { border-bottom:none; }
.kpi-badge { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; font-weight:600; }
.kpi-green { background:#dcfce7; color:#15803d; }
.kpi-amber { background:#fef3c7; color:#92400e; }
.kpi-red { background:#fee2e2; color:#991b1b; }
.kpi-gray { background:#f1f5f9; color:#475569; }
.kpi-empty { padding:32px; text-align:center; color:#718096; }
</style>
<div class="kpi-toolbar">
<button class="kpi-btn" wire:click="shiftMonth(-1)">{{ __('◀ Luna precedentă') }}</button>
<div class="kpi-period">{{ $this->getPeriodLabel() }}</div>
<button class="kpi-btn" wire:click="shiftMonth(1)">{{ __('Luna următoare ▶') }}</button>
</div>
@if (empty($rows))
<div class="kpi-empty">{{ __('Niciun mecanic nu a finalizat lucrări în această perioadă.') }}</div>
@else
<table class="kpi-table">
<thead>
<tr>
<th>{{ __('Mecanic') }}</th>
<th>{{ __('Lucrări') }}</th>
<th>{{ __('Norma ore') }}</th>
<th>{{ __('Real ore') }}</th>
<th>{{ __('Eficiență') }}</th>
<th>{{ __('Venit manopere') }}</th>
</tr>
</thead>
<tbody>
@foreach ($rows as $r)
<tr>
<td style="font-weight:600">{{ $r['master_name'] }}</td>
<td>{{ $r['tasks_done'] }}</td>
<td>{{ $r['norm_hours'] }}</td>
<td>{{ $r['actual_hours'] }}</td>
<td>@if ($r['efficiency_pct'] !== null)<span class="kpi-badge kpi-{{ $r['efficiency_class'] }}">{{ $r['efficiency_pct'] }}%</span>@else <span class="kpi-badge kpi-gray"></span>@endif</td>
<td>{{ number_format($r['revenue'], 0, '.', ' ') }} MDL</td>
</tr>
@endforeach
</tbody>
</table>
@endif
</x-filament-panels::page>