Skip to content

Commit

Permalink
Revert "Login register page"
Browse files Browse the repository at this point in the history
  • Loading branch information
Siroumi authored Feb 28, 2025
1 parent 6f269d4 commit f1338ea
Show file tree
Hide file tree
Showing 89 changed files with 1,880 additions and 8,699 deletions.
8 changes: 1 addition & 7 deletions app/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ class Event extends Model
'report_notifications_count',
'reported_at',
'name_for_certificate',
'average_participant_age',
'participants_count',
'average_participant_age',
'percentage_of_females',
'percentage_of_males',
'percentage_of_other',
'age_group',
'codeweek_for_all_participation_code',
'name_for_certificate',
'organizer_type',
Expand All @@ -70,9 +67,6 @@ class Event extends Model
'location_id',
'leading_teacher_tag',
'mass_added_for',
'extracurricular_activity',
'recurring_event',
'frequency',
];

// protected $policies = [
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function edit(Event $event): View
->pluck('id')
->toArray();
$selected_audiences = implode(',', $selected_audiences);
$selected_country = $event->country()->first()?->iso ?? '';
$selected_country = $event->country()->first()->iso;
$selected_language = is_null($event->language)
? 'en'
: $event->language;
Expand Down
21 changes: 1 addition & 20 deletions app/Http/Requests/EventRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ public function rules(): array
'organizer_type' => 'required',
'privacy' => 'required',
'leading_teacher_tag' => 'nullable',
'participants_count' => 'required|integer|min:1',
'percentage_of_females' => 'nullable|integer|min:0',
'percentage_of_males' => 'nullable|integer|min:0',
'percentage_of_other' => 'nullable|integer|min:0',
'age_group' => 'nullable|string|in:0-5,6-18,19-25,Over 25',
'extracurricular_activity' => 'required|string|in:yes,no',
'recurring_event' => 'required|string|in:yes,no',
'frequency' => 'nullable|string|in:daily,weekly,monthly',

];
}

Expand All @@ -69,21 +62,9 @@ public function messages(): array
'event_url.url' => 'The activity\'s web page address should be a valid URL.',
'event_url.required' => 'The activity\'s web page is required for online activities.',
'user_email.required' => 'Please enter a valid email address.',
'participants_count.required' => 'Please enter the total number of participants.',
'participants_count.integer' => 'The number of participants must be a valid integer.',
'percentage_of_females.integer' => 'The number of female participants must be a valid integer.',
'percentage_of_males.integer' => 'The number of male participants must be a valid integer.',
'percentage_of_other.integer' => 'The number of participants with other genders must be a valid integer.',
'age_group.in' => 'Please select a valid age group.',
'extracurricular_activity.required' => 'Please specify if this is an extracurricular activity.',
'extracurricular_activity.in' => 'Please select a valid option for extracurricular activity.',
'recurring_event.required' => 'Please specify if the event is recurring.',
'recurring_event.in' => 'Please select a valid option for recurring event.',
'frequency.in' => 'Please select a valid frequency.',
];
}


private function in($array): string
{
return 'in:'.implode(',', $array);
Expand Down
9 changes: 4 additions & 5 deletions app/Queries/EventsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ public static function store(Request $request)
}
}

foreach ($request['theme'] as $themeId) {
$theme = Theme::where('id', $themeId)->first();
if ($theme) {
$event->themes()->save($theme);
}
foreach ($request['theme'] as $theme) {

$theme = Theme::where('id', $theme)->first();
$event->themes()->save($theme);
}

foreach ($request['audience'] as $audience) {
Expand Down
2 changes: 1 addition & 1 deletion config/geoip.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
|
*/

'cache_tags' => null,
'cache_tags' => ['torann-geoip-location'],

/*
|--------------------------------------------------------------------------
Expand Down
27 changes: 13 additions & 14 deletions database/migrations/2017_07_07_122759_create_countries_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
*/
public function up(): void
{
if (!Schema::hasTable('countries')) {
Schema::create('countries', function (Blueprint $table) {
$table->string('iso')->primary();
$table->string('name');
$table->integer('population')->nullable();
$table->string('continent');
$table->string('facebook');
$table->string('website');
$table->string('longitude');
$table->string('latitude');
$table->string('parent')->nullable();
$table->timestamps();
});
}
Schema::create('countries', function (Blueprint $table) {

$table->string('iso');
$table->string('name');
$table->integer('population')->nullable();
$table->string('continent');
$table->string('facebook');
$table->string('website');
$table->string('longitude');
$table->string('latitude');
$table->string('parent')->nullable();
$table->timestamps();
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,30 @@
*/
public function up(): void
{
if (!Schema::hasTable('bayern_r_s_s_items')) {
Schema::create('bayern_r_s_s_items', function (Blueprint $table) {
$table->id();
$table->integer('uid');
$table->string('title');
$table->longText('description');
$table->string('organizer');
$table->string('photo')->nullable();
$table->dateTime('eventEndDate');
$table->dateTime('eventStartDate');
$table->float('latitude', 12, 8);
$table->float('longitude', 12, 8);
$table->string('location');
$table->string('user_company');
$table->string('user_email');
$table->string('user_publicEmail');
$table->string('user_type');
$table->string('user_website');
$table->string('activity_type');
$table->dateTime('imported_at')->nullable();
$table->string('audience')->nullable();
$table->string('themes')->nullable();
$table->string('tags')->nullable();
$table->timestamps();
});
}
Schema::create('bayern_r_s_s_items', function (Blueprint $table) {
$table->id();
$table->integer('uid')->unique();
$table->string('title');
$table->longText('description');
$table->string('organizer');
$table->string('photo')->nullable();
$table->dateTime('eventEndDate');
$table->dateTime('eventStartDate');
$table->float('latitude', 12, 6);
$table->float('longitude', 12, 6);
$table->string('location');
$table->string('user_company');
$table->string('user_email');
$table->string('user_publicEmail');
$table->string('user_type');
$table->string('user_website');
$table->string('activity_type');
$table->dateTime('imported_at')->nullable();
$table->string('audience')->nullable();
$table->string('themes')->nullable();
$table->string('tags')->nullable();
$table->timestamps();
});

}

Expand Down
14 changes: 7 additions & 7 deletions database/migrations/2024_08_05_093711_add_uuid_failed_jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table('failed_jobs', function (Blueprint $table) {
if (!Schema::hasColumn('failed_jobs', 'uuid')) {
$table->uuid('uuid')->after('id')->nullable(false)->unique();
}
});
if (Schema::hasTable('failed_jobs')) {
Schema::table('failed_jobs', function (Blueprint $table) {
$table->string('uuid')->after('id')->nullable()->unique();
});
}
}

/**
* Reverse the migrations.
*/
public function down(): void
{
if (Schema::hasTable('failed_jobs') && Schema::hasColumn('failed_jobs', 'uuid')) {
if (Schema::hasTable('failed_jobs')) {
Schema::table('failed_jobs', function (Blueprint $table) {
$table->dropColumn('uuid');
});
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit f1338ea

Please sign in to comment.