-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Moved default settings to migrations * Terms of service page --------- Co-authored-by: Konrad Sroga <konradsroga@gmail.com>
- Loading branch information
1 parent
3aa2c3f
commit f92da2d
Showing
16 changed files
with
140 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DoctrineMigrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
final class Version20240909174033 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return 'Insert terms of service setting'; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql('INSERT INTO setting (name, type, value) VALUES (?, ?, ?)', [ | ||
'terms_of_service', | ||
'twig', | ||
'<h1>Terms of service</h1> <p>You can set content of this page in settings.</p>', | ||
]); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->addSql('DELETE FROM setting WHERE name = ?', ['terms_of_service']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace App\Core\Controller; | ||
|
||
use App\Core\Enum\SettingEnum; | ||
use App\Core\Service\SettingService; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
class PageController extends AbstractController | ||
{ | ||
#[Route('/terms-of-service', name: 'terms_of_service')] | ||
public function index( | ||
SettingService $settingService, | ||
): Response { | ||
$pageContent = $settingService->getSetting(SettingEnum::TERMS_OF_SERVICE->value); | ||
if (empty($pageContent)) { | ||
throw new NotFoundHttpException(); | ||
} | ||
return $this->render('panel/page/default.html.twig', [ | ||
'pageContent' => $pageContent, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% extends 'base.html.twig' %} | ||
|
||
{% block body_class 'page-login' %} | ||
{% block title %}{{ get_title() }} | {{ 'pteroca.register.title'|trans }}{% endblock %} | ||
|
||
{% block stylesheets %} | ||
<link rel="stylesheet" href="{{ asset('/assets/css/app.css') }}"> | ||
<link rel="stylesheet" href="{{ asset('/assets/css/panel.css') }}"> | ||
{% endblock %} | ||
|
||
{% block body %} | ||
<div class="default-page container"> | ||
<div class="row"> | ||
{{ pageContent|raw }} | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters