mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Moved templates and templates config to Core module
This commit is contained in:
11
module/Core/config/templates.config.php
Normal file
11
module/Core/config/templates.config.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'templates' => [
|
||||
'paths' => [
|
||||
'module/Core/templates',
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
12
module/Core/config/zend-expressive.config.php
Normal file
12
module/Core/config/zend-expressive.config.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'zend-expressive' => [
|
||||
'error_handler' => [
|
||||
'template_404' => 'core/error/404.html.twig',
|
||||
'template_error' => 'core/error/error.html.twig',
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
17
module/Core/templates/core/error/404.html.twig
Normal file
17
module/Core/templates/core/error/404.html.twig
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends 'core/layout/default.html.twig' %}
|
||||
|
||||
{% block title %}URL Not Found{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<style>
|
||||
p {margin-bottom: 20px;}
|
||||
body {text-align: center;}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Oops!</h1>
|
||||
<hr>
|
||||
<p>This short URL doesn't seem to be valid.</p>
|
||||
<p>Make sure you included all the characters, with no extra punctuation.</p>
|
||||
{% endblock %}
|
||||
20
module/Core/templates/core/error/error.html.twig
Normal file
20
module/Core/templates/core/error/error.html.twig
Normal file
@@ -0,0 +1,20 @@
|
||||
{% extends 'core/layout/default.html.twig' %}
|
||||
|
||||
{% block title %}{{ status }} {{ reason }}{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<style>
|
||||
p {margin-bottom: 20px;}
|
||||
body {text-align: center;}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Oops!</h1>
|
||||
<hr>
|
||||
<p>We encountered a {{ status }} {{ reason }} error.</p>
|
||||
{% if status == 404 %}
|
||||
<p>This short URL doesn't seem to be valid.</p>
|
||||
<p>Make sure you included all the characters, with no extra punctuation.</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
40
module/Core/templates/core/layout/default.html.twig
Normal file
40
module/Core/templates/core/layout/default.html.twig
Normal file
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>{% block title %}{% endblock %} | URL shortener</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" />
|
||||
<style>
|
||||
body {padding-top: 60px;}
|
||||
.app {display: flex; min-height: 100vh; flex-direction: column;}
|
||||
.app-content {flex: 1;}
|
||||
.app-footer p {margin-bottom: 20px;}
|
||||
</style>
|
||||
{% block stylesheets %}{% endblock %}
|
||||
</head>
|
||||
<body class="app">
|
||||
<div class="app-content">
|
||||
<main class="container">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="app-footer">
|
||||
<div class="container">
|
||||
<hr />
|
||||
{% block footer %}
|
||||
<p>
|
||||
© {{ "now" | date("Y") }} by <a href="http://www.alejandrocelaya.com">Alejandro Celaya</a>.
|
||||
</p>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||
{% block javascript %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user