Skip to content

Commit 46bb78e

Browse files
authored
Merge pull request #3620 from codeeu/dev
edit to online course page
2 parents a0c77d7 + 70bf167 commit 46bb78e

15 files changed

Lines changed: 1416 additions & 25 deletions

app/OnlineCoursesPage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public static function config(): self
3030
'use_dynamic_content' => false,
3131
'hero_title' => 'Online Courses',
3232
'hero_text' => __('online-courses.online-courses-text'),
33-
'hero_cta_text' => 'Optional secondary CTA introduction to online courses',
34-
'hero_cta_link' => '/',
33+
'hero_cta_text' => null,
34+
'hero_cta_link' => null,
3535
'intro_title' => 'EU Code Week Online Courses',
3636
'intro_text_1' => __('online-courses.online-courses-sub-text1'),
3737
'intro_text_2' => __('online-courses.online-courses-sub-text2'),
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Support\Facades\DB;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
public function up(): void
10+
{
11+
if (! Schema::hasTable('online_courses_page')) {
12+
return;
13+
}
14+
15+
DB::table('online_courses_page')
16+
->where('hero_cta_text', 'Optional secondary CTA introduction to online courses')
17+
->update([
18+
'hero_cta_text' => null,
19+
'hero_cta_link' => null,
20+
]);
21+
}
22+
23+
public function down(): void
24+
{
25+
// Placeholder CTA intentionally removed; no restore.
26+
}
27+
};

database/seeders/EditableStaticPagesSeeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ private function seedOnlineCoursesPage(): void
3232
'use_dynamic_content' => true,
3333
'hero_title' => 'Online Courses',
3434
'hero_text' => __('online-courses.online-courses-text'),
35-
'hero_cta_text' => 'Optional secondary CTA introduction to online courses',
36-
'hero_cta_link' => '/',
35+
'hero_cta_text' => null,
36+
'hero_cta_link' => null,
3737
'intro_title' => 'EU Code Week Online Courses',
3838
'intro_text_1' => __('online-courses.online-courses-sub-text1'),
3939
'intro_text_2' => __('online-courses.online-courses-sub-text2'),

