Skip to content

Commit 251726c

Browse files
authored
Merge pull request #3521 from codeeu/feature/ddp-training-resource
Add DDP training resource layout controls for preview setup.
2 parents 96ce715 + 009b93f commit 251726c

8 files changed

Lines changed: 352 additions & 36 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ vue-i18n-locales.generated.js
3030
vite.config.js
3131
.DS_Store
3232
resources/excel/example.xlsx
33+
resources/ai-agent-plans/*

app/Nova/TrainingResource.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,22 @@ public function fields(Request $request): array
8282
->nullable()
8383
->help('Optional pill text in the header banner'),
8484

85+
Text::make('Hero button text', 'hero_button_text')
86+
->nullable()
87+
->help('Optional primary CTA shown in the hero section.'),
88+
89+
Text::make('Hero button URL', 'hero_button_url')
90+
->nullable()
91+
->help('Supports full URLs, root-relative paths, or #anchors.'),
92+
93+
Text::make('Hero secondary button text', 'hero_secondary_button_text')
94+
->nullable()
95+
->help('Optional outline CTA shown beside the hero primary button.'),
96+
97+
Text::make('Hero secondary button URL', 'hero_secondary_button_url')
98+
->nullable()
99+
->help('Supports full URLs, root-relative paths, or #anchors.'),
100+
85101
Trix::make('Intro', 'intro')
86102
->nullable()
87103
->help('Optional intro block shown above the main content'),
@@ -126,6 +142,16 @@ public function fields(Request $request): array
126142
->nullable()
127143
->help('Optional text shown in a highlighted callout box (register on map, hashtags, etc).'),
128144

145+
Trix::make('About box section', 'about_box_section')
146+
->nullable()
147+
->help('Optional blue info card shown below register box (supports heading, text, lists).'),
148+
149+
Number::make('Anchor offset', 'anchor_offset')
150+
->min(0)
151+
->step(1)
152+
->nullable()
153+
->help('Optional scroll offset in pixels for in-page anchor links (useful with sticky headers).'),
154+
129155
Text::make('Button text', 'button_text')->nullable(),
130156

131157
Text::make('Button URL', 'button_url')

app/TrainingResource.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ class TrainingResource extends Model
1717
'card_image',
1818
'page_title',
1919
'hero_author',
20+
'hero_button_text',
21+
'hero_button_url',
22+
'hero_secondary_button_text',
23+
'hero_secondary_button_url',
2024
'intro',
2125
'highlight_box',
2226
'video_url',
@@ -28,6 +32,8 @@ class TrainingResource extends Model
2832
'pdf_links_section',
2933
'contacts_section',
3034
'register_box_section',
35+
'about_box_section',
36+
'anchor_offset',
3137
'button_text',
3238
'button_url',
3339
'secondary_button_text',
@@ -43,6 +49,7 @@ class TrainingResource extends Model
4349
protected $casts = [
4450
'active' => 'boolean',
4551
'position' => 'integer',
52+
'anchor_offset' => 'integer',
4653
];
4754

4855
public function scopeActive($query)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('training_resources', function (Blueprint $table) {
15+
$table->string('hero_button_text')->nullable()->after('hero_author');
16+
$table->string('hero_button_url')->nullable()->after('hero_button_text');
17+
$table->string('hero_secondary_button_text')->nullable()->after('hero_button_url');
18+
$table->string('hero_secondary_button_url')->nullable()->after('hero_secondary_button_text');
19+
});
20+
}
21+
22+
/**
23+
* Reverse the migrations.
24+
*/
25+
public function down(): void
26+
{
27+
Schema::table('training_resources', function (Blueprint $table) {
28+
$table->dropColumn([
29+
'hero_button_text',
30+
'hero_button_url',
31+
'hero_secondary_button_text',
32+
'hero_secondary_button_url',
33+
]);
34+
});
35+
}
36+
};
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('training_resources', function (Blueprint $table) {
15+
$table->longText('about_box_section')->nullable()->after('register_box_section');
16+
$table->unsignedInteger('anchor_offset')->nullable()->after('about_box_section');
17+
});
18+
}
19+
20+
/**
21+
* Reverse the migrations.
22+
*/
23+
public function down(): void
24+
{
25+
Schema::table('training_resources', function (Blueprint $table) {
26+
$table->dropColumn([
27+
'about_box_section',
28+
'anchor_offset',
29+
]);
30+
});
31+
}
32+
};
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?php
2+
3+
namespace Database\Seeders;
4+
5+
use App\TrainingResource;
6+
use Illuminate\Database\Seeder;
7+
8+
class TrainingResourceDiscoverDigitalProgrammeSeeder extends Seeder
9+
{
10+
/**
11+
* Seed a ready-to-edit Discover Digital Programme training resource.
12+
*/
13+
public function run(): void
14+
{
15+
TrainingResource::updateOrCreate(
16+
['slug' => 'discover-digital-programme'],
17+
[
18+
'card_title' => 'Discover Digital Programme',
19+
'card_author' => 'Code4Europe | Deliverable D4.2 | Public toolkit',
20+
// Temporary thumbnail until final artwork is provided.
21+
'card_image' => '/images/banner_training.svg',
22+
'page_title' => 'Discover Digital Programme',
23+
'hero_author' => 'Code4Europe | Deliverable D4.2 | Public toolkit',
24+
'hero_button_text' => 'Open the complete toolkit',
25+
'hero_button_url' => 'https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/DDP_toolkit.pdf',
26+
'hero_secondary_button_text' => 'Get the one-pagers pack',
27+
'hero_secondary_button_url' => '#key-one-pagers',
28+
'intro' => <<<HTML
29+
<p>A practical toolkit for higher education institutions (HEIs) with an ICT and STEM focus to engage secondary school students through school visits, campus experiences, and digital outreach, supporting learners in the senior cycle of secondary education to imagine themselves in technology careers and understand the academic pathways that will lead them there.</p>
30+
HTML,
31+
'content' => <<<HTML
32+
<h2>How the toolkit works</h2>
33+
<p>The toolkit is organised as a flexible, non-prescriptive set of steps and formats. It structures engagement into two mirroring frameworks: <strong>STEM On Tour</strong> (bringing higher education into schools and community settings) and <strong>STEM In</strong> (bringing students into a higher education institution through campus visits, open days, and themed events). HEIs may implement either framework independently or combine both for greater impact.</p>
34+
<h3>Start here</h3>
35+
<ol>
36+
<li>Establish essential preparation (contacts + GDPR).</li>
37+
<li>Choose your delivery format: STEM On Tour and/or STEM In.</li>
38+
<li>Plan evaluation and feedback to measure outcomes.</li>
39+
<li>Use digital outreach and communication to build awareness and follow-up.</li>
40+
</ol>
41+
<div style="margin-top: 2.25rem;">
42+
<h2>Roadmap</h2>
43+
<p>Use this roadmap if you do not have time to read the full deliverable. The one-pagers mirror the toolkit flow and provide a practical checklist for implementation.</p>
44+
<a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/DDP_toolkit_roadmap.pdf" target="_blank" rel="noopener noreferrer">
45+
<img src="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/DDP_toolkit_roadmap.svg" alt="Discover Digital Programme roadmap" />
46+
</a>
47+
</div>
48+
HTML,
49+
'body_image' => null,
50+
'body_image_alt' => 'Discover Digital Programme roadmap',
51+
'pdf_links_section' => <<<HTML
52+
<h2 id="key-one-pagers">Key one-pagers</h2>
53+
<p>These documents summarise the main operational parts of the toolkit.</p>
54+
<ul>
55+
<li><a href="https://codeweek-s3.s3.eu-west-1.amazonaws.com/files/Essential_Preparation_for_STEM_Engagement+Activities.pdf" target="_blank" rel="noopener noreferrer">Essential Preparation for STEM Engagement Activities</a></li>
56+
<li><a href="https://codeweek-s3.s3.eu-west-1.amazonaws.com/files/STEM_On_Tour.pdf" target="_blank" rel="noopener noreferrer">STEM On Tour</a></li>
57+
<li><a href="https://codeweek-s3.s3.eu-west-1.amazonaws.com/files/STEM_In.pdf" target="_blank" rel="noopener noreferrer">STEM In</a></li>
58+
<li><a href="https://codeweek-s3.s3.eu-west-1.amazonaws.com/files/Evaluation_and_Feedback.pdf" target="_blank" rel="noopener noreferrer">Evaluation and Feedback</a></li>
59+
<li><a href="https://codeweek-s3.s3.eu-west-1.amazonaws.com/files/Digital_Outreach_and_Communication.pdf" target="_blank" rel="noopener noreferrer">Digital Outreach and Communication</a></li>
60+
</ul>
61+
<h2>Useful detail info</h2>
62+
<p>These documents provide the supporting operational detail referenced in the key one-pagers.</p>
63+
<ul>
64+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/01_Register_of_Processing_Activities.pdf" target="_blank" rel="noopener noreferrer">1 - Register of Processing Activities</a></li>
65+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/02_STEM_On_Tour-Roles_and_Responsibilities.pdf" target="_blank" rel="noopener noreferrer">2 - STEM On Tour - Roles and Responsibilities</a></li>
66+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/03_STEM_On_Tour-Implementation_Timeline.pdf" target="_blank" rel="noopener noreferrer">3 - STEM On Tour - Implementation Timeline</a></li>
67+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/04_STEM_In_Roles_and_Responsibilities.pdf" target="_blank" rel="noopener noreferrer">4 - STEM In Roles and Responsibilities</a></li>
68+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/05_STEM_In-Implementation_Timeline.pdf" target="_blank" rel="noopener noreferrer">5 - STEM In - Implementation Timeline</a></li>
69+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/06_Evaluation_and_Feedback-Scoreboard.pdf" target="_blank" rel="noopener noreferrer">6 - Evaluation and Feedback - Scoreboard</a></li>
70+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/07_Digital_Outreach_and_Communication-Schedule.pdf" target="_blank" rel="noopener noreferrer">7 - Digital Outreach and Communication - Schedule</a></li>
71+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/08_Questionnaires_Examples.pdf" target="_blank" rel="noopener noreferrer">8 - Questionnaires Examples</a></li>
72+
<li><a href="https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/09_HEI_Presentation_Guide.pdf" target="_blank" rel="noopener noreferrer">9 - HEI Presentation Guide</a></li>
73+
<li><a href="https://codeweek-s3.s3.eu-west-1.amazonaws.com/files/HEI_presentation_template.pptx" target="_blank" rel="noopener noreferrer">10 - HEI Presentation Template</a></li>
74+
</ul>
75+
HTML,
76+
'button_text' => 'Open the complete toolkit',
77+
'button_url' => 'https://codeweek-resources.s3.eu-west-1.amazonaws.com/+discover-digital-toolkit/DDP_toolkit.pdf',
78+
'secondary_button_text' => 'Download printable materials',
79+
'secondary_button_url' => '#key-one-pagers',
80+
'contacts_section' => null,
81+
'register_box_section' => <<<HTML
82+
<h2>Share your activity and build the pipeline</h2>
83+
<p>Register school visits, campus visits, open days, workshops, and outreach actions on the EU Code Week platform to support visibility, coordination, and cumulative impact across the ecosystem.</p>
84+
HTML,
85+
'about_box_section' => <<<HTML
86+
<h2>About this toolkit</h2>
87+
<p>The programme serves as a bridge between secondary and higher education at a critical stage in the student journey. It addresses two common challenges: students who feel overwhelmed by the range of choices available and students who disengage because higher education feels distant or irrelevant. The toolkit provides structured guidance, adaptable frameworks and models, and opportunities to experience what a future educational path in STEM can look and feel like, while also engaging families and key stakeholders within secondary education.</p>
88+
<h3>At a glance</h3>
89+
<ul>
90+
<li>Designed for HEIs specialising in ICT and STEM that engage directly with secondary schools to raise awareness of degree opportunities and inspire interest in advanced digital careers among secondary school students.</li>
91+
<li>Promotes a combination of activities such as campus visits, discovery days, and digital career orientation sessions that together provide a well-rounded experience and help students to gain first-hand insight into both the academic and social environment, and to raise awareness about the opportunities offered by higher education.</li>
92+
<li>Includes guidance for outreach, logistics, materials, evaluation, and digital communication.</li>
93+
</ul>
94+
HTML,
95+
'anchor_offset' => 120,
96+
'third_button_text' => 'Register an activity',
97+
'third_button_url' => 'https://codeweek.eu/add?skip=1',
98+
'meta_title' => 'Discover Digital Programme - Toolkit',
99+
'meta_description' => 'A practical toolkit for HEIs to engage secondary school students through STEM outreach, campus experiences, and digital communication.',
100+
'position' => 50,
101+
// Keep unpublished so it is visible only via signed preview URL.
102+
'active' => false,
103+
]
104+
);
105+
}
106+
}

