From efe9ad32561b7d691b7a756a1164f602bc631455 Mon Sep 17 00:00:00 2001 From: Anthony Clark Date: Fri, 17 May 2024 12:22:42 -0700 Subject: [PATCH 1/3] Include additional on/off view context --- public/assets/twill/css/custom.css | 21 +++++++++++++++++++++ resources/views/admin/directory.blade.php | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/public/assets/twill/css/custom.css b/public/assets/twill/css/custom.css index dadc4d3..27e8a99 100644 --- a/public/assets/twill/css/custom.css +++ b/public/assets/twill/css/custom.css @@ -284,6 +284,11 @@ ol, margin-bottom: 0.25rem; } +.custom :is(.my-4) { + margin-top: 1rem; + margin-bottom: 1rem; +} + .custom :is(.mb-1) { margin-bottom: 0.25rem; } @@ -360,6 +365,10 @@ ol, display: none; } +.custom :is(.h-1) { + height: 0.25rem; +} + .custom :is(.h-12) { height: 3rem; } @@ -424,6 +433,14 @@ ol, cursor: pointer; } +.custom :is(.list-inside) { + list-style-position: inside; +} + +.custom :is(.list-disc) { + list-style-type: disc; +} + .custom :is(.grid-cols-2) { grid-template-columns: repeat(2, minmax(0, 1fr)); } @@ -506,6 +523,10 @@ ol, border-radius: 0.375rem; } +.custom :is(.\!border-2) { + border-width: 2px !important; +} + .custom :is(.border) { border-width: 1px; } diff --git a/resources/views/admin/directory.blade.php b/resources/views/admin/directory.blade.php index cb31888..c7924a8 100644 --- a/resources/views/admin/directory.blade.php +++ b/resources/views/admin/directory.blade.php @@ -6,6 +6,10 @@ @section('customPageContent')
+

+ ✅ / ❌ indicates the artwork is on or off view. For artwork to appear in JourneyMaker it must be on view, have all translations, and not be in Regenstein Hall. +

+
@foreach($themes as $theme)
From 5c73cda5fcbd79e5747bf5304d641aa83619e046 Mon Sep 17 00:00:00 2001 From: Anthony Clark Date: Fri, 17 May 2024 12:30:13 -0700 Subject: [PATCH 2/3] Update note to include 'published' --- resources/views/admin/directory.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/admin/directory.blade.php b/resources/views/admin/directory.blade.php index c7924a8..deb7cab 100644 --- a/resources/views/admin/directory.blade.php +++ b/resources/views/admin/directory.blade.php @@ -7,7 +7,7 @@ @section('customPageContent')

- ✅ / ❌ indicates the artwork is on or off view. For artwork to appear in JourneyMaker it must be on view, have all translations, and not be in Regenstein Hall. + ✅ / ❌ indicates the artwork is on or off view. For artwork to appear in JourneyMaker it must be on view, not in Regenstein Hall, have all translations, and be published.


