Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6817923
Merge pull request #2771 from codeeu/new-404-error-page-from-dev
Siroumi Jun 6, 2025
bf8372c
Fix: map markers not showing on initial load (global cluster group)
bernardhanna Jun 9, 2025
47cb31f
Merge pull request #2773 from codeeu/mapfix
bernardhanna Jun 9, 2025
b28f9c2
Fix: map markers not showing on initial load (global cluster group)
bernardhanna Jun 9, 2025
2d5c775
Merge pull request #2774 from codeeu/mapfix
bernardhanna Jun 9, 2025
2260f08
Fix: map markers not showing on initial load (global cluster group) 3
bernardhanna Jun 9, 2025
393b53e
Merge pull request #2775 from codeeu/mapfix
bernardhanna Jun 9, 2025
23ffc3c
Fix: map markers not showing on initial load (global cluster group) 4
bernardhanna Jun 9, 2025
1b3c8e3
Merge pull request #2776 from codeeu/mapfix
bernardhanna Jun 9, 2025
d0321a0
Fix: map markers not showing on initial load (global cluster group) 5
bernardhanna Jun 9, 2025
db608c9
Merge pull request #2777 from codeeu/mapfix
bernardhanna Jun 9, 2025
ae82ed7
Merge pull request #2778 from codeeu/dev
bernardhanna Jun 9, 2025
d1155ce
Fix: map markers not showing on initial load (global cluster group) 6
bernardhanna Jun 9, 2025
c927ae5
Merge pull request #2779 from codeeu/mapfix
bernardhanna Jun 9, 2025
271c1e7
Merge pull request #2780 from codeeu/dev
bernardhanna Jun 9, 2025
f4630c5
Fix: map markers not showing on initial load (global cluster group) 7
bernardhanna Jun 9, 2025
edbd18d
Merge pull request #2781 from codeeu/mapfix
bernardhanna Jun 9, 2025
9a5e333
Merge pull request #2782 from codeeu/dev
bernardhanna Jun 9, 2025
710d70e
Updated home.blade.php and HomeController with latest changes 8
bernardhanna Jun 9, 2025
17291ff
Merge pull request #2783 from codeeu/mapfix
bernardhanna Jun 9, 2025
81a50f7
Updated home.blade.php and HomeController with latest changes 9
bernardhanna Jun 9, 2025
c00aae2
Merge pull request #2784 from codeeu/mapfix
bernardhanna Jun 9, 2025
d737a56
Updated home.blade.php and HomeController with latest changes 10
bernardhanna Jun 9, 2025
b36aafd
Merge pull request #2785 from codeeu/mapfix
bernardhanna Jun 9, 2025
899d2a7
Updated home.blade.php and HomeController with latest changes 11
bernardhanna Jun 9, 2025
4e7a816
Merge pull request #2786 from codeeu/mapfix
bernardhanna Jun 9, 2025
38d2a12
Updated home.blade.php and HomeController with latest changes 12
bernardhanna Jun 9, 2025
7b122c3
Merge pull request #2787 from codeeu/mapfix
bernardhanna Jun 9, 2025
8a2ea79
Merge pull request #2788 from codeeu/dev
bernardhanna Jun 9, 2025
fb203a2
Updated home.blade.php and HomeController with latest changes 13
bernardhanna Jun 9, 2025
196d70f
Merge pull request #2789 from codeeu/mapfix
bernardhanna Jun 9, 2025
1c30854
Updated home.blade.php and HomeController with latest changes 14
bernardhanna Jun 9, 2025
685fae5
Merge pull request #2790 from codeeu/mapfix
bernardhanna Jun 9, 2025
041ab21
Merge pull request #2791 from codeeu/dev
bernardhanna Jun 9, 2025
4fac530
Updated home.blade.php and HomeController with latest changes 14
bernardhanna Jun 9, 2025
7b5b9f9
Merge pull request #2792 from codeeu/mapfix
bernardhanna Jun 9, 2025
ad2b90b
Merge pull request #2793 from codeeu/dev
bernardhanna Jun 9, 2025
c94c0cc
Merge pull request #2797 from codeeu/dev
bernardhanna Jun 10, 2025
13bc755
Merge pull request #2799 from codeeu/dev
bernardhanna Jun 10, 2025
bc2aa1b
Merge pull request #2801 from codeeu/dev
Siroumi Jun 13, 2025
934698e
updtae to build file
bernardhanna Jun 16, 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
4 changes: 2 additions & 2 deletions app/Console/Commands/excel/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function handle(): void

Excel::import(
new GenericEventsImport(),
'today.xlsx',
'example.xlsx',
'excel'
);
}
}
}
29 changes: 18 additions & 11 deletions app/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,26 @@ public static function translated()

public static function withActualYearEvents()
{
$year = request()->input('year', Carbon::now('Europe/Brussels')->year);

$isos = DB::table('events')
->select(['country_iso'])
->where('status', "=", "APPROVED")
->whereYear('end_date', '>=', Carbon::now('Europe/Brussels')->year)
$countries = DB::table('events')
->select('country_iso as iso', DB::raw('COUNT(*) as total'))
->where('status', '=', 'APPROVED')
->whereYear('end_date', '>=', $year)
->whereNotNull('geoposition')
->groupBy('country_iso')
->get()
->pluck('country_iso');

$countries = Country::findMany($isos)->sortBy('name');

return $countries;

->get();

$result = $countries->map(function ($row) {
$country = Country::find($row->iso);
return [
'iso' => $row->iso,
'name' => $country ? __('countries.' . $country->name) : $row->iso,
'total' => $row->total,
];
})->sortBy('name')->values();

return $result;
}


