Basic functionality
This commit is contained in:
26
app/modules/Admin/BaseAdminPresenter.php
Executable file
26
app/modules/Admin/BaseAdminPresenter.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Admin;
|
||||
|
||||
use App\Model\App;
|
||||
use App\Modules\Base\SecuredPresenter;
|
||||
use Nette\Application\UI\ComponentReflection;
|
||||
|
||||
abstract class BaseAdminPresenter extends SecuredPresenter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param ComponentReflection|mixed $element
|
||||
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
|
||||
*/
|
||||
public function checkRequirements($element): void
|
||||
{
|
||||
parent::checkRequirements($element);
|
||||
|
||||
if (!$this->user->isAllowed('Admin:Home')) {
|
||||
$this->flashError('You cannot access this with user role');
|
||||
$this->redirect(App::DESTINATION_FRONT_HOMEPAGE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
31
app/modules/Admin/Home/HomePresenter.php
Executable file
31
app/modules/Admin/Home/HomePresenter.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Admin\Home;
|
||||
|
||||
use App\Domain\Order\Event\OrderCreated;
|
||||
use App\Modules\Admin\BaseAdminPresenter;
|
||||
use Nette\Application\UI\Form;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
final class HomePresenter extends BaseAdminPresenter
|
||||
{
|
||||
|
||||
/** @var EventDispatcherInterface @inject */
|
||||
public $dispatcher;
|
||||
|
||||
protected function createComponentOrderForm(): Form
|
||||
{
|
||||
$form = new Form();
|
||||
|
||||
$form->addText('order', 'Order name')
|
||||
->setRequired(true);
|
||||
$form->addSubmit('send', 'OK');
|
||||
|
||||
$form->onSuccess[] = function (Form $form): void {
|
||||
$this->dispatcher->dispatch(new OrderCreated($form->values->order), OrderCreated::NAME);
|
||||
};
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
}
|
||||
8
app/modules/Admin/Home/templates/default.latte
Executable file
8
app/modules/Admin/Home/templates/default.latte
Executable file
@@ -0,0 +1,8 @@
|
||||
{block #content}
|
||||
<h1>SECRET PAGE!</h1>
|
||||
<a n:href="Sign:out" class="btn btn-danger">Logout</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>Orders</h2>
|
||||
{control orderForm}
|
||||
75
app/modules/Admin/Sign/SignPresenter.php
Executable file
75
app/modules/Admin/Sign/SignPresenter.php
Executable file
@@ -0,0 +1,75 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Admin\Sign;
|
||||
|
||||
use App\Model\App;
|
||||
use App\Model\Exception\Runtime\AuthenticationException;
|
||||
use App\Modules\Admin\BaseAdminPresenter;
|
||||
use App\UI\Form\BaseForm;
|
||||
use App\UI\Form\FormFactory;
|
||||
use Nette\Application\UI\ComponentReflection;
|
||||
|
||||
final class SignPresenter extends BaseAdminPresenter
|
||||
{
|
||||
|
||||
/** @var string @persistent */
|
||||
public $backlink;
|
||||
|
||||
/** @var FormFactory @inject */
|
||||
public $formFactory;
|
||||
|
||||
/**
|
||||
* @param ComponentReflection|mixed $element
|
||||
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
|
||||
*/
|
||||
public function checkRequirements($element): void
|
||||
{
|
||||
}
|
||||
|
||||
public function actionIn(): void
|
||||
{
|
||||
if ($this->user->isLoggedIn()) {
|
||||
$this->redirect(App::DESTINATION_AFTER_SIGN_IN);
|
||||
}
|
||||
}
|
||||
|
||||
public function actionOut(): void
|
||||
{
|
||||
if ($this->user->isLoggedIn()) {
|
||||
$this->user->logout();
|
||||
$this->flashSuccess('_front.sign.out.success');
|
||||
}
|
||||
|
||||
$this->redirect(App::DESTINATION_AFTER_SIGN_OUT);
|
||||
}
|
||||
|
||||
protected function createComponentLoginForm(): BaseForm
|
||||
{
|
||||
$form = $this->formFactory->forBackend();
|
||||
$form->addEmail('email')
|
||||
->setRequired(true);
|
||||
$form->addPassword('password')
|
||||
->setRequired(true);
|
||||
$form->addCheckbox('remember')
|
||||
->setDefaultValue(true);
|
||||
$form->addSubmit('submit');
|
||||
$form->onSuccess[] = [$this, 'processLoginForm'];
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
public function processLoginForm(BaseForm $form): void
|
||||
{
|
||||
try {
|
||||
$this->user->setExpiration($form->values->remember ? '14 days' : '20 minutes');
|
||||
$this->user->login($form->values->email, $form->values->password);
|
||||
} catch (AuthenticationException $e) {
|
||||
$form->addError('Invalid username or password');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->redirect(App::DESTINATION_AFTER_SIGN_IN);
|
||||
}
|
||||
|
||||
}
|
||||
29
app/modules/Admin/Sign/templates/in.latte
Executable file
29
app/modules/Admin/Sign/templates/in.latte
Executable file
@@ -0,0 +1,29 @@
|
||||
{block #content}
|
||||
<form n:name="loginForm" class="form-signin">
|
||||
<div class="text-center mb-4">
|
||||
<img class="mb-4" src="https://avatars0.githubusercontent.com/u/99965?s=200&v=4" alt="" width="72" height="72">
|
||||
<h1 class="h3 mb-3 font-weight-normal">Webapp Skeleton Admin</h1>
|
||||
</div>
|
||||
|
||||
<div n:foreach="$form->errors as $error" class="alert alert-danger" role="alert">
|
||||
{$error}
|
||||
</div>
|
||||
|
||||
<div class="form-label-group">
|
||||
<input type="email" n:name="email" class="form-control" placeholder="Email address" required autofocus>
|
||||
<label n:name="email">Email address</label>
|
||||
</div>
|
||||
|
||||
<div class="form-label-group">
|
||||
<input type="password" n:name="password" class="form-control" placeholder="Password" required>
|
||||
<label n:name="password">Password</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox mb-3">
|
||||
<label>
|
||||
<input n:name="remember" type="checkbox"> Remember me
|
||||
</label>
|
||||
</div>
|
||||
<button n:name="submit" class="btn btn-lg btn-primary btn-block">Sign in</button>
|
||||
<p class="mt-5 mb-3 text-muted text-center">© {=date('Y')}</p>
|
||||
</form>
|
||||
7
app/modules/Admin/templates/@layout.latte
Executable file
7
app/modules/Admin/templates/@layout.latte
Executable file
@@ -0,0 +1,7 @@
|
||||
{layout '../../Base/templates/@layout.latte'}
|
||||
|
||||
{block #head}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.2.1/css/bootstrap.min.css" defer />
|
||||
<link rel="stylesheet" href="{$basePath}/assets/admin.css" defer />
|
||||
<script src="{$basePath}/assets/admin.js" defer></script>
|
||||
{/block}
|
||||
44
app/modules/Base/BaseError4xxPresenter.php
Executable file
44
app/modules/Base/BaseError4xxPresenter.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Base;
|
||||
|
||||
use App\Model\Exception\Runtime\InvalidStateException;
|
||||
use Nette\Application\BadRequestException;
|
||||
use Nette\Application\Request;
|
||||
use Nette\Application\UI\ComponentReflection;
|
||||
|
||||
abstract class BaseError4xxPresenter extends SecuredPresenter
|
||||
{
|
||||
|
||||
/**
|
||||
* Common presenter method
|
||||
*/
|
||||
public function startup(): void
|
||||
{
|
||||
parent::startup();
|
||||
|
||||
if ($this->getRequest() !== null && $this->getRequest()->isMethod(Request::FORWARD)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->error();
|
||||
}
|
||||
|
||||
public function renderDefault(BadRequestException $exception): void
|
||||
{
|
||||
$rf1 = new ComponentReflection(static::class);
|
||||
$fileName = $rf1->getFileName();
|
||||
|
||||
// Validate if class is not in PHP core
|
||||
if ($fileName === false) {
|
||||
throw new InvalidStateException('Class is defined in the PHP core or in a PHP extension');
|
||||
}
|
||||
|
||||
$dir = dirname($fileName);
|
||||
|
||||
// Load template 403.latte or 404.latte or ... 4xx.latte
|
||||
$file = $dir . '/templates/' . $exception->getCode() . '.latte';
|
||||
$this->template->setFile(is_file($file) ? $file : $dir . '/templates/4xx.latte');
|
||||
}
|
||||
|
||||
}
|
||||
57
app/modules/Base/BaseErrorPresenter.php
Executable file
57
app/modules/Base/BaseErrorPresenter.php
Executable file
@@ -0,0 +1,57 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Base;
|
||||
|
||||
use Nette\Application\BadRequestException;
|
||||
use Nette\Application\Helpers;
|
||||
use Nette\Application\IResponse as AppResponse;
|
||||
use Nette\Application\Request;
|
||||
use Nette\Application\Responses\CallbackResponse;
|
||||
use Nette\Application\Responses\ForwardResponse;
|
||||
use Nette\Http\IRequest;
|
||||
use Nette\Http\IResponse;
|
||||
use Psr\Log\LogLevel;
|
||||
use Throwable;
|
||||
use Tracy\Debugger;
|
||||
use Tracy\ILogger;
|
||||
|
||||
abstract class BaseErrorPresenter extends SecuredPresenter
|
||||
{
|
||||
|
||||
/**
|
||||
* @return ForwardResponse|CallbackResponse
|
||||
*/
|
||||
public function run(Request $request): AppResponse
|
||||
{
|
||||
$e = $request->getParameter('exception');
|
||||
|
||||
if ($e instanceof Throwable) {
|
||||
$code = $e->getCode();
|
||||
$level = ($code >= 400 && $code <= 499) ? LogLevel::WARNING : LogLevel::ERROR;
|
||||
|
||||
Debugger::log(sprintf(
|
||||
'Code %s: %s in %s:%s',
|
||||
$code,
|
||||
$e->getMessage(),
|
||||
$e->getFile(),
|
||||
$e->getLine()
|
||||
), $level);
|
||||
|
||||
Debugger::log($e, ILogger::EXCEPTION);
|
||||
}
|
||||
|
||||
if ($e instanceof BadRequestException) {
|
||||
[$module, , $sep] = Helpers::splitName($request->getPresenterName());
|
||||
|
||||
return new ForwardResponse($request->setPresenterName($module . $sep . 'Error4xx'));
|
||||
}
|
||||
|
||||
return new CallbackResponse(function (IRequest $httpRequest, IResponse $httpResponse): void {
|
||||
$header = $httpResponse->getHeader('Content-Type');
|
||||
if ($header !== null && preg_match('#^text/html(?:;|$)#', $header)) {
|
||||
require __DIR__ . '/templates/500.phtml';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
23
app/modules/Base/BasePresenter.php
Executable file
23
app/modules/Base/BasePresenter.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Base;
|
||||
|
||||
use App\Model\Latte\TemplateProperty;
|
||||
use App\Model\Security\SecurityUser;
|
||||
use App\UI\Control\TFlashMessage;
|
||||
use App\UI\Control\TModuleUtils;
|
||||
use Contributte\Application\UI\Presenter\StructuredTemplates;
|
||||
use Nette\Application\UI\Presenter;
|
||||
|
||||
/**
|
||||
* @property-read TemplateProperty $template
|
||||
* @property-read SecurityUser $user
|
||||
*/
|
||||
abstract class BasePresenter extends Presenter
|
||||
{
|
||||
|
||||
use StructuredTemplates;
|
||||
use TFlashMessage;
|
||||
use TModuleUtils;
|
||||
|
||||
}
|
||||
30
app/modules/Base/SecuredPresenter.php
Executable file
30
app/modules/Base/SecuredPresenter.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Base;
|
||||
|
||||
use App\Model\App;
|
||||
use Nette\Application\UI\ComponentReflection;
|
||||
use Nette\Security\IUserStorage;
|
||||
|
||||
abstract class SecuredPresenter extends BasePresenter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param ComponentReflection|mixed $element
|
||||
* @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint
|
||||
*/
|
||||
public function checkRequirements($element): void
|
||||
{
|
||||
if (!$this->user->isLoggedIn()) {
|
||||
if ($this->user->getLogoutReason() === IUserStorage::INACTIVITY) {
|
||||
$this->flashInfo('You have been logged out for inactivity');
|
||||
}
|
||||
|
||||
$this->redirect(
|
||||
App::DESTINATION_SIGN_IN,
|
||||
['backlink' => $this->storeRequest()]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
8
app/modules/Base/UnsecuredPresenter.php
Executable file
8
app/modules/Base/UnsecuredPresenter.php
Executable file
@@ -0,0 +1,8 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Base;
|
||||
|
||||
abstract class UnsecuredPresenter extends BasePresenter
|
||||
{
|
||||
|
||||
}
|
||||
27
app/modules/Base/templates/500.phtml
Executable file
27
app/modules/Base/templates/500.phtml
Executable file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html><!-- "' --></textarea></script></style></pre></xmp></a></audio></button></canvas></datalist></details></dialog></iframe></listing></meter></noembed></noframes></noscript></optgroup></option></progress></rp></select></table></template></title></video>
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<title>Server Error</title>
|
||||
|
||||
<style>
|
||||
#nette-error { all: initial; position: absolute; top: 0; left: 0; right: 0; height: 70vh; min-height: 400px; display: flex; align-items: center; justify-content: center; z-index: 1000 }
|
||||
#nette-error div { all: initial; max-width: 550px; background: white; color: #333; display: block }
|
||||
#nette-error h1 { all: initial; font: bold 50px/1.1 sans-serif; display: block; margin: 40px }
|
||||
#nette-error p { all: initial; font: 20px/1.4 sans-serif; margin: 40px; display: block }
|
||||
#nette-error small { color: gray }
|
||||
</style>
|
||||
|
||||
<div id=nette-error>
|
||||
<div>
|
||||
<h1>Server Error</h1>
|
||||
|
||||
<p>We're sorry! The server encountered an internal error and
|
||||
was unable to complete your request. Please try again later.</p>
|
||||
|
||||
<p><small>error 500</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.body.insertBefore(document.getElementById('nette-error'), document.body.firstChild);
|
||||
</script>
|
||||
65
app/modules/Base/templates/@layout.latte
Executable file
65
app/modules/Base/templates/@layout.latte
Executable file
@@ -0,0 +1,65 @@
|
||||
{**
|
||||
* @param string $basePath web base path
|
||||
* @param array $flashes flash messages
|
||||
*}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>{ifset title}{include title|striptags} | {/ifset}Nette Sandbox</title>
|
||||
|
||||
<link rel="stylesheet" href="{$basePath}/css/style.css">
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
|
||||
{block head}{/block}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<hgroup>
|
||||
<h1>My Dictionary</h1>
|
||||
<h2>multilanguage dictionary with pronunciations</h2>
|
||||
</hgroup>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="{link Homepage:default}">Jednoduchý</a></li>
|
||||
<li><a href="{link Homepage:ipa}">s výslovnosťou</a></li>
|
||||
<li><a href="{link Homepage:interactive}">Interaktívny</a></li>
|
||||
<li><a href="{link Homepage:alphabet}">Abeceda</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<a href="#" title="Jaro's Solutions homepage"><img src="logo.gif" alt="Jaro's Solutions" /></a>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<h1 n:ifset="$title">{$title}</h1>
|
||||
|
||||
<div n:foreach="$flashes as $flash" n:class="flash, $flash->type">{$flash->message}</div>
|
||||
|
||||
{include content}
|
||||
</article>
|
||||
|
||||
<section>
|
||||
<h1>Slovníky</h1>
|
||||
<ul>
|
||||
{foreach $translations as $tr}
|
||||
<li><a href="{link Homepage:select $tr["slug"] }">{$tr["lang"]}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<p>© 2016 Jaro's Solutions - <a href="#">Sitemap</a> </p>
|
||||
</footer>
|
||||
|
||||
{block scripts}
|
||||
<script src="https://nette.github.io/resources/js/netteForms.min.js"></script>
|
||||
<script src="{$basePath}/js/nette.ajax.js"></script>
|
||||
<script src="{$basePath}/js/main.js"></script>
|
||||
{/block}
|
||||
</body>
|
||||
</html>
|
||||
22
app/modules/Front/BaseFrontPresenter.php
Executable file
22
app/modules/Front/BaseFrontPresenter.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Front;
|
||||
|
||||
use Nette;
|
||||
use Vite;
|
||||
|
||||
|
||||
/**
|
||||
* Base presenter for all application presenters.
|
||||
*/
|
||||
abstract class BaseFrontPresenter extends Nette\Application\UI\Presenter
|
||||
{
|
||||
public function __construct(
|
||||
private Vite $vite,
|
||||
) {}
|
||||
|
||||
public function beforeRender(): void
|
||||
{
|
||||
$this->template->vite = $this->vite;
|
||||
}
|
||||
}
|
||||
10
app/modules/Front/Error/ErrorPresenter.php
Executable file
10
app/modules/Front/Error/ErrorPresenter.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Front\Error;
|
||||
|
||||
use App\Modules\Base\BaseErrorPresenter;
|
||||
|
||||
final class ErrorPresenter extends BaseErrorPresenter
|
||||
{
|
||||
|
||||
}
|
||||
10
app/modules/Front/Error4xx/Error4xxPresenter.php
Executable file
10
app/modules/Front/Error4xx/Error4xxPresenter.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Front\Error4xx;
|
||||
|
||||
use App\Modules\Base\BaseError4xxPresenter;
|
||||
|
||||
final class Error4xxPresenter extends BaseError4xxPresenter
|
||||
{
|
||||
|
||||
}
|
||||
7
app/modules/Front/Error4xx/templates/403.latte
Executable file
7
app/modules/Front/Error4xx/templates/403.latte
Executable file
@@ -0,0 +1,7 @@
|
||||
{block #content}
|
||||
<h1 n:block=title>Access Denied</h1>
|
||||
|
||||
<p>You do not have permission to view this page. Please try contact the web
|
||||
site administrator if you believe you should be able to view this page.</p>
|
||||
|
||||
<p><small>error 403</small></p>
|
||||
8
app/modules/Front/Error4xx/templates/404.latte
Executable file
8
app/modules/Front/Error4xx/templates/404.latte
Executable file
@@ -0,0 +1,8 @@
|
||||
{block #content}
|
||||
<h1 n:block=title>Page Not Found</h1>
|
||||
|
||||
<p>The page you requested could not be found. It is possible that the address is
|
||||
incorrect, or that the page no longer exists. Please use a search engine to find
|
||||
what you are looking for.</p>
|
||||
|
||||
<p><small>error 404</small></p>
|
||||
6
app/modules/Front/Error4xx/templates/405.latte
Executable file
6
app/modules/Front/Error4xx/templates/405.latte
Executable file
@@ -0,0 +1,6 @@
|
||||
{block #content}
|
||||
<h1 n:block=title>Method Not Allowed</h1>
|
||||
|
||||
<p>The requested method is not allowed for the URL.</p>
|
||||
|
||||
<p><small>error 405</small></p>
|
||||
6
app/modules/Front/Error4xx/templates/410.latte
Executable file
6
app/modules/Front/Error4xx/templates/410.latte
Executable file
@@ -0,0 +1,6 @@
|
||||
{block #content}
|
||||
<h1 n:block=title>Page Not Found</h1>
|
||||
|
||||
<p>The page you requested has been taken off the site. We apologize for the inconvenience.</p>
|
||||
|
||||
<p><small>error 410</small></p>
|
||||
4
app/modules/Front/Error4xx/templates/4xx.latte
Executable file
4
app/modules/Front/Error4xx/templates/4xx.latte
Executable file
@@ -0,0 +1,4 @@
|
||||
{block #content}
|
||||
<h1 n:block=title>Oops...</h1>
|
||||
|
||||
<p>Your browser sent a request that this server could not understand or process.</p>
|
||||
10
app/modules/Front/Home/HomePresenter.php
Executable file
10
app/modules/Front/Home/HomePresenter.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php //declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Front\Home;
|
||||
use App\Modules\Front\BaseFrontPresenter;
|
||||
use Nette;
|
||||
|
||||
final class HomePresenter extends BaseFrontPresenter
|
||||
{
|
||||
}
|
||||
|
||||
7
app/modules/Front/Home/templates/Error/403.latte
Executable file
7
app/modules/Front/Home/templates/Error/403.latte
Executable file
@@ -0,0 +1,7 @@
|
||||
{block content}
|
||||
<h1 n:block=title>Access Denied</h1>
|
||||
|
||||
<p>You do not have permission to view this page. Please try contact the web
|
||||
site administrator if you believe you should be able to view this page.</p>
|
||||
|
||||
<p><small>error 403</small></p>
|
||||
8
app/modules/Front/Home/templates/Error/404.latte
Executable file
8
app/modules/Front/Home/templates/Error/404.latte
Executable file
@@ -0,0 +1,8 @@
|
||||
{block content}
|
||||
<h1 n:block=title>Page Not Found</h1>
|
||||
|
||||
<p>The page you requested could not be found. It is possible that the address is
|
||||
incorrect, or that the page no longer exists. Please use a search engine to find
|
||||
what you are looking for.</p>
|
||||
|
||||
<p><small>error 404</small></p>
|
||||
6
app/modules/Front/Home/templates/Error/405.latte
Executable file
6
app/modules/Front/Home/templates/Error/405.latte
Executable file
@@ -0,0 +1,6 @@
|
||||
{block content}
|
||||
<h1 n:block=title>Method Not Allowed</h1>
|
||||
|
||||
<p>The requested method is not allowed for the URL.</p>
|
||||
|
||||
<p><small>error 405</small></p>
|
||||
6
app/modules/Front/Home/templates/Error/410.latte
Executable file
6
app/modules/Front/Home/templates/Error/410.latte
Executable file
@@ -0,0 +1,6 @@
|
||||
{block content}
|
||||
<h1 n:block=title>Page Not Found</h1>
|
||||
|
||||
<p>The page you requested has been taken off the site. We apologize for the inconvenience.</p>
|
||||
|
||||
<p><small>error 410</small></p>
|
||||
4
app/modules/Front/Home/templates/Error/4xx.latte
Executable file
4
app/modules/Front/Home/templates/Error/4xx.latte
Executable file
@@ -0,0 +1,4 @@
|
||||
{block content}
|
||||
<h1 n:block=title>Oops...</h1>
|
||||
|
||||
<p>Your browser sent a request that this server could not understand or process.</p>
|
||||
27
app/modules/Front/Home/templates/Error/500.phtml
Executable file
27
app/modules/Front/Home/templates/Error/500.phtml
Executable file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html><!-- "' --></textarea></script></style></pre></xmp></a></audio></button></canvas></datalist></details></dialog></iframe></listing></meter></noembed></noframes></noscript></optgroup></option></progress></rp></select></table></template></title></video>
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<title>Server Error</title>
|
||||
|
||||
<style>
|
||||
#nette-error { all: initial; position: absolute; top: 0; left: 0; right: 0; height: 70vh; min-height: 400px; display: flex; align-items: center; justify-content: center; z-index: 1000 }
|
||||
#nette-error div { all: initial; max-width: 550px; background: white; color: #333; display: block }
|
||||
#nette-error h1 { all: initial; font: bold 50px/1.1 sans-serif; display: block; margin: 40px }
|
||||
#nette-error p { all: initial; font: 20px/1.4 sans-serif; margin: 40px; display: block }
|
||||
#nette-error small { color: gray }
|
||||
</style>
|
||||
|
||||
<div id=nette-error>
|
||||
<div>
|
||||
<h1>Server Error</h1>
|
||||
|
||||
<p>We're sorry! The server encountered an internal error and
|
||||
was unable to complete your request. Please try again later.</p>
|
||||
|
||||
<p><small>error 500</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.body.insertBefore(document.getElementById('nette-error'), document.body.firstChild);
|
||||
</script>
|
||||
24
app/modules/Front/Home/templates/Error/503.phtml
Executable file
24
app/modules/Front/Home/templates/Error/503.phtml
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
header('HTTP/1.1 503 Service Unavailable');
|
||||
header('Retry-After: 300'); // 5 minutes in seconds
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<meta name="generator" content="Nette Framework">
|
||||
|
||||
<style>
|
||||
body { color: #333; background: white; width: 500px; margin: 100px auto }
|
||||
h1 { font: bold 47px/1.5 sans-serif; margin: .6em 0 }
|
||||
p { font: 21px/1.5 Georgia,serif; margin: 1.5em 0 }
|
||||
</style>
|
||||
|
||||
<title>Site is temporarily down for maintenance</title>
|
||||
|
||||
<h1>We're Sorry</h1>
|
||||
|
||||
<p>The site is temporarily down for maintenance. Please try again in a few minutes.</p>
|
||||
5
app/modules/Front/Home/templates/Home/default.latte
Executable file
5
app/modules/Front/Home/templates/Home/default.latte
Executable file
@@ -0,0 +1,5 @@
|
||||
{* This is the welcome page, you can delete it *}
|
||||
|
||||
{block content}
|
||||
<div id="app">
|
||||
</div>
|
||||
29
app/modules/Front/templates/@layout.latte
Executable file
29
app/modules/Front/templates/@layout.latte
Executable file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<title>{ifset title}{include title|stripHtml} | {/ifset}Nette Web</title>
|
||||
|
||||
{if $vite->isEnabled()}
|
||||
<script type="module" src="{='@vite/client'|asset}"></script>
|
||||
{else}
|
||||
{foreach $vite->getCssAssets('src/scripts/main.js') as $path}
|
||||
<link rel="stylesheet" href="{$path}">
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
<script src="{='src/scripts/main.js'|asset}" type="module"></script>
|
||||
</head>
|
||||
|
||||
<body data-controller="body">
|
||||
<div n:foreach="$flashes as $flash" n:class="flash, $flash->type">{$flash->message}</div>
|
||||
|
||||
|
||||
{include content}
|
||||
|
||||
{block scripts}
|
||||
{/block}
|
||||
</body>
|
||||
</html>
|
||||
35
app/modules/Mailing/Home/HomePresenter.php
Executable file
35
app/modules/Mailing/Home/HomePresenter.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Mailing\Home;
|
||||
|
||||
use Contributte\Mailing\IMailBuilderFactory;
|
||||
use Nette\Application\UI\Presenter;
|
||||
|
||||
class HomePresenter extends Presenter
|
||||
{
|
||||
|
||||
/** @var IMailBuilderFactory */
|
||||
private $mailBuilderFactory;
|
||||
|
||||
public function __construct(IMailBuilderFactory $mailBuilderFactory)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->mailBuilderFactory = $mailBuilderFactory;
|
||||
}
|
||||
|
||||
public function actionDefault(): void
|
||||
{
|
||||
$mail = $this->mailBuilderFactory->create();
|
||||
$mail->setSubject('Example');
|
||||
$mail->addTo('foo@example.com');
|
||||
|
||||
$mail->setTemplateFile(__DIR__ . '/templates/Emails/email.latte');
|
||||
$mail->setParameters([
|
||||
'title' => 'Title',
|
||||
'content' => 'Lorem ipsum dolor sit amet',
|
||||
]);
|
||||
|
||||
$mail->send();
|
||||
}
|
||||
|
||||
}
|
||||
19
app/modules/Mailing/Home/templates/@layout.latte
Executable file
19
app/modules/Mailing/Home/templates/@layout.latte
Executable file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<title>{ifset title}{include title|stripHtml} | {/ifset}Nette Web</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div n:foreach="$flashes as $flash" n:class="flash, $flash->type">{$flash->message}</div>
|
||||
|
||||
{include content}
|
||||
|
||||
{block scripts}
|
||||
<script src="https://nette.github.io/resources/js/netteForms.min.js"></script>
|
||||
{/block}
|
||||
</body>
|
||||
</html>
|
||||
9
app/modules/Mailing/Home/templates/Emails/email.latte
Executable file
9
app/modules/Mailing/Home/templates/Emails/email.latte
Executable file
@@ -0,0 +1,9 @@
|
||||
{layout $_config->layout}
|
||||
|
||||
{block #header}
|
||||
{$title}
|
||||
{/block}
|
||||
|
||||
{block #content}
|
||||
{$content}
|
||||
{/block}
|
||||
38
app/modules/Mailing/Home/templates/Home/default.latte
Executable file
38
app/modules/Mailing/Home/templates/Home/default.latte
Executable file
@@ -0,0 +1,38 @@
|
||||
{* This is the welcome page, you can delete it *}
|
||||
|
||||
{block content}
|
||||
<div id="banner">
|
||||
<h1 n:block=title>Congratulations!</h1>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<h2>You have successfully created your <a href="https://nette.org">Nette</a> Web project.</h2>
|
||||
|
||||
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABVCAYAAAD0bJKxAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACudJREFUeNrMXG1sFMcZfvfu7ECw7+xDaQL+AApE1B+EJLapSNs4QIhtVWp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bBjtFF+r9106a1YH5B8XHcZ6rDLNwddLPN35iBXOMCVFySjgFRD/TLX3+vcMA+dnJwEO7Mz4PhcT6Gwtb5v/P5mrpVGzMPkclMywwMS63dW0CGrba0bMnFSx0fHR803P/NGNRA1mchzW4f2Zrn7DKIBqvc4wCv/XDmhAc+15bUmeYJzcmi4ynBcVkdPOB57Y04HY8wr1UtKlzvnDOs6FcmUCrgWNgt+98LDvuQixwBFz3nZFtRPUIgw4ASJHBKsB+UvfcAjvCybH/gxGD2Fz3gpphjwNn3BbcZibmkJMdk/1MKZhekMSigpXn/FxXKiupzmVIqwP5l/KLDRTJiB0WegSBuAL33TET7XI+k6p1AAigEAGAodM2C3mlBgmMywlbZAjjrqtSTobEvKwsaGgMhQFPd56b/CzAArAe2YDJd4I4AAAAASUVORK5CYII=" alt="">
|
||||
If you are exploring Nette for the first time, you should read the
|
||||
<a href="https://doc.nette.org/quickstart">Quick Start</a>, <a href="https://doc.nette.org">documentation</a>,
|
||||
<a href="https://pla.nette.org">tutorials</a> and <a href="https://forum.nette.org">forum</a>.</p>
|
||||
|
||||
<h2>We hope you enjoy Nette!</h2>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
html { font: normal 18px/1.3 Georgia, "New York CE", utopia, serif; color: #666; -webkit-text-stroke: 1px rgba(0,0,0,0); overflow-y: scroll; }
|
||||
body { background: #3484d2; color: #333; margin: 2em auto; padding: 0 .5em; max-width: 600px; min-width: 320px; }
|
||||
|
||||
a { color: #006aeb; padding: 3px 1px; }
|
||||
a:hover, a:active, a:focus { background-color: #006aeb; text-decoration: none; color: white; }
|
||||
|
||||
#banner { border-radius: 12px 12px 0 0; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAB5CAMAAADPursXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGBQTFRFD1CRDkqFDTlmDkF1D06NDT1tDTNZDk2KEFWaDTZgDkiCDTtpDT5wDkZ/DTBVEFacEFOWD1KUDTRcDTFWDkV9DkR7DkN4DkByDTVeDC9TDThjDTxrDkeADkuIDTRbDC9SbsUaggAAAEdJREFUeNqkwYURgAAQA7DH3d3335LSKyxAYpf9vWCpnYbf01qcOdFVXc14w4BznNTjkQfsscAdU3b4wIh9fDVYc4zV8xZgAAYaCMI6vPgLAAAAAElFTkSuQmCC); }
|
||||
|
||||
h1 { font: inherit; color: white; font-size: 50px; line-height: 121px; margin: 0; padding-left: 4%; background: url(https://files.nette.org/images/logo-nette@2.png) no-repeat 95%; background-size: 130px auto; text-shadow: 1px 1px 0 rgba(0, 0, 0, .9); }
|
||||
@media (max-width: 600px) {
|
||||
h1 { background: none; font-size: 40px; }
|
||||
}
|
||||
|
||||
#content { background: white; border: 1px solid #eff4f7; border-radius: 0 0 12px 12px; padding: 10px 4%; overflow: hidden; }
|
||||
|
||||
h2 { font: inherit; padding: 1.2em 0; margin: 0; }
|
||||
|
||||
img { border: none; float: right; margin: 0 0 1em 3em; }
|
||||
</style>
|
||||
46
app/modules/Pdf/Home/HomePresenter.php
Executable file
46
app/modules/Pdf/Home/HomePresenter.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace App\Modules\Pdf\Home;
|
||||
|
||||
use App\Modules\Base\BasePresenter;
|
||||
use Contributte\PdfResponse\PdfResponse;
|
||||
use Nette\Bridges\ApplicationLatte\Template;
|
||||
|
||||
class HomePresenter extends BasePresenter
|
||||
{
|
||||
|
||||
/** @inject */
|
||||
public PdfResponse $pdfResponse;
|
||||
|
||||
private function createPdf(): PdfResponse
|
||||
{
|
||||
/** @var Template $template */
|
||||
$template = $this->createTemplate();
|
||||
$template->setFile(__DIR__ . '/../../../resources/pdf/example.latte');
|
||||
$template->title = 'Contributte PDF example';
|
||||
|
||||
$this->pdfResponse->setTemplate($template->renderToString());
|
||||
$this->pdfResponse->documentTitle = 'Contributte PDF example'; // creates filename 2012-06-30-my-super-title.pdf
|
||||
$this->pdfResponse->pageFormat = 'A4-L'; // wide format
|
||||
$this->pdfResponse->getMPDF()->SetFooter('|Contributte PDF|'); // footer
|
||||
|
||||
return $this->pdfResponse;
|
||||
}
|
||||
|
||||
public function actionViewPdf(): void
|
||||
{
|
||||
$pdf = $this->createPdf();
|
||||
$pdf->setSaveMode(PdfResponse::INLINE);
|
||||
|
||||
$this->sendResponse($pdf);
|
||||
}
|
||||
|
||||
public function actionDownloadPdf(): void
|
||||
{
|
||||
$pdf = $this->createPdf();
|
||||
$pdf->setSaveMode(PdfResponse::DOWNLOAD);
|
||||
|
||||
$this->sendResponse($pdf);
|
||||
}
|
||||
|
||||
}
|
||||
34
app/modules/Pdf/Home/templates/default.latte
Executable file
34
app/modules/Pdf/Home/templates/default.latte
Executable file
@@ -0,0 +1,34 @@
|
||||
{block #content}
|
||||
<div id="banner">
|
||||
<h1 n:block=title>Contributte PDF example</h1>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<h2>Welcome in example of using contributte/pdf.</h2>
|
||||
|
||||
<a n:href="Home:viewPdf" target="_blank">View generated PDF</a>
|
||||
<br><br>
|
||||
<a n:href="Home:downloadPdf" target="_blank">Download generated PDF</a>
|
||||
<p></p>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
html { font: normal 18px/1.3 Georgia, "New York CE", utopia, serif; color: #666; -webkit-text-stroke: 1px rgba(0,0,0,0); overflow-y: scroll; }
|
||||
body { background: #3484d2; color: #333; margin: 2em auto; padding: 0 .5em; max-width: 800px; min-width: 320px; }
|
||||
|
||||
a { color: #006aeb; padding: 3px 1px; }
|
||||
a:hover, a:active, a:focus { background-color: #006aeb; text-decoration: none; color: white; }
|
||||
|
||||
#banner { border-radius: 12px 12px 0 0; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAB5CAMAAADPursXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGBQTFRFD1CRDkqFDTlmDkF1D06NDT1tDTNZDk2KEFWaDTZgDkiCDTtpDT5wDkZ/DTBVEFacEFOWD1KUDTRcDTFWDkV9DkR7DkN4DkByDTVeDC9TDThjDTxrDkeADkuIDTRbDC9SbsUaggAAAEdJREFUeNqkwYURgAAQA7DH3d3335LSKyxAYpf9vWCpnYbf01qcOdFVXc14w4BznNTjkQfsscAdU3b4wIh9fDVYc4zV8xZgAAYaCMI6vPgLAAAAAElFTkSuQmCC); }
|
||||
|
||||
h1 { font: inherit; color: white; font-size: 50px; line-height: 121px; margin: 0; padding-left: 4%; background: url(https://files.nette.org/images/logo-nette@2.png) no-repeat 95%; background-size: 130px auto; text-shadow: 1px 1px 0 rgba(0, 0, 0, .9); }
|
||||
@media (max-width: 600px) {
|
||||
h1 { background: none; font-size: 40px; }
|
||||
}
|
||||
|
||||
#content { background: white; border: 1px solid #eff4f7; border-radius: 0 0 12px 12px; padding: 10px 4%; overflow: hidden; }
|
||||
|
||||
h2 { font: inherit; padding: 1.2em 0; margin: 0; }
|
||||
|
||||
img { border: none; float: right; margin: 0 0 1em 3em; }
|
||||
</style>
|
||||
19
app/modules/Pdf/templates/@layout.latte
Executable file
19
app/modules/Pdf/templates/@layout.latte
Executable file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<title>{ifset title}{include title|stripHtml} | {/ifset}Nette Web</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div n:foreach="$flashes as $flash" n:class="flash, $flash->type">{$flash->message}</div>
|
||||
|
||||
{include content}
|
||||
|
||||
{block scripts}
|
||||
<script src="https://nette.github.io/resources/js/3/netteForms.min.js"></script>
|
||||
{/block}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user