docs/getting-help-public.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Getting help with CodeWeek
2+
3+
This page explains how to get help with your **CodeWeek** account, activities, or
4+
certificates. It's for teachers, organisers, and participants.
5+
6+
---
7+
8+
## How to ask for help
9+
10+
The fastest way to reach the CodeWeek team is the official contact channel:
11+
12+
- **Contact form / email:** use the contact option on the CodeWeek website at
13+
[codeweek.eu](https://codeweek.eu)
14+
15+
When you get in touch, please include:
16+
17+
1. **The email address** you registered with on CodeWeek
18+
2. **Your CodeWeek 4all code** (if your question is about an activity or certificate)
19+
3. **A clear description** of the problem and what you'd like help with
20+
21+
Including these details up front helps the team look into your request without
22+
needing to email back and forth.
23+
24+
---
25+
26+
## Common topics
27+
28+
### Signing in / account access
29+
If you can't sign in, double-check you're using the email address you originally
30+
registered with. If you still have trouble, contact the team with that email address
31+
and a short description of what happens when you try to log in.
32+
33+
### Certificates
34+
Participation and Certificate of Excellence availability depends on the activities
35+
registered under your 4all code. You can find and download available certificates
36+
after signing in:
37+
38+
- [codeweek.eu/certificates](https://codeweek.eu/certificates)
39+
40+
If you believe a certificate is missing, include your **registered email** and your
41+
**4all code** when you contact the team so they can check your specific case.
42+
43+
### Activities and events
44+
For questions about adding, editing, or finding activities, contact the team with your
45+
registered email and 4all code and describe what you're trying to do.
46+
47+
---
48+
49+
## What to expect
50+
51+
- The team reviews requests and replies by email.
52+
- For account or data changes, the team verifies the details before making any change —
53+
so please use the **same email address** associated with your CodeWeek account where
54+
possible.
55+
- Response times vary with demand, especially around the annual CodeWeek period.
56+
57+
---
58+
59+
## Privacy
60+
61+
Only share the information needed to resolve your request (typically your registered
62+
email and 4all code). Please don't include passwords or other sensitive personal data
63+
in your message.
64+
65+
---
66+
67+
*For more about CodeWeek, visit [codeweek.eu](https://codeweek.eu).*

resources/views/online-courses.blade.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@
3838
@lang('online-courses.online-courses-text')
3939
@endif
4040
</p>
41+
@if($dynamic && $page->hero_cta_text && $page->hero_cta_link)
4142
<span class="text-dark-blue font-semibold text-lg ">
42-
<a href="{{ $dynamic && $page->hero_cta_link ? $page->hero_cta_link : '/' }}" class="cursor-pointer text-dark-blue underline mr-1">
43-
{{ $dynamic && $page->hero_cta_text ? $page->hero_cta_text : 'Optional secondary CTA introduction to online courses' }}
43+
<a href="{{ $page->hero_cta_link }}" class="cursor-pointer text-dark-blue underline mr-1">
44+
{{ $page->hero_cta_text }}
4445
</a>
4546
4647
</span>
48+
@endif
4749

4850
</div>
4951
<div class="order-0 md:order-2 flex flex-1 justify-center items-center z-10"></div>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/usr/bin/env bash
2+
# Chevron position (right: -.8rem) + remove arrow.png from Share your stories submenu.
3+
set -euo pipefail
4+
5+
THEME="${THEME:-/var/www/html/blog/wp-content/themes/eucodewe-1389}"
6+
WP_ROOT="${WP_ROOT:-/var/www/html/blog}"
7+
SHARE_TEXT="Share your stories"
8+
9+
[[ -d "$THEME" ]] || { echo "Theme not found: $THEME"; exit 1; }
10+
[[ -d "$WP_ROOT" ]] || { echo "WP_ROOT not found: $WP_ROOT"; exit 1; }
11+
12+
cd "$THEME"
13+
chmod u+w new.css 2>/dev/null || true
14+
15+
python3 <<'PY'
16+
from pathlib import Path
17+
import re
18+
19+
css = Path("new.css")
20+
text = css.read_text()
21+
22+
# Don't hide chevron on last top-level item when it has children (Blog)
23+
text = text.replace(
24+
".header__menu nav > ul > li:last-child a:after {\n display: none;\n}",
25+
".header__menu nav > ul > li:last-child:not(.menu-item-has-children) a:after {\n display: none;\n}",
26+
)
27+
28+
chevron_sel = (
29+
"li.menu-item.menu-item-type-custom.menu-item-object-custom.menu-item-has-children a:after"
30+
)
31+
chevron_block = """li.menu-item.menu-item-type-custom.menu-item-object-custom.menu-item-has-children a:after {
32+
content: "";
33+
width: 10px;
34+
height: 10px;
35+
background: url(https://codeweek.eu/blog/wp-content/uploads/2025/01/Vector-6.svg);
36+
display: block;
37+
background-size: contain;
38+
background-repeat: no-repeat;
39+
background-position: center;
40+
transition: 0.3s;
41+
right: -.8rem;
42+
}"""
43+
44+
pattern = re.compile(
45+
r"li\.menu-item\.menu-item-type-custom\.menu-item-object-custom\.menu-item-has-children a:after\s*\{[^}]+\}",
46+
re.S,
47+
)
48+
if pattern.search(text):
49+
text = pattern.sub(chevron_block, text, count=1)
50+
print("Updated chevron rule with right: -.8rem")
51+
else:
52+
print("WARNING: chevron rule not found — append manually if needed")
53+
54+
# Remove submenu arrow layout overrides (no longer needed)
55+
for pat in [
56+
r"\n/\* Blog dropdown: Share your stories.*?(?=\n/\* |\Z)",
57+
r"\n/\* Blog nav: restore dropdown chevron.*?(?=\n/\* |\Z)",
58+
r"\n/\* Blog nav: chevron on Blog.*?(?=\n/\* |\Z)",
59+
]:
60+
text = re.sub(pat, "\n", text, flags=re.S)
61+
62+
css.write_text(text)
63+
print("Patched new.css")
64+
PY
65+
66+
echo "--- chevron rule ---"
67+
grep -n -A12 "menu-item-has-children a:after" new.css | head -15
68+
69+
cd "$WP_ROOT"
70+
command -v wp >/dev/null 2>&1 || { echo "wp-cli required for menu arrow removal"; exit 1; }
71+
72+
SHARE_ID=""
73+
for menu in primary header main "Menu 1" 2; do
74+
SHARE_ID=$(wp menu item list "$menu" --fields=db_id,title --format=csv --allow-root 2>/dev/null \
75+
| awk -F, -v t="$SHARE_TEXT" '$2 ~ t {print $1; exit}') || true
76+
[[ -n "${SHARE_ID:-}" ]] && break
77+
done
78+
SHARE_ID="${SHARE_ID:-8142}"
79+
80+
wp eval --allow-root "
81+
\$id = (int) ${SHARE_ID};
82+
delete_post_meta(\$id, 'rt-wp-menu-custom-fields');
83+
delete_transient('rt-wp-menu-custom-fields-' . \$id);
84+
echo \"Removed arrow custom HTML from menu item \$id\n\";
85+
"
86+
87+
wp cache flush --allow-root 2>/dev/null | tail -1 || true
88+
for svc in php8.3-fpm php8.2-fpm php8.1-fpm php8.0-fpm; do
89+
systemctl is-active --quiet "$svc" 2>/dev/null && systemctl reload "$svc" && echo "Reloaded $svc" && break
90+
done
91+
echo "Done. Hard-refresh https://codeweek.eu/blog/"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
# Remove stray }); breaking blog footer JS.
3+
set -euo pipefail
4+
WP_ROOT="${WP_ROOT:-/var/www/html/blog}"
5+
cd "$WP_ROOT"
6+
wp eval --allow-root '
7+
$settings = get_option("auhfc_settings_sitewide");
8+
$footer = $settings["footer"] ?? "";
9+
$footer = str_replace(
10+
"$(\".mobile-nav .menu-menu-1-container\").append(actionButtons);\n});\n\t});",
11+
"$(\".mobile-nav .menu-menu-1-container\").append(actionButtons);\n});",
12+
$footer
13+
);
14+
$settings["footer"] = $footer;
15+
update_option("auhfc_settings_sitewide", $settings);
16+
echo "Removed stray }); from footer script\n";
17+
' 2>/dev/null | grep -v '^Deprecated:\|^Notice:\|^Warning:\|^PHP Warning:' || true
18+
wp cache flush --allow-root 2>/dev/null | tail -1 || true
19+
echo Done.

0 commit comments

Comments
 (0)