Skip to content

Feat/educational resources language changes #2756

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 66 commits into
base: new-matrix-uat
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
13c11f8
Moved slide change from master to slidechange
bernardhanna May 14, 2025
b6d7fcf
Merge pull request #2723 from codeeu/feat/de-el-language-changes
bernardhanna May 19, 2025
d0ee649
Merge pull request #2724 from codeeu/dev
bernardhanna May 19, 2025
4296d05
rebased with master
bernardhanna May 19, 2025
038376e
Merge pull request #2725 from codeeu/feat/newguide
bernardhanna May 19, 2025
7ae269a
fix with styles
bernardhanna May 19, 2025
fdb5ed1
Merge pull request #2726 from codeeu/feat/newguide
bernardhanna May 19, 2025
df97933
fix with styles
bernardhanna May 19, 2025
e6efed6
Merge pull request #2727 from codeeu/feat/newguide
bernardhanna May 19, 2025
22a3b09
Merge pull request #2728 from codeeu/dev
bernardhanna May 19, 2025
6009b50
Add SEO-related route redirects
bernardhanna May 19, 2025
d7dacfd
Merge pull request #2729 from codeeu/seo
bernardhanna May 19, 2025
19e7e35
Merge pull request #2730 from codeeu/dev
bernardhanna May 19, 2025
60997a6
Add SEO-related route redirects
bernardhanna May 19, 2025
c545dc8
Merge pull request #2731 from codeeu/seo
bernardhanna May 19, 2025
9c29d46
Merge pull request #2732 from codeeu/dev
bernardhanna May 19, 2025
a2fdf77
Add SEO-related route redirects
bernardhanna May 20, 2025
c58b59f
Add SEO-related route redirects
bernardhanna May 20, 2025
8f61497
Merge pull request #2733 from codeeu/seo
bernardhanna May 20, 2025
72dce2f
Merge pull request #2734 from codeeu/dev
bernardhanna May 20, 2025
8ccd622
Add SEO-related route redirects
bernardhanna May 20, 2025
bb7773d
Merge pull request #2735 from codeeu/seo
bernardhanna May 20, 2025
9d88290
Add new webinars
stevanpo May 20, 2025
5998bdc
Add SEO-related route redirects
bernardhanna May 21, 2025
e83cbaa
Merge pull request #2738 from codeeu/seo
bernardhanna May 21, 2025
d409fc8
Merge pull request #2736 from codeeu/dev
bernardhanna May 21, 2025
cb9b3e0
fix
stevanpo May 21, 2025
3863299
fix
stevanpo May 21, 2025
2c46ff8
fix
stevanpo May 21, 2025
bc2a9ed
Merge pull request #2737 from codeeu/feat/add-new-webinars
stevanpo May 21, 2025
b7cdaa5
Merge pull request #2739 from codeeu/dev
stevanpo May 21, 2025
ee0ddeb
Add new partner
stevanpo May 27, 2025
50ca390
Merge pull request #2740 from codeeu/feat/add-new-partner
stevanpo May 27, 2025
ed232d8
Merge pull request #2741 from codeeu/dev
stevanpo May 27, 2025
f0db13c
Add Guide on Activities under Activities menu
stevanpo May 27, 2025
a092770
Merge pull request #2742 from codeeu/fix/add-guide-on-activities-unde…
stevanpo May 27, 2025
c8c7e09
Merge pull request #2743 from codeeu/dev
stevanpo May 27, 2025
74d67fd
Finnish - home page banner translation issue fixed.
matrix-devaccount Jun 2, 2025
e07f8f6
Build new Vite assets for deployment
bernardhanna Jun 2, 2025
024b3ae
Build new Vite assets for dev
bernardhanna Jun 2, 2025
cb79fd5
Merge pull request #2744 from codeeu/dev
bernardhanna Jun 2, 2025
89e896c
Fresh Vite build for dev test
bernardhanna Jun 2, 2025
80c9aa8
Merge pull request #2745 from codeeu/dev
bernardhanna Jun 2, 2025
3a5c193
Fresh Vite build for dev test
bernardhanna Jun 2, 2025
8b61a42
Merge branch 'master' of https://github.com/codeeu/codeweek
bernardhanna Jun 2, 2025
2534137
Merge pull request #2746 from codeeu/dev
bernardhanna Jun 2, 2025
100db27
Fix to links on module-15
bernardhanna Jun 3, 2025
a8acd24
Merge pull request #2747 from codeeu/dev
bernardhanna Jun 3, 2025
b2ee621
update commutity text for italian
stevanpo Jun 3, 2025
16ae604
ciscoevents
bernardhanna Jun 3, 2025
40736cd
Merge pull request #2749 from codeeu/Events_Code4Europe_Cisco
bernardhanna Jun 3, 2025
6b61c7f
Merge pull request #2750 from codeeu/dev
bernardhanna Jun 3, 2025
f1ba1a3
dojoevents
bernardhanna Jun 3, 2025
efb0a8d
Merge pull request #2751 from codeeu/Events_Code4Europe_Cisco
bernardhanna Jun 3, 2025
0a63988
dojoevents
bernardhanna Jun 3, 2025
a7e1604
Merge pull request #2752 from codeeu/Events_Code4Europe_Cisco
bernardhanna Jun 3, 2025
f171a3c
Merge pull request #2753 from codeeu/dev
bernardhanna Jun 3, 2025
1f11fbf
Merge pull request #2748 from codeeu/fix/commutity-text-for-italian
stevanpo Jun 3, 2025
b834410
Merge pull request #2754 from codeeu/dev
stevanpo Jun 3, 2025
3691020
Educational Resources Translations
matrix-devaccount Jun 4, 2025
2ee01f0
Merge branch 'master' of https://github.com/codeeu/codeweek into feat…
matrix-devaccount Jun 4, 2025
0b238f7
Build for educational resources translations
matrix-devaccount Jun 4, 2025
83ce8da
Educational Resources - Learn & Teach Translations
matrix-devaccount Jun 5, 2025
6e670d3
Build for educational resources translations
matrix-devaccount Jun 5, 2025
6842e25
added missing search button text
matrix-devaccount Jun 5, 2025
26c1fca
Build app
matrix-devaccount Jun 5, 2025
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
30 changes: 30 additions & 0 deletions app/Console/Commands/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

