Skip to content
Merged

Dev #3518

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions app/CsrCampaignPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,33 @@ public function resources()

public static function config(): self
{
$defaults = [
'use_dynamic_content' => false,
'hero_text' => __('csr-campaign.landing_header'),
'primary_cta_text' => __('csr-campaign.get_involved'),
'primary_cta_link' => 'https://codeweek.eu/blog/futurereadycsr-campaign-launch',
'secondary_cta_text' => __('csr-campaign.explore_resources'),
'secondary_cta_link' => 'https://codeweek.eu/blog/futurereadycsr-resources',
'about_title' => __('csr-campaign.about_title'),
'about_description' => __('csr-campaign.about_description'),
'resources_title' => __('csr-campaign.resources'),
];

$page = self::first();
if ($page) {
$dirty = false;
foreach ($defaults as $key => $value) {
if ($page->{$key} === null || $page->{$key} === '') {
$page->{$key} = $value;
$dirty = true;
}
}
if ($dirty) {
$page->save();
}
return $page;
}

return self::create([
'use_dynamic_content' => false,
'primary_cta_link' => 'https://codeweek.eu/blog/futurereadycsr-campaign-launch',
'secondary_cta_link' => 'https://codeweek.eu/blog/futurereadycsr-resources',
]);
return self::create($defaults);
}
}
24 changes: 21 additions & 3 deletions app/DancePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,31 @@ class DancePage extends Model

public static function config(): self
{
$defaults = [
'use_dynamic_content' => false,
'hero_title' => __('cw2020.title.0'),
'hero_subtitle' => __('cw2020.dance.title'),
'content_intro_title' => __('cw2020.dance.title'),
'content_intro_subtitle' => __('snippets.dance.subtitle'),
'get_involved_title' => __('cw2020.get-involved.title'),
'get_involved_subtitle' => __('cw2020.get-involved.subtitle'),
];

$page = self::first();
if ($page) {
$dirty = false;
foreach ($defaults as $key => $value) {
if ($page->{$key} === null || $page->{$key} === '') {
$page->{$key} = $value;
$dirty = true;
}
}
if ($dirty) {
$page->save();
}
return $page;
}

return self::create([
'use_dynamic_content' => false,
]);
return self::create($defaults);
}
}
36 changes: 32 additions & 4 deletions app/GetInvolvedPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,42 @@ class GetInvolvedPage extends Model

public static function config(): self
{
$defaults = [
'use_dynamic_content' => false,
'intro_heading' => 'How to get involved',
'intro_text' => 'It’s easy to take part in Code Week. If you’re an educator, student, parent or community leader you can make a big impact. You can host your own activity, join one nearby, explore learning resources, or connect with others across Europe.',
'intro_button_text' => 'Get involved',
'intro_button_link' => '/guide',
'movement_heading' => 'Join the movement for digital creativity',
'movement_text_1' => 'The beauty of Code Week is that there’s no single way to take part. Whether you run an event or join one, you\'re helping grow a movement built on creativity, inclusion and digital skills.',
'movement_text_2' => 'Spread the joy of coding, connect with like-minded people, and empower others to shape their digital future. Every action makes a difference.',
'start_heading' => 'How to get started with Code Week',
'start_text' => "Whether you’re curious about coding, passionate about teaching, or just want to try something new, there’s a place for you in EU Code Week.\n\nYou don’t need to be an expert. From hosting events to sharing resources, there are plenty of ways to contribute to this fun, open and collaborative movement.",
'card_community_title' => 'Connect with your local Code Week community',
'card_community_text' => 'Find educators, mentors and organisers near you through the Code Week map or national hubs. There’s a whole network ready to support and collaborate.',
'card_activity_title' => 'Register your Code Week activity',
'card_activity_text' => 'Planning something? Add it to the Code Week map so others can see it.',
'card_ambassadors_title' => 'Connect with EU Code Week Ambassadors',
'card_ambassadors_text' => 'Ambassadors help coordinate Code Week in their countries. Reach out for support, advice or to join local projects and challenges.',
'card_stories_title' => 'Share your coding experience and stories',
'card_stories_text' => 'Post photos, videos and stories using #EUCodeWeek. Highlight what you’ve learned, celebrate your community, and inspire others to join',
];

$page = self::first();
if ($page) {
$dirty = false;
foreach ($defaults as $key => $value) {
if ($page->{$key} === null || $page->{$key} === '') {
$page->{$key} = $value;
$dirty = true;
}
}
if ($dirty) {
$page->save();
}
return $page;
}

return self::create([
'use_dynamic_content' => false,
'intro_button_link' => '/guide',
]);
return self::create($defaults);
}
}
27 changes: 23 additions & 4 deletions app/OnlineCoursesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,33 @@ class OnlineCoursesPage extends Model