Expand Down
58 changes: 31 additions & 27 deletions app/Http/Controllers/Api/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,42 @@ public function event(Event $event)

}

public function list(Request $request)
{
$year = $request->input('year')
? $request->input('year')
: Carbon::now()->year;

if (Cache::has('events'.$year)) {
$events = Cache::get('events'.$year);
} else {
$events = Event::getByYear($year);

$events = $this->eventTransformer->transformCollection($events);

$events = $events->groupBy('country');

if ($year == Carbon::now()->year) {
Cache::add(
'events'.$year,
$events,
300
);
public function list(Request $request)
{
$year = $request->input('year')
? $request->input('year')
: Carbon::now()->year;

if (Cache::has('events'.$year)) {
$events = Cache::get('events'.$year);
} else {
Cache::forever('events'.$year, $events);
$events = Event::getByYear($year);

$events = $this->eventTransformer->transformCollection($events);

// FIX: group by UPPERCASE country
$events = $events->groupBy(function ($event) {
return strtoupper(trim($event['country']));
});

if ($year == Carbon::now()->year) {
Cache::add(
'events'.$year,
$events,
300
);
} else {
Cache::forever('events'.$year, $events);
}
}

if ($request->wantsJson()) {
return response()->json($events, 200);
}
}

if ($request->wantsJson()) {
return response()->json($events, 200);
return $events;
}

return $events;
}

public function detail(Request $request)
{
Expand Down
41 changes: 39 additions & 2 deletions app/Imports/GenericEventsImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder;
use PhpOffice\PhpSpreadsheet\Shared\Date;

class GenericEventsImport extends DefaultValueBinder implements ToModel, WithCustomValueBinder, WithHeadingRow
class GenericEventsImport extends BaseEventsImport implements ToModel, WithCustomValueBinder, WithHeadingRow
{
public function parseDate($value)
{
Expand All @@ -29,6 +29,7 @@ public function parseDate($value)
return null;
}
}


public function model(array $row): ?Model
{
Expand Down Expand Up @@ -70,6 +71,7 @@ public function model(array $row): ?Model
'activity_type' => trim($row['activity_type']),
'location' => !empty($row['address']) ? trim($row['address']) : 'online',
'event_url' => !empty($row['organiser_website']) ? trim($row['organiser_website']) : '',
'contact_person' => !empty($row['contact_email']) ? trim($row['contact_email']) : '',
'user_email' => !empty($row['contact_email']) ? trim($row['contact_email']) : '',
'creator_id' => $creatorId,
'country_iso' => strtoupper(trim($row['country'])),
Expand All @@ -85,6 +87,41 @@ public function model(array $row): ?Model
'latitude' => !empty($row['latitude']) ? trim($row['latitude']) : '',
'language' => !empty($row['language']) ? strtolower(explode('_', trim($row['language']))[0]) : 'en',
'mass_added_for' => 'Excel',
'recurring_event' => isset($row['recurring_event'])
? $this->validateSingleChoice($row['recurring_event'], Event::RECURRING_EVENTS)
: null,

'males_count' => isset($row['males_count']) ? (int) $row['males_count'] : null,
'females_count' => isset($row['females_count']) ? (int) $row['females_count'] : null,
'other_count' => isset($row['other_count']) ? (int) $row['other_count'] : null,

'is_extracurricular_event' => isset($row['is_extracurricular_event'])
? $this->parseBool($row['is_extracurricular_event'])
: false,

'is_standard_school_curriculum' => isset($row['is_standard_school_curriculum'])
? $this->parseBool($row['is_standard_school_curriculum'])
: false,

'is_use_resource' => isset($row['is_use_resource'])
? $this->parseBool($row['is_use_resource'])
: false,

'activity_format' => isset($row['activity_format'])
? $this->validateMultiChoice($row['activity_format'], Event::ACTIVITY_FORMATS)
: [],

'ages' => isset($row['ages'])
? $this->validateMultiChoice($row['ages'], Event::AGES)
: [],

'duration' => isset($row['duration'])
? $this->validateSingleChoice($row['duration'], Event::DURATIONS)
: null,

'recurring_type' => isset($row['recurring_type'])
? $this->validateSingleChoice($row['recurring_type'], Event::RECURRING_TYPES)
: null,
]);

$event->save();
Expand Down Expand Up @@ -113,4 +150,4 @@ public function model(array $row): ?Model
return null;
}
}
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resources/assets/sass/app.scss": {
"file": "assets/app-DsJ8rwW1.css",
"file": "assets/app-Dd9hZXy-.css",
"src": "resources/assets/sass/app.scss",
"isEntry": true
},
Expand All @@ -10,7 +10,7 @@
"isEntry": true
},
"resources/js/app.js": {
"file": "assets/app-BDqdE4NN.js",
"file": "assets/app-CDEsVgo7.js",
"name": "app",
"src": "resources/js/app.js",
"isEntry": true,
Expand Down
Loading