Entrypoint: Add Application Page

This commit finally adds the dynamically rendered form that changes according to how the user builds their form.
It also fragments the header and footer for the main page into their own separate files for ease of access later.
Vacancy status has also been added to the Vacancies in DB.
All staff application endpoints have also been moved to under the user application endpoints group, for ease of use (duplicated route group).
This commit is contained in:
2020-05-08 06:06:24 +01:00
parent 49c1ed4698
commit 4c6a435e34
11 changed files with 318 additions and 121 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Vacancy;
use Illuminate\Http\Request;
class ApplicationController extends Controller
@@ -36,4 +37,26 @@ class ApplicationController extends Controller
{
return view('dashboard.appmanagement.interview');
}
public function renderApplicationForm(Request $request, $vacancySlug)
{
$vacancyWithForm = Vacancy::with('forms')->where('vacancySlug', $vacancySlug)->get();
if (!$vacancyWithForm->isEmpty())
{
return view('dashboard.application-rendering.apply')
->with([
'vacancy' => $vacancyWithForm->first(),
'preprocessedForm' => json_decode($vacancyWithForm->first()->forms->formStructure, true)
]);
}
else
{
abort(404, 'We\'re ssssorry, but the application form you\'re looking for could not be found.');
}
}
}

View File

@@ -6,6 +6,7 @@ use App\Form;
use App\Http\Requests\VacancyRequest;
use App\Vacancy;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
class VacancyController extends Controller
{
@@ -28,6 +29,7 @@ class VacancyController extends Controller
'vacancyName' => $request->vacancyName,
'vacancyDescription' => $request->vacancyDescription,
'vacancySlug' => Str::slug($request->vacancyName),
'permissionGroupName' => $request->permissionGroup,
'discordRoleID' => $request->discordRole,
'vacancyFormID' => $request->vacancyFormID,