Skip to content

Commit 9f13efc

Browse files
authored
Merge pull request #3517 from codeeu/feature/support-gmail-oauth
Feature/support gmail oauth
2 parents 0391e55 + 81e6ec3 commit 9f13efc

5 files changed

Lines changed: 131 additions & 23 deletions

File tree

app/CsrCampaignPage.php

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,33 @@ public function resources()
3131

3232
public static function config(): self
3333
{
34+
$defaults = [
35+
'use_dynamic_content' => false,
36+
'hero_text' => __('csr-campaign.landing_header'),
37+
'primary_cta_text' => __('csr-campaign.get_involved'),
38+
'primary_cta_link' => 'https://codeweek.eu/blog/futurereadycsr-campaign-launch',
39+
'secondary_cta_text' => __('csr-campaign.explore_resources'),
40+
'secondary_cta_link' => 'https://codeweek.eu/blog/futurereadycsr-resources',
41+
'about_title' => __('csr-campaign.about_title'),
42+
'about_description' => __('csr-campaign.about_description'),
43+
'resources_title' => __('csr-campaign.resources'),
44+
];
45+
3446
$page = self::first();
3547
if ($page) {
48+
$dirty = false;
49+
foreach ($defaults as $key => $value) {
50+
if ($page->{$key} === null || $page->{$key} === '') {
51+
$page->{$key} = $value;
52+
$dirty = true;
53+
}
54+
}
55+
if ($dirty) {
56+
$page->save();
57+
}
3658
return $page;
3759
}
3860

39-
return self::create([
40-
'use_dynamic_content' => false,
41-
'primary_cta_link' => 'https://codeweek.eu/blog/futurereadycsr-campaign-launch',
42-
'secondary_cta_link' => 'https://codeweek.eu/blog/futurereadycsr-resources',
43-
]);
61+
return self::create($defaults);
4462
}
4563
}

app/DancePage.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,31 @@ class DancePage extends Model
2424

2525
public static function config(): self
2626
{
27+
$defaults = [
28+
'use_dynamic_content' => false,
29+
'hero_title' => __('cw2020.title.0'),
30+
'hero_subtitle' => __('cw2020.dance.title'),
31+
'content_intro_title' => __('cw2020.dance.title'),
32+
'content_intro_subtitle' => __('snippets.dance.subtitle'),
33+
'get_involved_title' => __('cw2020.get-involved.title'),
34+
'get_involved_subtitle' => __('cw2020.get-involved.subtitle'),
35+
];
36+
2737
$page = self::first();
2838
if ($page) {
39+
$dirty = false;
40+
foreach ($defaults as $key => $value) {
41+
if ($page->{$key} === null || $page->{$key} === '') {
42+
$page->{$key} = $value;
43+
$dirty = true;
44+
}
45+
}
46+
if ($dirty) {
47+
$page->save();
48+
}
2949
return $page;
3050
}
3151

32-
return self::create([
33-
'use_dynamic_content' => false,
34-
]);
52+
return self::create($defaults);
3553
}
3654
}

app/GetInvolvedPage.php

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,42 @@ class GetInvolvedPage extends Model
4747

