feat: add age requirement field to vacancies, defaulting to 16
Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
parent
043fcd102a
commit
3d219ea429
@ -70,7 +70,8 @@ class VacancyController extends Controller
|
|||||||
'discordRoleID' => $request->discordRole,
|
'discordRoleID' => $request->discordRole,
|
||||||
'vacancyFormID' => $request->vacancyFormID,
|
'vacancyFormID' => $request->vacancyFormID,
|
||||||
'vacancyCount' => $request->vacancyCount,
|
'vacancyCount' => $request->vacancyCount,
|
||||||
'requiresDiscord' => $request->requireDiscordAccount == 'on'
|
'requiresDiscord' => $request->requireDiscordAccount == 'on',
|
||||||
|
'requiredAge' => $request->requiredAge
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -144,6 +145,7 @@ class VacancyController extends Controller
|
|||||||
$vacancy->vacancyDescription = $request->vacancyDescription;
|
$vacancy->vacancyDescription = $request->vacancyDescription;
|
||||||
$vacancy->vacancyCount = $request->vacancyCount;
|
$vacancy->vacancyCount = $request->vacancyCount;
|
||||||
$vacancy->requiresDiscord = $request->requireDiscordAccount == 'on';
|
$vacancy->requiresDiscord = $request->requireDiscordAccount == 'on';
|
||||||
|
$vacancy->requiredAge = $request->requiredAge;
|
||||||
|
|
||||||
$vacancy->save();
|
$vacancy->save();
|
||||||
|
|
||||||
|
@ -47,7 +47,8 @@ class VacancyEditRequest extends FormRequest
|
|||||||
'vacancyDescription' => 'required|string',
|
'vacancyDescription' => 'required|string',
|
||||||
'vacancyFullDescription' => 'nullable|string',
|
'vacancyFullDescription' => 'nullable|string',
|
||||||
'vacancyCount' => 'required|integer|min:1',
|
'vacancyCount' => 'required|integer|min:1',
|
||||||
'requireDiscordAccount' => 'required|string'
|
'requireDiscordAccount' => 'required|string',
|
||||||
|
'requiredAge' => 'required|integer|numeric|min:13|max:100'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,8 @@ class VacancyRequest extends FormRequest
|
|||||||
'discordRole' => 'nullable|string',
|
'discordRole' => 'nullable|string',
|
||||||
'vacancyCount' => 'required|integer',
|
'vacancyCount' => 'required|integer',
|
||||||
'vacancyFormID' => 'required|integer',
|
'vacancyFormID' => 'required|integer',
|
||||||
'requireDiscordAccount' => 'required|string'
|
'requireDiscordAccount' => 'required|string',
|
||||||
|
'requiredAge' => 'required|integer|numeric|min:13|max:100'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,8 @@ class Vacancy extends Model
|
|||||||
'vacancyStatus',
|
'vacancyStatus',
|
||||||
'vacancySlug',
|
'vacancySlug',
|
||||||
'team_id',
|
'team_id',
|
||||||
'requiresDiscord'
|
'requiresDiscord',
|
||||||
|
'requiredAge'
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddRequiredAgeToVacancies extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('vacancies', function (Blueprint $table) {
|
||||||
|
$table->integer('requiredAge')->default(16)->after('vacancyStatus');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('vacancies', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('requiredAge');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -110,6 +110,10 @@
|
|||||||
<label for="remainingSlots">{{__('Remaining slots')}}</label>
|
<label for="remainingSlots">{{__('Remaining slots')}}</label>
|
||||||
<input type="text" class="form-control" value="{{ $vacancy->vacancyCount }}" id="remainingSlots" name="vacancyCount" />
|
<input type="text" class="form-control" value="{{ $vacancy->vacancyCount }}" id="remainingSlots" name="vacancyCount" />
|
||||||
|
|
||||||
|
<label for="requiredAge">{{__('Minimum age')}}</label>
|
||||||
|
<input type="number" min="13" max="100" class="form-control" value="{{ $vacancy->requiredAge }}" id="requiredAge" name="requiredAge" />
|
||||||
|
|
||||||
|
|
||||||
<div class="form-check mt-4">
|
<div class="form-check mt-4">
|
||||||
<input type="hidden" value="off" name="requireDiscordAccount">
|
<input type="hidden" value="off" name="requireDiscordAccount">
|
||||||
<input class="form-check-input" type="checkbox" id="requireDiscordAccount" name="requireDiscordAccount" @if($vacancy->requiresDiscord) checked @endif>
|
<input class="form-check-input" type="checkbox" id="requireDiscordAccount" name="requireDiscordAccount" @if($vacancy->requiresDiscord) checked @endif>
|
||||||
|
@ -88,6 +88,10 @@
|
|||||||
<label for="vacancyCount">{{__('Free slots')}}</label>
|
<label for="vacancyCount">{{__('Free slots')}}</label>
|
||||||
<input rel="txtTooltip" title="{{__('The number of free slots decreases each time an applicant is approved for this vacancy.')}}" data-toggle="tooltip" data-placement="bottom" type="text" id="vacancyCount" name="vacancyCount" class="form-control">
|
<input rel="txtTooltip" title="{{__('The number of free slots decreases each time an applicant is approved for this vacancy.')}}" data-toggle="tooltip" data-placement="bottom" type="text" id="vacancyCount" name="vacancyCount" class="form-control">
|
||||||
|
|
||||||
|
<label for="requiredAge">{{__('Minimum age')}}</label>
|
||||||
|
<input rel="txtTooltip" title="{{__('How old must users be to apply for this vacancy?')}}" data-toggle="tooltip" data-placement="bottom" type="number" min="13" max="100" id="requiredAge" name="requiredAge" class="form-control">
|
||||||
|
|
||||||
|
|
||||||
<div class="form-check mt-4">
|
<div class="form-check mt-4">
|
||||||
<input type="hidden" value="off" name="requireDiscordAccount">
|
<input type="hidden" value="off" name="requireDiscordAccount">
|
||||||
<input class="form-check-input" type="checkbox" value="" id="requireDiscordAccount" name="requireDiscordAccount">
|
<input class="form-check-input" type="checkbox" value="" id="requireDiscordAccount" name="requireDiscordAccount">
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
<p class="text-bold">{{__('You are applying for: :vacancyNameValue', ['vacancyNameValue' => $vacancy->vacancyName])}}</p>
|
<p class="text-bold">{{__('You are applying for: :vacancyNameValue', ['vacancyNameValue' => $vacancy->vacancyName])}}</p>
|
||||||
|
|
||||||
<p>{{__("We're glad you've decided to apply. Generally, applications take 48 hours to be processed and reviewed. Depending on the circumstances and the volume of applications, you may receive an answer in a shorter time.")}}</p>
|
<p>{{__("We're glad you've decided to apply. Generally, applications take 48 hours to be processed and reviewed. Depending on the circumstances and the volume of applications, you may receive an answer in a shorter time.")}}</p>
|
||||||
<p>{{__('Please fill out the form below. Keep all answers concise and complete. Please keep in mind that the age requirement is at least :ageUpperLimitSettingValue years old.', ['ageUpperLimitSettingValue' => '16']) }}.</p>
|
<p>{{__('Please fill out the form below. Keep all answers concise and complete. Please keep in mind that you must be at least :ageUpperLimitSettingValue years old to apply.', ['ageUpperLimitSettingValue' => $vacancy->requiredAge]) }}</p>
|
||||||
<p class="text-bold">{{__('Asking about your application will result in instant denial. Everything you need to know is here.')}}.</p>
|
<p class="text-bold">{{__('Asking about your application will result in instant denial. Everything you need to know is here.')}}.</p>
|
||||||
|
|
||||||
<p><i class="fab fa-markdown"></i> {!! __('All fields support <a target="_blank" href="https://www.markdownguide.org/cheat-sheet/">Markdown</a>') !!}</p>
|
<p><i class="fab fa-markdown"></i> {!! __('All fields support <a target="_blank" href="https://www.markdownguide.org/cheat-sheet/">Markdown</a>') !!}</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user