Adds the whole disclaimer feature
This commit is contained in:
@@ -4,16 +4,29 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Services\Config as ConfigService;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
final class LandingController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the landing page.
|
||||
* Display the landing page with a flag indicating whether a disclaimer is configured.
|
||||
*/
|
||||
public function index(): Response
|
||||
public function index(ConfigService $config): Response
|
||||
{
|
||||
return Inertia::render('Landing');
|
||||
return Inertia::render('Landing', [
|
||||
'hasDisclaimer' => $config->contentDisclaimer !== '',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the disclaimer page with the configured markdown content.
|
||||
*/
|
||||
public function disclaimer(ConfigService $config): Response
|
||||
{
|
||||
return Inertia::render('Disclaimer', [
|
||||
'content' => $config->contentDisclaimer,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,11 +205,14 @@ public function result(Session $session): InertiaResponse
|
||||
{
|
||||
$session->load('category');
|
||||
|
||||
$durationSeconds = $session->created_at->diffInSeconds($session->completed_at);
|
||||
|
||||
return Inertia::render('Session/Result', [
|
||||
'session' => $session,
|
||||
'score' => $session->score,
|
||||
'result' => $session->result,
|
||||
'categoryName' => $session->category->name,
|
||||
'durationSeconds' => $durationSeconds,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user