namespace App\Http\Middleware;

use Closure;

class ReplaceOldS3Urls
{
public function handle($request, Closure $next)
{
$response = $next($request);

if ($response instanceof \Illuminate\Http\Response && str_contains($response->headers->get('Content-Type'), 'text/html')) {
$content = $response->getContent();
$content = str_replace(
'https://s3-eu-west-1.amazonaws.com/codeweek-s3/',
'https://codeweek-s3.s3.eu-west-1.amazonaws.com/',
$content
);
$response->setContent($content);
}

return $response;
}
}
67 changes: 67 additions & 0 deletions app/Console/Commands/TestLatestEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Event;

class TestLatestEvent extends Command
{
protected $signature = 'test:latest-event';
protected $description = 'Print all fields of the latest imported Event';

public function handle(): void
{
$event = Event::latest()->first();

if (! $event) {
$this->error('❌ No event found.');
return;
}

$this->info("✅ Latest Event: {$event->title} (ID: {$event->id})\n");

$fields = [
'title' => $event->title,
'slug' => $event->slug,
'organizer' => $event->organizer,
'description' => $event->description,
'country_iso' => $event->country_iso,
'language' => $event->language,
'location' => $event->location,
'start_date' => $event->start_date,
'end_date' => $event->end_date,
'event_url' => $event->event_url,
'user_email' => $event->user_email,
'creator_id' => $event->creator_id,
'longitude' => $event->longitude,
'latitude' => $event->latitude,
'geoposition' => $event->geoposition,
'picture' => $event->picture,
'activity_type' => $event->activity_type,
'activity_format' => $event->activity_format,
'duration' => $event->duration,
'recurring_event' => $event->recurring_event,
'recurring_type' => $event->recurring_type,
'males_count' => $event->males_count,
'females_count' => $event->females_count,
'other_count' => $event->other_count,
'is_extracurricular_event' => $event->is_extracurricular_event,
'is_standard_school_curriculum' => $event->is_standard_school_curriculum,
'is_use_resource' => $event->is_use_resource,
'ages' => $event->ages,
'audiences' => $event->audiences()->pluck('id')->toArray(),
'themes' => $event->themes()->pluck('id')->toArray(),
'created_at' => $event->created_at,
'updated_at' => $event->updated_at,
'status' => $event->status,
];

foreach ($fields as $key => $value) {
$pretty = is_array($value) ? json_encode($value) : (string) $value;
$this->line("• {$key}: {$pretty}");
}

$this->info("\n✅ Done.\n");
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/excel/EventiEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function handle(): void

Excel::import(
new EventiEventsImport(),
resource_path('excel/eventi.xlsx')
resource_path('excel/.xlsx')
);
}
}
49 changes: 49 additions & 0 deletions app/Console/Commands/excel/EventsImport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

namespace App\Console\Commands\excel;

use App\Imports\EventsImport;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use Maatwebsite\Excel\Facades\Excel;

