From ae144588cc22ac24b7105b6c38adde7f141432a2 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 16 May 2023 18:20:24 +0200 Subject: [PATCH] wip --- .../Livewire/Project/Application/Revert.php | 9 +++++++-- .../project/application/revert.blade.php | 17 +++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/Http/Livewire/Project/Application/Revert.php b/app/Http/Livewire/Project/Application/Revert.php index f1917ef85..0008fa3b7 100644 --- a/app/Http/Livewire/Project/Application/Revert.php +++ b/app/Http/Livewire/Project/Application/Revert.php @@ -11,6 +11,10 @@ class Revert extends Component public Application $application; public $images = []; public string $current; + public function revertImage($tag) + { + dd("Reverting to {$this->application->uuid}:{$tag}"); + } public function loadImages() { try { @@ -29,11 +33,12 @@ class Revert extends Component })->map(function ($item) { $item = Str::of($item)->explode('#'); if ($item[1] === $this->current) { - $item[1] = $item[1] . " (current)"; + $is_current = true; } return [ 'tag' => $item[1], - 'createdAt' => $item[2], + 'created_at' => $item[2], + 'is_current' => $is_current ?? null, ]; })->toArray(); } catch (\Throwable $e) { diff --git a/resources/views/livewire/project/application/revert.blade.php b/resources/views/livewire/project/application/revert.blade.php index 2ca8e5e29..514238add 100644 --- a/resources/views/livewire/project/application/revert.blade.php +++ b/resources/views/livewire/project/application/revert.blade.php @@ -2,18 +2,23 @@
-
+
@forelse ($images as $image)
-
+
-
{{ data_get($image, 'tag') }}
-
{{ data_get($image, 'createdAt') }}
+
+ @if (data_get($image, 'is_current')) + LIVE + @endif + | {{ data_get($image, 'tag') }} +
+ +
{{ data_get($image, 'created_at') }}
- + Revert