Skip to content

Commit 9ec8f22

Browse files
authored
Merge pull request #3422 from codeeu/dev
Dev
2 parents 36539ed + 87bc618 commit 9ec8f22

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

app/Nova/DreamJobRoleModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function fields(Request $request): array
6464
Text::make('Pathway Map Filename', 'pathway_map_link')
6565
->nullable()
6666
->rules('nullable', 'max:255')
67-
->help('Filename in /public/docs/dream-jobs/, e.g. Career Pathway Map Anny Tubbs.pdf'),
67+
->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'),
6868

6969
Number::make('Position', 'position')
7070
->min(0)

resources/views/static/dream-jobs-in-digital-role.blade.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,15 @@
225225
(object) ['label' => $item['first_name'] . ' ' . $item['last_name'], 'href' => ''],
226226
];
227227
228+
$countryCode = strtolower(trim((string) ($item['country'] ?? '')));
229+
if ($countryCode === 'po') {
230+
$countryCode = 'pl';
231+
}
232+
$localFlagCodes = ['be', 'da', 'ei', 'fr', 'gm', 'gr', 'lo', 'sp', 'sz', 'uk'];
233+
$flagSrc = in_array($countryCode, $localFlagCodes, true)
234+
? "/images/flags/{$countryCode}-flag.svg"
235+
: "https://flagcdn.com/w80/{$countryCode}.png";
236+
228237
$hasDreamJobsPageTable = \Illuminate\Support\Facades\Schema::hasTable('dream_jobs_page');
229238
$hasDreamJobsResourcesTable = \Illuminate\Support\Facades\Schema::hasTable('dream_jobs_resources');
230239
$page = $hasDreamJobsPageTable ? \App\DreamJobsPage::config() : null;
@@ -276,7 +285,7 @@
276285
<h2 class="text-dark-blue text-3xl md:text-4xl md:leading-[44px] font-medium font-['Montserrat']">
277286
{{ $item['first_name'] }} {{ $item['last_name'] }}
278287
</h2>
279-
<img class="shadow-lg rounded w-12 h-9" width="48" src="/images/flags/{{ $item['country'] }}-flag.svg" />
288+
<img class="shadow-lg rounded w-12 h-9" width="48" src="{{ $flagSrc }}" onerror="this.style.display='none';" />
280289
</div>
281290
<div class="text-[22px] md:text-3xl text-[#333E48] font-medium font-['Montserrat'] p-0 mb-6 [&_p]:p-0 [&_p]:m-0 [&_div]:p-0 [&_div]:m-0">
282291
{!! $item['role'] !!}
@@ -322,11 +331,16 @@ class="animation-element move-background duration-[1.5s] absolute z-0 lg:-bottom
322331
<div class="absolute w-full h-full bg-light-blue hidden lg:block xl:hidden" style="clip-path: ellipse(168% 90% at 50% 90%);"></div>
323332
<div class="absolute w-full h-full bg-light-blue hidden xl:block" style="clip-path: ellipse(108% 90% at 50% 90%);"></div>
324333
<div class="codeweek-container-lg relative pt-20 pb-16 md:pt-48 md:pb-28">
334+
@php
335+
$pathwayHref = \Illuminate\Support\Str::startsWith((string) $item['pathway_map_link'], ['http://', 'https://'])
336+
? (string) $item['pathway_map_link']
337+
: '/docs/dream-jobs/' . ltrim((string) $item['pathway_map_link'], '/');
338+
@endphp
325339
<h2 class="text-dark-blue text-[22px] md:text-4xl leading-[44px] font-medium font-['Montserrat'] mb-6 md:mb-10">
326340
Explore Career Pathway
327341
</h2>
328342
<img class="rounded-xl w-full h-60 md:h-auto object-cover object-center mb-6 md:mb-12" src="/images/dream-jobs/pathway-map.png" />
329-
<a class="font-normal text-xl text-dark-blue underline" target="_blank" href="/docs/dream-jobs/{{ $item['pathway_map_link'] }}">Career Pathway Map</a>
343+
<a class="font-normal text-xl text-dark-blue underline" target="_blank" href="{{ $pathwayHref }}">Career Pathway Map</a>
330344
</div>
331345
</section>
332346
@endif

resources/views/static/dream-jobs-in-digital.blade.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,25 @@ class="w-full rounded-2xl object-cover object-center h-[calc(80vw-40px)] sm:h-au
307307
</h2>
308308
<div class="grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3 gap-6 lg:gap-8">
309309
@foreach($sortedResults as $result)
310+
@php
311+
$countryCode = strtolower(trim((string) ($result['country'] ?? '')));
312+
if ($countryCode === 'po') {
313+
$countryCode = 'pl';
314+
}
315+
$localFlagCodes = ['be', 'da', 'ei', 'fr', 'gm', 'gr', 'lo', 'sp', 'sz', 'uk'];
316+
$flagSrc = in_array($countryCode, $localFlagCodes, true)
317+
? "/images/flags/{$countryCode}-flag.svg"
318+
: "https://flagcdn.com/w80/{$countryCode}.png";
319+
@endphp
310320
<div class="p-4 rounded-2xl border-2 border-solid border-[#A4B8D9] flex flex-col gap-4 md:gap-8 bg-white">
311321
<div class="flex flex-1 items-start gap-4 md:gap-8">
312322
<div class="relative w-32 flex-shrink-0">
313323
<img
314324
class="block w-32 h-32 object-cover object-center rounded-lg"
315325
src="{{ $result['image'] }}"
316326
/>
317-
<img class="absolute w-[26px] h-auto object-center bottom-2.5 right-2.5 shadow-lg rounded-sm" src="/images/flags/{{ $result['country'] }}-flag.svg" />
327+
<img class="absolute w-[26px] h-auto object-center bottom-2.5 right-2.5 shadow-lg rounded-sm"
328+
src="{{ $flagSrc }}" onerror="this.style.display='none';" />
318329
</div>
319330
<div class="flex flex-1 flex-col justify-between h-full">
320331
<div class="flex-grow">

0 commit comments

Comments
 (0)