From 0417a6698a649d328eaf8d277dbcaad44732117e Mon Sep 17 00:00:00 2001 From: Saufi Date: Mon, 18 May 2026 21:32:27 +0800 Subject: [PATCH] feat: susun semula layout urus template sijil MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Panduan Template di bahagian atas, boleh lipat/kembang - Template Aktif (kiri) bersebelahan Konfigurasi Teks (kanan) — col-lg-6 - Auto-detect portrait/landscape dari naturalWidth/naturalHeight imej - Portrait: max-height 520px | Landscape: max-height 340px - Badge orientasi (hijau=Landscape, biru=Portrait) dalam header kad - Laras tinggi juga untuk pratonton upload form Co-Authored-By: Claude Sonnet 4.6 --- .../admin/programs/template/show.blade.php | 253 +++++++++++++----- 1 file changed, 183 insertions(+), 70 deletions(-) diff --git a/resources/views/admin/programs/template/show.blade.php b/resources/views/admin/programs/template/show.blade.php index 4004b90..c86ad57 100644 --- a/resources/views/admin/programs/template/show.blade.php +++ b/resources/views/admin/programs/template/show.blade.php @@ -17,14 +17,71 @@ @section('content') -
- {{-- Left: Current template --}} -
+@php + $config = $template?->config_json ?? []; + $fields = $config['fields'] ?? []; + $imgWidth = $config['width'] ?? 0; + $imgHeight = $config['height'] ?? 0; + $isPortrait = $imgHeight > $imgWidth && $imgWidth > 0; +@endphp - @if($template) -
+{{-- ── Panduan Template (atas, boleh lipat) ────────────────────────────── --}} +
+ +
+
+
+
+
+ +
+ Resolusi disyorkan 1754 × 1240px (A4 landscape 150dpi) + atau 1240 × 1754px (portrait). +
+
+
+
+
+ +
+ Koordinat (0, 0) adalah sudut kiri atas imej. + X bertambah ke kanan, Y bertambah ke bawah. +
+
+
+
+
+ +
+ Guna butang Pratonton untuk semak kedudukan teks + sebelum jana sijil sebenar. +
+
+
+
+
+
+
+ +@if($template) + +{{-- ── Template Aktif (kiri) + Konfigurasi (kanan) ─────────────────────── --}} +
+ + {{-- Kiri: Template Aktif --}} +
+
-
Template Aktif
+
+
Template Aktif
+ + {{ $isPortrait ? 'Portrait' : ($imgWidth > 0 ? 'Landscape' : '—') }} + +
@csrf @method('DELETE') @@ -33,52 +90,64 @@
-
-
-
- Template Preview -
-
{{ $template->original_filename }}
+
+ + {{-- Image viewer — tinggi berubah ikut orientasi --}} +
+ Template Preview +
+
+ {{ $template->original_filename }} + @if($imgWidth > 0) +  · {{ $imgWidth }} × {{ $imgHeight }} px + @endif
- {{-- Test Generate --}} -
- + {{-- Jana Pratonton --}} +
+
-
+
+
- {{-- Config Editor --}} -
+ {{-- Kanan: Konfigurasi Kedudukan Teks --}} +
+
Konfigurasi Kedudukan Teks
- @php $config = $template->config_json ?? []; $fields = $config['fields'] ?? []; @endphp +

+ Koordinat X dan Y dikira dari sudut kiri atas imej (piksel). + @if($imgWidth > 0) + Saiz imej: {{ $imgWidth }} × {{ $imgHeight }} px. + @endif +

+
@csrf @method('PUT') -

- Koordinat X dan Y dikira dari sudut kiri atas imej (piksel). - Imej template: {{ $config['width'] ?? '—' }} × {{ $config['height'] ?? '—' }} piksel. -

- - {{-- Name field --}} + {{-- Nama Peserta --}}
Nama Peserta @@ -86,12 +155,12 @@
- +
- +
@@ -102,7 +171,8 @@
-
@@ -117,9 +187,9 @@
- {{-- Certificate No (optional) --}} + {{-- No. Sijil (pilihan) --}}
-
+
No. Sijil (Pilihan)
Papar
-
+
- +
- +
@@ -147,7 +218,8 @@
-
@@ -168,9 +240,15 @@
+
- @else - {{-- Upload Form --}} +
+ +@else + +{{-- Tiada template — form upload --}} +
+
Muat Naik Template Sijil
@@ -178,11 +256,13 @@
- Muat naik imej template sijil dalam format JPG atau PNG. - Saiz maksimum: 10MB. Resolusi disyorkan: 1754 × 1240px (A4 landscape 150dpi). + Format JPG atau PNG, maksimum 10MB. + Resolusi disyorkan: 1754 × 1240px (A4 landscape) atau + 1240 × 1754px (portrait).
-
+ @csrf
@@ -195,7 +275,7 @@
-
+
preview
@@ -206,46 +286,79 @@
- @endif - -
- - {{-- Right: Tips --}} -
-
-
-
Panduan Template
-
    -
  • Gunakan imej resolusi tinggi (≥1600px lebar) untuk hasil cetak berkualiti.
  • -
  • Pastikan ruang untuk nama peserta tidak dihalang oleh grafik template.
  • -
  • Koordinat (0,0) adalah sudut kiri atas imej.
  • -
  • Gunakan butang Pratonton untuk menyemak kedudukan teks sebelum jana sijil sebenar.
  • -
  • Sijil dijana dalam format JPG.
  • -
-
-
+@endif + @endsection @push('scripts')