resources/views/codingathome/banner.blade.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
@php
22
$author = $author ?? 'By EUCodeWeek';
3+
$primaryButtonText = $primaryButtonText ?? null;
4+
$primaryButtonUrl = $primaryButtonUrl ?? null;
5+
$secondaryButtonText = $secondaryButtonText ?? null;
6+
$secondaryButtonUrl = $secondaryButtonUrl ?? null;
7+
$isExternalLink = static function (?string $url): bool {
8+
$url = trim((string) $url);
9+
10+
return \Illuminate\Support\Str::startsWith($url, ['http://', 'https://', '//']);
11+
};
312
@endphp
413

514
<section class="relative flex overflow-hidden">
@@ -10,6 +19,30 @@
1019
<h2 class="text-[#1C4DA1] text-[30px] md:text-[60px] leading-9 md:leading-[72px] font-normal font-['Montserrat'] mb-4 max-md:max-w-full max-w-[532px]">
1120
{{$title}}
1221
</h2>
22+
@if(!empty($primaryButtonText) && !empty($primaryButtonUrl))
23+
<div class="mt-6 flex flex-wrap items-center gap-4">
24+
<a
25+
class="inline-block bg-[#F95C22] rounded-full py-2.5 px-6 font-['Blinker'] hover:bg-hover-orange duration-300 text-base font-semibold leading-7 text-black normal-case"
26+
href="{{ $primaryButtonUrl }}"
27+
@if($isExternalLink($primaryButtonUrl))
28+
target="_blank" rel="noopener noreferrer"
29+
@endif
30+
>
31+
{{ $primaryButtonText }}
32+
</a>
33+
@if(!empty($secondaryButtonText) && !empty($secondaryButtonUrl))
34+
<a
35+
class="inline-block rounded-full py-2.5 px-6 border border-[#1C4DA1] text-[#1C4DA1] font-['Blinker'] text-base font-semibold leading-7 normal-case hover:bg-[#1C4DA1] hover:text-white duration-300"
36+
href="{{ $secondaryButtonUrl }}"
37+
@if($isExternalLink($secondaryButtonUrl))
38+
target="_blank" rel="noopener noreferrer"
39+
@endif
40+
>
41+
{{ $secondaryButtonText }}
42+
</a>
43+
@endif
44+
</div>
45+
@endif
1346
@if ($author)
1447
<div class="absolute top-0 -translate-y-1/2 bg-yellow py-3 md:py-4 px-8 md:px-10 rounded-full text-secondary font-semibold text-[16px] leading-[22px] max-w-[80%]">
1548
{{$author}}

0 commit comments

Comments
 (0)