class EventsImporter extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'excel:events-import';

/**
* The console command description.
*
* @var string
*/
protected $description = 'events 2025 From Excel File';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*/
public function handle(): void
{
Log::info('Loading events Excel File');

Excel::import(
new EventsImporter(),
'3-june.xlsx',
'excel'
);
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/excel/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function handle(): void

Excel::import(
new GenericEventsImport(),
'pauline-2023.xlsx',
'today.xlsx',
'excel'
);
}
Expand Down
24 changes: 24 additions & 0 deletions app/Http/Middleware/ReplaceOldS3Urls.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;

use Closure;

class ReplaceOldS3Urls
{
public function handle($request, Closure $next)
{
$response = $next($request);

if ($response instanceof \Illuminate\Http\Response && str_contains($response->headers->get('Content-Type'), 'text/html')) {
$content = $response->getContent();
$content = str_replace(
'https://s3-eu-west-1.amazonaws.com/codeweek-s3/',
'https://codeweek-s3.s3.eu-west-1.amazonaws.com/',
$content
);
$response->setContent($content);
}

return $response;
}
}
74 changes: 42 additions & 32 deletions app/Imports/EventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Maatwebsite\Excel\Concerns\WithCustomValueBinder;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder;

use PhpOffice\PhpSpreadsheet\Shared\Date;
class EventsImport extends DefaultValueBinder implements ToModel, WithCustomValueBinder, WithHeadingRow
{
public function parseDate($date)
Expand All @@ -29,41 +29,51 @@ public function model(array $row): ?Model
//dd(Carbon::parse($this->parseDate($row["start_date"]))->toDateTimeString());
//dd(Carbon::createFromFormat("d/m/Y",$row["start_date"])->toDateTimeString());

Log::info($row);
Log::info($row); // Keep this for debugging

// Resolve creator_id
$creatorId = null;
if (!empty($row['creator_id'])) {
if (is_numeric($row['creator_id'])) {
$creatorId = (int) $row['creator_id'];
} else {
$creatorId = \App\User::where('email', trim($row['creator_id']))->value('id');
}
}

//Log::info($row["Address"]);
$event = new Event([
'status' => 'APPROVED',
'title' => $row['activity_title'],
'slug' => str_slug($row['activity_title']),
'organizer' => $row['name_of_organisation'],
'description' => $row['description'],
'organizer_type' => $row['type_of_organisation'],
'location' => $row['address'],
'event_url' => $row['organiser_website'],
'user_email' => '',
'creator_id' => $row['creator_id'],
'country_iso' => $row['country'],
'picture' => $row['image_path'],
'picture_detail' => $row['image_path_detail'],
'pub_date' => now(),
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => 'cw19-apple-eu',
'start_date' => Carbon::parse($this->parseDate($row['start_date']))->toDateTimeString(),
'end_date' => Carbon::parse($this->parseDate($row['end_date']))->toDateTimeString(),
'geoposition' => $row['latitude'].','.$row['longitude'],
'longitude' => $row['longitude'],
'latitude' => $row['latitude'],
'mass_added_for' => 'Excel',
]);
$event = new Event([
'status' => 'APPROVED',
'title' => $row['activity_title'],
'slug' => str_slug($row['activity_title']),
'organizer' => $row['name_of_organisation'],
'description' => $row['description'],
'organizer_type' => $row['type_of_organisation'],
'activity_type' => $row['activity_type'],
'location' => $row['address'],
'event_url' => $row['organiser_website'],
'user_email' => $row['contact_email'],
'creator_id' => $creatorId, // 👈 Now safe!
'country_iso' => strtoupper($row['country']),
'picture' => $row['image_path'],
'picture_detail' => $row['image_path_detail'],
'pub_date' => now(),
'created' => now(),
'updated' => now(),
'codeweek_for_all_participation_code' => '',
'start_date' => Carbon::parse($this->parseDate($row['start_date']))->toDateTimeString(),
'end_date' => Carbon::parse($this->parseDate($row['end_date']))->toDateTimeString(),
'geoposition' => $row['latitude'] . ',' . $row['longitude'],
'longitude' => $row['longitude'],
'latitude' => $row['latitude'],
'mass_added_for' => 'Excel',
]);

$event->save();
$event->save();

$event->audiences()->attach(explode(',', $row['audience_comma_separated_ids']));
$event->themes()->attach(explode(',', $row['theme_comma_separated_ids']));
$event->audiences()->attach(explode(',', $row['audience_comma_separated_ids']));
$event->themes()->attach(explode(',', $row['theme_comma_separated_ids']));

return $event;
return $event;

}
}
Loading