Moved templates and templates config to Core module

This commit is contained in:
Alejandro Celaya
2016-07-19 18:32:59 +02:00
parent 923abdf4d2
commit 39598d8608
7 changed files with 26 additions and 15 deletions

View File

@@ -0,0 +1,11 @@
<?php
return [
'templates' => [
'paths' => [
'module/Core/templates',
],
],
];

View 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',
],
],
];

View 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 %}

View 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 %}

View 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>
&copy; {{ "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>