public static function config(): self
{
$defaults = [
'use_dynamic_content' => false,
'hero_title' => 'Online Courses',
'hero_text' => __('online-courses.online-courses-text'),
'hero_cta_text' => 'Optional secondary CTA introduction to online courses',
'hero_cta_link' => '/',
'intro_title' => 'EU Code Week Online Courses',
'intro_text_1' => __('online-courses.online-courses-sub-text1'),
'intro_text_2' => __('online-courses.online-courses-sub-text2'),
'intro_text_3' => __('online-courses.online-courses-sub-text3'),
];

$page = self::first();
if ($page) {
$dirty = false;
foreach ($defaults as $key => $value) {
if ($page->{$key} === null || $page->{$key} === '') {
$page->{$key} = $value;
$dirty = true;
}
}
if ($dirty) {
$page->save();
}
return $page;
}

return self::create([
'use_dynamic_content' => false,
'hero_cta_link' => '/',
]);
return self::create($defaults);
}
}
39 changes: 32 additions & 7 deletions app/TreasureHuntPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,43 @@ class TreasureHuntPage extends Model

public static function config(): self
{
$page = self::first();
if ($page) {
return $page;
}

return self::create([
$defaults = [
'use_dynamic_content' => false,
'hero_title' => 'Treasure Hunt',
'hero_subtitle' => 'Simple yet challenging Telegram game – easy for beginners, engaging for experienced players.',
'intro_title' => 'Code Week Treasure Hunt',
'intro_paragraph_1' => 'This is a game on Telegram that is simple enough for beginners, but also challenging to keep experienced participants on their toes.',
'intro_paragraph_2' => 'The Code Week Treasure Hunt is a game best played on your PC with a mobile phone in hand. The game will ask you to solve coding challenges and guide you through the history of coding, computer science and technology in Europe.',
'how_to_play_title' => 'How to play',
'step_1_text' => 'Download the Telegram app. It is available for Desktop (Windows, macOS and Linux), iOS and Android You can play the game either on your PC or laptop, or on your smartphone. We recommend you play it on your computer so that you can get the instructions and solve the coding challenges on the Telegram app on your phone.',
'step_2_text' => 'To play the game, open the game and scan the QR code that will take you to the Telegram app and give you the first set of instructions.',
'step_3_text' => 'To win, you need to solve 10 coding challenges and find 10 locations on the map of Europe that are linked to the rise of coding and technology.',
'step_4_text' => 'After you complete the game, share your score with your friends using #EUCodeWeek and challenge them to play and learn about the history of coding too. Let\'s see who scores the top results!',
'info_text' => 'The Code Week Treasure Hunt is the virtual version of the original EU Code Week Treasure Hunt which was first developed by Alessandro Bogliolo, Professor of Computer Systems at the University of Urbino. To learn more about his original game, visit our blog.',
'get_involved_title' => 'How to get involved',
'get_involved_text' => 'Can’t wait to start coding? If you would like to join the EU Code Week community but don\'t know where to start, take a look at these resources that will help get you started, just in time for our annual celebration in October.',
'get_involved_link_1' => 'https://blog.codeweek.eu/getting-started-with-eu-code-week/',
'get_involved_link_2' => '/guide',
'get_involved_link_3' => '/training',
'get_involved_link_4' => 'https://bit.ly/DEEPDIVE2020',
'get_involved_link_5' => '/resources/CodingAtHome',
]);
];

$page = self::first();
if ($page) {
$dirty = false;
foreach ($defaults as $key => $value) {
if ($page->{$key} === null || $page->{$key} === '') {
$page->{$key} = $value;
$dirty = true;
}
}
if ($dirty) {
$page->save();
}
return $page;
}

return self::create($defaults);
}
}
Loading