@foreach($themes as $theme) From 40cdb941108db568f44f02bfee2a8ce1c0dbe0c9 Mon Sep 17 00:00:00 2001 From: Anthony Clark Date: Fri, 17 May 2024 14:50:08 -0700 Subject: [PATCH 3/3] Update on/off view to on/off JourneyMaker --- app/Models/Artwork.php | 28 +++++++++++++++++++++++ app/Models/ThemePrompt.php | 11 +++++++++ public/assets/twill/css/custom.css | 21 ----------------- resources/views/admin/directory.blade.php | 9 +++----- 4 files changed, 42 insertions(+), 27 deletions(-) diff --git a/app/Models/Artwork.php b/app/Models/Artwork.php index 17a6786..75d54cb 100644 --- a/app/Models/Artwork.php +++ b/app/Models/Artwork.php @@ -11,6 +11,7 @@ use App\Libraries\Api\Builders\ApiQueryBuilder; use Exception; use Illuminate\Contracts\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasManyThrough; @@ -164,6 +165,33 @@ public function scopeOffView(Builder $query): void $query->where('is_on_view', false); } + protected function onJourneyMaker(): Attribute + { + return Attribute::make( + get: fn () => $this->is_on_view + && $this->gallery_id != 2147475902 + && $this->published + && $this->translations->reject(fn ($translation) => $translation->active)->isEmpty() + && $this->themePrompts->reject(fn ($prompt) => $prompt->on_journey_maker)->isEmpty(), + ); + } + + protected function offJourneyMakerReasons(): Attribute + { + return Attribute::make( + get: fn () => collect([ + 'Off View' => ! $this->is_on_view, + 'Unpublished' => ! $this->published, + 'Missing Translations' => $this->translations->reject(fn ($translation) => $translation->active)->isNotEmpty(), + 'In Regenstein Hall' => $this->gallery_id == 2147475902, + 'Not Included in Visible Prompt' => $this->themePrompts->reject(fn ($prompt) => $prompt->on_journey_maker)->isNotEmpty(), + ]) + ->filter(fn ($reason) => $reason) + ->keys() + ->join(', '), + ); + } + public function defaultCmsImage($params = []) { // If requesting a thumbnail, return the thumbnail image diff --git a/app/Models/ThemePrompt.php b/app/Models/ThemePrompt.php index bd13075..a2dc97e 100644 --- a/app/Models/ThemePrompt.php +++ b/app/Models/ThemePrompt.php @@ -8,6 +8,7 @@ use A17\Twill\Models\Behaviors\Sortable; use A17\Twill\Models\Model; use Illuminate\Contracts\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; class ThemePrompt extends Model implements Sortable @@ -50,4 +51,14 @@ public function scopeActive(Builder $query): void ->published() ->whereDoesntHave('translations', fn (Builder $query) => $query->where('active', false)); } + + protected function onJourneyMaker(): Attribute + { + return Attribute::make( + get: fn () => $this->published + && $this->translations->reject(fn ($translation) => $translation->active)->isEmpty() + && $this->theme->published + && $this->theme->translations->reject(fn ($translation) => $translation->active)->isEmpty(), + ); + } } diff --git a/public/assets/twill/css/custom.css b/public/assets/twill/css/custom.css index 27e8a99..dadc4d3 100644 --- a/public/assets/twill/css/custom.css +++ b/public/assets/twill/css/custom.css @@ -284,11 +284,6 @@ ol, margin-bottom: 0.25rem; } -.custom :is(.my-4) { - margin-top: 1rem; - margin-bottom: 1rem; -} - .custom :is(.mb-1) { margin-bottom: 0.25rem; } @@ -365,10 +360,6 @@ ol, display: none; } -.custom :is(.h-1) { - height: 0.25rem; -} - .custom :is(.h-12) { height: 3rem; } @@ -433,14 +424,6 @@ ol, cursor: pointer; } -.custom :is(.list-inside) { - list-style-position: inside; -} - -.custom :is(.list-disc) { - list-style-type: disc; -} - .custom :is(.grid-cols-2) { grid-template-columns: repeat(2, minmax(0, 1fr)); } @@ -523,10 +506,6 @@ ol, border-radius: 0.375rem; } -.custom :is(.\!border-2) { - border-width: 2px !important; -} - .custom :is(.border) { border-width: 1px; } diff --git a/resources/views/admin/directory.blade.php b/resources/views/admin/directory.blade.php index deb7cab..1c1d360 100644 --- a/resources/views/admin/directory.blade.php +++ b/resources/views/admin/directory.blade.php @@ -6,10 +6,6 @@ @section('customPageContent')
-

- ✅ / ❌ indicates the artwork is on or off view. For artwork to appear in JourneyMaker it must be on view, not in Regenstein Hall, have all translations, and be published. -

-
@foreach($themes as $theme)
@@ -52,8 +48,9 @@
{{ $artwork->artwork->artist }} - - {{ $artwork->artwork->is_on_view? '✅' : '❌' }} + + {{ $artwork->artwork->on_journey_maker? '✅' : '❌' }} + {{ $artwork->artwork->off_journey_maker_reasons }} @endforeach