diff --git a/app/Nova/DreamJobRoleModel.php b/app/Nova/DreamJobRoleModel.php index 82ccedf7e..a5c857350 100644 --- a/app/Nova/DreamJobRoleModel.php +++ b/app/Nova/DreamJobRoleModel.php @@ -64,7 +64,7 @@ public function fields(Request $request): array Text::make('Pathway Map Filename', 'pathway_map_link') ->nullable() ->rules('nullable', 'max:255') - ->help('Filename in /public/docs/dream-jobs/, e.g. Career Pathway Map Anny Tubbs.pdf'), + ->help('Either a full URL (e.g. S3 link) OR a filename in /public/docs/dream-jobs/, e.g. Career Pathway Map Anny Tubbs.pdf'), Number::make('Position', 'position') ->min(0) diff --git a/resources/views/static/dream-jobs-in-digital-role.blade.php b/resources/views/static/dream-jobs-in-digital-role.blade.php index 65c899015..c8b2bafa5 100644 --- a/resources/views/static/dream-jobs-in-digital-role.blade.php +++ b/resources/views/static/dream-jobs-in-digital-role.blade.php @@ -225,6 +225,15 @@ (object) ['label' => $item['first_name'] . ' ' . $item['last_name'], 'href' => ''], ]; + $countryCode = strtolower(trim((string) ($item['country'] ?? ''))); + if ($countryCode === 'po') { + $countryCode = 'pl'; + } + $localFlagCodes = ['be', 'da', 'ei', 'fr', 'gm', 'gr', 'lo', 'sp', 'sz', 'uk']; + $flagSrc = in_array($countryCode, $localFlagCodes, true) + ? "/images/flags/{$countryCode}-flag.svg" + : "https://flagcdn.com/w80/{$countryCode}.png"; + $hasDreamJobsPageTable = \Illuminate\Support\Facades\Schema::hasTable('dream_jobs_page'); $hasDreamJobsResourcesTable = \Illuminate\Support\Facades\Schema::hasTable('dream_jobs_resources'); $page = $hasDreamJobsPageTable ? \App\DreamJobsPage::config() : null; @@ -276,7 +285,7 @@

{{ $item['first_name'] }} {{ $item['last_name'] }}

- +
{!! $item['role'] !!} @@ -322,11 +331,16 @@ class="animation-element move-background duration-[1.5s] absolute z-0 lg:-bottom
+ @php + $pathwayHref = \Illuminate\Support\Str::startsWith((string) $item['pathway_map_link'], ['http://', 'https://']) + ? (string) $item['pathway_map_link'] + : '/docs/dream-jobs/' . ltrim((string) $item['pathway_map_link'], '/'); + @endphp

Explore Career Pathway

- Career Pathway Map + Career Pathway Map
@endif diff --git a/resources/views/static/dream-jobs-in-digital.blade.php b/resources/views/static/dream-jobs-in-digital.blade.php index cd2aa9d1e..60843e279 100644 --- a/resources/views/static/dream-jobs-in-digital.blade.php +++ b/resources/views/static/dream-jobs-in-digital.blade.php @@ -307,6 +307,16 @@ class="w-full rounded-2xl object-cover object-center h-[calc(80vw-40px)] sm:h-au
@foreach($sortedResults as $result) + @php + $countryCode = strtolower(trim((string) ($result['country'] ?? ''))); + if ($countryCode === 'po') { + $countryCode = 'pl'; + } + $localFlagCodes = ['be', 'da', 'ei', 'fr', 'gm', 'gr', 'lo', 'sp', 'sz', 'uk']; + $flagSrc = in_array($countryCode, $localFlagCodes, true) + ? "/images/flags/{$countryCode}-flag.svg" + : "https://flagcdn.com/w80/{$countryCode}.png"; + @endphp
@@ -314,7 +324,8 @@ class="w-full rounded-2xl object-cover object-center h-[calc(80vw-40px)] sm:h-au class="block w-32 h-32 object-cover object-center rounded-lg" src="{{ $result['image'] }}" /> - +