4848
public static function config(): self
4949
{
50+
$defaults = [
51+
'use_dynamic_content' => false,
52+
'intro_heading' => 'How to get involved',
53+
'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.',
54+
'intro_button_text' => 'Get involved',
55+
'intro_button_link' => '/guide',
56+
'movement_heading' => 'Join the movement for digital creativity',
57+
'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.',
58+
'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.',
59+
'start_heading' => 'How to get started with Code Week',
60+
'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.",
61+
'card_community_title' => 'Connect with your local Code Week community',
62+
'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.',
63+
'card_activity_title' => 'Register your Code Week activity',
64+
'card_activity_text' => 'Planning something? Add it to the Code Week map so others can see it.',
65+
'card_ambassadors_title' => 'Connect with EU Code Week Ambassadors',
66+
'card_ambassadors_text' => 'Ambassadors help coordinate Code Week in their countries. Reach out for support, advice or to join local projects and challenges.',
67+
'card_stories_title' => 'Share your coding experience and stories',
68+
'card_stories_text' => 'Post photos, videos and stories using #EUCodeWeek. Highlight what you’ve learned, celebrate your community, and inspire others to join',
69+
];
70+
5071
$page = self::first();
5172
if ($page) {
73+
$dirty = false;
74+
foreach ($defaults as $key => $value) {
75+
if ($page->{$key} === null || $page->{$key} === '') {
76+
$page->{$key} = $value;
77+
$dirty = true;
78+
}
79+
}
80+
if ($dirty) {
81+
$page->save();
82+
}
5283
return $page;
5384
}
5485

55-
return self::create([
56-
'use_dynamic_content' => false,
57-
'intro_button_link' => '/guide',
58-
]);
86+
return self::create($defaults);
5987
}
6088
}

app/OnlineCoursesPage.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,33 @@ class OnlineCoursesPage extends Model
2626

2727
public static function config(): self
2828
{
29+
$defaults = [
30+
'use_dynamic_content' => false,
31+
'hero_title' => 'Online Courses',
32+
'hero_text' => __('online-courses.online-courses-text'),
33+
'hero_cta_text' => 'Optional secondary CTA introduction to online courses',
34+
'hero_cta_link' => '/',
35+
'intro_title' => 'EU Code Week Online Courses',
36+
'intro_text_1' => __('online-courses.online-courses-sub-text1'),
37+
'intro_text_2' => __('online-courses.online-courses-sub-text2'),
38+
'intro_text_3' => __('online-courses.online-courses-sub-text3'),
39+
];
40+
2941
$page = self::first();
3042
if ($page) {
43+
$dirty = false;
44+
foreach ($defaults as $key => $value) {
45+
if ($page->{$key} === null || $page->{$key} === '') {
46+
$page->{$key} = $value;
47+
$dirty = true;
48+
}
49+
}
50+
if ($dirty) {
51+
$page->save();
52+
}
3153
return $page;
3254
}
3355

34-
return self::create([
35-
'use_dynamic_content' => false,
36-
'hero_cta_link' => '/',
37-
]);
56+
return self::create($defaults);
3857
}
3958
}

app/TreasureHuntPage.php

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,43 @@ class TreasureHuntPage extends Model
3636

3737
public static function config(): self
3838
{
39-
$page = self::first();
40-
if ($page) {
41-
return $page;
42-
}
43-
44-
return self::create([
39+
$defaults = [
4540
'use_dynamic_content' => false,
41+
'hero_title' => 'Treasure Hunt',
42+
'hero_subtitle' => 'Simple yet challenging Telegram game – easy for beginners, engaging for experienced players.',
43+
'intro_title' => 'Code Week Treasure Hunt',
44+
'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.',
45+
'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.',
46+
'how_to_play_title' => 'How to play',
47+
'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.',
48+
'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.',
49+
'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.',
50+
'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!',
51+
'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.',
52+
'get_involved_title' => 'How to get involved',
53+
'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.',
4654
'get_involved_link_1' => 'https://blog.codeweek.eu/getting-started-with-eu-code-week/',
4755
'get_involved_link_2' => '/guide',
4856
'get_involved_link_3' => '/training',
4957
'get_involved_link_4' => 'https://bit.ly/DEEPDIVE2020',
5058
'get_involved_link_5' => '/resources/CodingAtHome',
51-
]);
59+
];
60+
61+
$page = self::first();
62+
if ($page) {
63+
$dirty = false;
64+
foreach ($defaults as $key => $value) {
65+
if ($page->{$key} === null || $page->{$key} === '') {
66+
$page->{$key} = $value;
67+
$dirty = true;
68+
}
69+
}
70+
if ($dirty) {
71+
$page->save();
72+
}
73+
return $page;
74+
}
75+
76+
return self::create($defaults);
5277
}
5378
}

0 commit comments

Comments
 (0)