Skip to content
Open
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: 28 additions & 0 deletions database/migrations/2025_10_28_193708_add_pin_to_users_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->integer('pin')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['pin']);
});
}
};
2 changes: 1 addition & 1 deletion database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public function run(): void
} elseif (config('app.event_type') == 'gerolstein') {
$seeders = [
...$seeders,
StudentSeeder::class,
ModuleGerolsteinSeeder::class,
EventsGerolsteinSeeder::class,
PageGerolsteinSeeder::class,
StudentSeeder::class,
];
}

Expand Down
64 changes: 32 additions & 32 deletions database/seeders/EventsGerolsteinSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function runSpieleolympiade(): void
$event = new Event;
$event->name = 'Spieleolympiade';
$event->type = 'group_phase';
$event->registration_from = new DateTime('2024-10-30 8:00:00');
$event->registration_to = new DateTime('2024-10-30 8:00:00');
$event->registration_from = new DateTime('2025-10-30 8:00:00');
$event->registration_to = new DateTime('2025-10-30 8:00:00');
$event->has_requirements = false;
$event->consider_alcohol = false;
$event->sort_order = 110;
Expand All @@ -65,18 +65,20 @@ public function runSpieleolympiade(): void

// create event groups
$groupNames = [
'Die freshen Flamingos',
'Die wilden Weihnachtsbäume',
'Die rasanten Rasenmäher',
'Die ehrenhaften Erdbeeren',
'Die ehrgeizigen Eisbären',
'Die pfiffigen Pfeilgiftfrösche',
'Die musikalischen Milkakühe',
'Die schicken Schlümpfe',
'Die putzigen Panther',
'Die bärenstarken Braunbären',
'Die originellen Orchideen',
'Die treuen Telekom-Kunden',
'Magenta',
'Violet',
'Türkis',
'Silber',
'Gold',
'Schwarz',
'Grasgrün',
'Neongelb',
'Minzgrün',
'Gelb',
'Weinrot',
'Senfgelb',
'Orange',
'Blau'
];
foreach ($groupNames as $groupName) {
$group = new Group;
Expand All @@ -94,18 +96,18 @@ public function runSpieleolympiade(): void
*/
public function runSamstagabendGruppenphase(): void
{
// check if event with name "Gruppenphase" exists
$event = Event::where('name', 'Gruppenphase')->first();
// check if event with name "Samstagabend" exists
$event = Event::where('name', 'Samstagabend')->first();
if ($event) {
return;
}

// create a new event
$event = new Event;
$event->name = 'Gruppenphase';
$event->name = 'Samstagabend';
$event->type = 'group_phase';
$event->registration_from = new DateTime('2024-10-30 8:00:00');
$event->registration_to = new DateTime('2024-10-30 8:00:00');
$event->registration_from = new DateTime('2025-10-30 8:00:00');
$event->registration_to = new DateTime('2025-10-30 8:00:00');
$event->has_requirements = false;
$event->consider_alcohol = false;
$event->sort_order = 210;
Expand All @@ -114,18 +116,16 @@ public function runSamstagabendGruppenphase(): void
$event->save();

// create event groups
$groups = [];

for ($i = 1; $i <= 5; $i++) {
$groups[] = [
'name' => "Gruppe $i",
];
}

// save groups
foreach ($groups as $groupData) {
$groupNames = [
'Altersheim Alianz',
'Bingo Bande',
'Falten Fighters',
'Gebiss Gang',
'Rollator Rocker',
];
foreach ($groupNames as $groupName) {
$group = new Group;
$group->name = $groupData['name'];
$group->name = $groupName;
$group->event_id = $event->id;
$group->save();
}
Expand All @@ -149,8 +149,8 @@ public function runSamstagabendTanzenGesang(): void
$event = new Event;
$event->name = 'Tanzen';
$event->type = 'slot_booking';
$event->registration_from = new DateTime('2024-10-30 8:00:00');
$event->registration_to = new DateTime('2024-11-02 10:00:00');
$event->registration_from = new DateTime('2025-10-30 8:00:00');
$event->registration_to = new DateTime('2025-11-01 10:00:00');
$event->has_requirements = false;
$event->consider_alcohol = false;
$event->sort_order = 220;
Expand Down
1 change: 1 addition & 0 deletions database/seeders/StudentSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function run(): void
$user->firstname = $student[1];
$user->course_id = $courseByKey[$student[2]]->id;
$user->email = strtolower($student[3]);
$user->pin = $student[4];

// check if an image with the name of the user in one of the possible extensions exists
$imageBasePath = self::STUDENT_IMAGES_PATH . '/' . strtolower($user->firstname) . '_' . strtolower($user->lastname);
Expand Down
1 change: 1 addition & 0 deletions database/seeders/TutorSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public function run(): void
$user->firstname = $tutor[1];
$user->course_id = $courseByKey[$tutor[2]]->id;
$user->email = strtolower($tutor[3]);
$user->pin = $tutor[6];

//set user to disabled
if (array_key_exists(5, $tutor) && $tutor[5] == '1') {
Expand Down
4 changes: 4 additions & 0 deletions deploy/ansible/avatars/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.png
*.jpg
*.jpeg
*.gif
Empty file removed deploy/ansible/avatars/.gitkeep
Empty file.
34 changes: 34 additions & 0 deletions deploy/ansible/avatars/convert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from PIL import Image, ImageOps
import os
import re

def resize_images(folder_path):
subfolder_path = os.path.join(folder_path, "scaled")
os.makedirs(subfolder_path, exist_ok=True)

for filename in os.listdir(folder_path):
if filename.lower().endswith(('.jpg', '.jpeg', '.png', '.gif')):
print(filename)
image_path = os.path.join(folder_path, filename)
image = Image.open(image_path)

# 1. Transpose first (EXIF orientation fix)
image = ImageOps.exif_transpose(image)

# 2. Resize and crop to 500x500
image_cropped = ImageOps.fit(image, (500, 500), method=Image.Resampling.LANCZOS)

# 3. create new file name
name, ext = os.path.splitext(filename)
# example: "MaxMustermann" -> "max_mustermann"
clean_name = re.sub(r'(?<!^)(?=[A-Z])', '_', name).lower()

new_filename = f"{clean_name}{ext.lower()}"
new_image_path = os.path.join(subfolder_path, new_filename)

image_cropped.save(new_image_path)
print(f"Saved: {new_filename}")
else:
print(f"WARN: Skipping non-image file: {filename}")

resize_images("./new")
18 changes: 9 additions & 9 deletions deploy/ansible/roles/portals/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# - name: clone repository
# ansible.builtin.git:
# repo: "{{ portals_repo_url }}"
# dest: "{{ portals_local_path }}"
# version: "{{ portals_branch_or_tag }}"
# force: yes
# update: yes
- name: clone repository
ansible.builtin.git:
repo: "{{ portals_repo_url }}"
dest: "{{ portals_local_path }}"
version: "{{ portals_branch_or_tag }}"
force: yes
update: yes
- name: create .env
ansible.builtin.template:
src: .env.j2
Expand Down Expand Up @@ -71,8 +71,8 @@
- name: reload systemd
ansible.builtin.systemd:
daemon_reload: yes
- name: enable and start octane service
- name: enable and restart octane service
ansible.builtin.systemd:
name: octane.service
enabled: yes
state: started
state: restarted
2 changes: 1 addition & 1 deletion resources/js/types/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {};
export {}
declare global {
const useAppEventType: (typeof import("../composables/useAppEventType"))["default"];
const useColorMode: (typeof import("../composables/useColorMode"))["default"];
Expand Down
1 change: 1 addition & 0 deletions resources/js/types/course-event.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ declare namespace App.Models {
event_id: number;
course?: Course | null;
event?: Event | null;
use_factory?: any | null;
};
}
1 change: 1 addition & 0 deletions resources/js/types/course-group.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ declare namespace App.Models {
group_id: number;
course?: Course | null;
group?: Group | null;
use_factory?: any | null;
};
}
9 changes: 5 additions & 4 deletions resources/js/types/course.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
declare namespace App.Models {
type Course = {
updated_at: string /* Date */ | null;
created_at: string /* Date */ | null;
show_on_registration: any; // NOT FOUND;
id: number;
classes: string;
created_at: string /* Date */ | null;
updated_at: string /* Date */ | null;
name: string;
abbreviation: string;
icon: string;
show_on_registration: boolean;
classes: string;
users?: User[] | null;
groups?: Group[] | null;
use_factory?: any | null;
};
}
15 changes: 8 additions & 7 deletions resources/js/types/event.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
declare namespace App.Models {
type Event = {
sort_order: number;
id: number;
created_at: string /* Date */ | null;
updated_at: string /* Date */ | null;
consider_alcohol: any; // NOT FOUND;
form: any | null; // NOT FOUND;
id: number;
registration_from: string /* Date */;
registration_to: string /* Date */;
has_requirements: any; // NOT FOUND;
name: string;
description: string | null;
registration_from: string /* Date */;
registration_to: string /* Date */;
type: string;
has_requirements: boolean;
consider_alcohol: boolean;
form: any | null; // NOT FOUND;
sort_order: number;
groups?: Group[] | null;
registrations?: Registration[] | null;
slots?: Slot[] | null;
stations?: Station[] | null;
courses?: Course[] | null;
use_factory?: any | null;
};
}
1 change: 1 addition & 0 deletions resources/js/types/group-tutor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ declare namespace App.Models {
group_id: number;
user?: User | null;
group?: Group | null;
use_factory?: any | null;
};
}
3 changes: 2 additions & 1 deletion resources/js/types/group.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
declare namespace App.Models {
type Group = {
id: number;
name: string;
created_at: string /* Date */ | null;
updated_at: string /* Date */ | null;
event_id: number;
name: string;
telegram_group_link: string | null;
group_tutors?: GroupTutor[] | null;
registrations?: Registration[] | null;
Expand All @@ -13,5 +13,6 @@ declare namespace App.Models {
event?: Event | null;
tutors?: User[] | null;
stations?: Station[] | null;
use_factory?: any | null;
};
}
6 changes: 4 additions & 2 deletions resources/js/types/module.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
declare namespace App.Models {
type Module = {
id: number;
active: any; // NOT FOUND;
key: string;
active: boolean;
created_at: string /* Date */ | null;
updated_at: string /* Date */ | null;
key: string;
expose_public: boolean;
use_factory?: any | null;
};
}
5 changes: 3 additions & 2 deletions resources/js/types/page.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
declare namespace App.Models {
type Page = {
id: number;
created_at: string /* Date */ | null;
updated_at: string /* Date */ | null;
sort_order: number;
id: number;
title: string;
slug: string;
content: string;
sort_order: number;
use_factory?: any | null;
};
}
7 changes: 4 additions & 3 deletions resources/js/types/registration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ declare namespace App.Models {
user_id: number;
slot_id: number | null;
group_id: number | null;
drinks_alcohol: any | null; // NOT FOUND;
fulfils_requirements: any | null; // NOT FOUND;
is_present: any; // NOT FOUND;
drinks_alcohol: boolean | null;
fulfils_requirements: boolean | null;
is_present: boolean;
form_responses: any[];
queue_position: number | null;
event?: Event | null;
user?: User | null;
slot?: Slot | null;
group?: Group | null;
use_factory?: any | null;
};
}
Loading
Loading