aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Micieli <micieli@laposte.net>2019-10-26 14:54:16 +0200
committerWilly Micieli <micieli@laposte.net>2019-10-26 14:54:16 +0200
commitd4ec1b59896109b464a03d5026f747137666dc26 (patch)
tree2e53c45d5f043803c8bdb1301cb50f87b8bc7aa6
parent49cf5e39815bf772673ec8c2dc1980d6f8c381f8 (diff)
downloadshaolin-d4ec1b59896109b464a03d5026f747137666dc26.zip
shaolin-d4ec1b59896109b464a03d5026f747137666dc26.tar.gz
add comments clean views
-rw-r--r--app/Container/admin.php4
-rw-r--r--app/Container/web.php4
-rw-r--r--app/Controllers/HomeController.php32
-rw-r--r--app/Views/admin.twig22
-rw-r--r--app/Views/crud/create.twig2
-rw-r--r--app/Views/crud/edit.twig2
-rw-r--r--app/Views/crud/home.twig2
-rw-r--r--app/Views/crud/show.twig2
-rw-r--r--app/Views/home.twig4
-rw-r--r--app/Views/layout.twig16
-rw-r--r--app/Views/todo.twig41
-rw-r--r--app/Views/todo/home.twig2
-rw-r--r--web/js/admin.js3
-rw-r--r--web/js/app.js3
14 files changed, 105 insertions, 34 deletions
diff --git a/app/Container/admin.php b/app/Container/admin.php
index ae48a80..e19ebab 100644
--- a/app/Container/admin.php
+++ b/app/Container/admin.php
@@ -1,3 +1,5 @@
<?php
-return [];
+return [
+
+];
diff --git a/app/Container/web.php b/app/Container/web.php
index 0b67a5f..ca5d8ed 100644
--- a/app/Container/web.php
+++ b/app/Container/web.php
@@ -1,3 +1,5 @@
<?php
-return [];
+return [
+
+];
diff --git a/app/Controllers/HomeController.php b/app/Controllers/HomeController.php
index bd96dfc..ffd9be1 100644
--- a/app/Controllers/HomeController.php
+++ b/app/Controllers/HomeController.php
@@ -3,8 +3,12 @@
namespace App\Controllers {
use Imperium\Controller\Controller;
+ use Symfony\Component\HttpFoundation\Response;
+ use Twig\Error\LoaderError;
+ use Twig\Error\RuntimeError;
+ use Twig\Error\SyntaxError;
- Class HomeController extends Controller
+ Class HomeController extends Controller
{
public function before_action()
@@ -17,11 +21,33 @@ namespace App\Controllers {
}
- public function not_found()
+ /**
+ *
+ * Page 404
+ *
+ * @return Response
+ *
+ * @throws LoaderError
+ * @throws RuntimeError
+ * @throws SyntaxError
+ *
+ */
+ public function not_found(): Response
{
return $this->view('404',[],404);
}
- public function home()
+
+ /**
+ * The homepage
+ *
+ * @return Response
+ *
+ * @throws LoaderError
+ * @throws RuntimeError
+ * @throws SyntaxError
+ *
+ */
+ public function home(): Response
{
return $this->view('home');
}
diff --git a/app/Views/admin.twig b/app/Views/admin.twig
index 6505a3f..e39f81c 100644
--- a/app/Views/admin.twig
+++ b/app/Views/admin.twig
@@ -10,25 +10,31 @@
{% endif %}
- {{ css('app') }}
-
{% block css %} {% endblock %}
- <title>{% block title %}{% endblock %}</title>
+ <title>{% block title 'admin'%}</title>
+
+ <link rel='shortcut icon' type='image/x-icon' href="https://git-scm.com/favicon.ico">
+
+ <meta name="description" content="{% block description 'todo list'%}">
+
+ <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
+
+ <link rel="stylesheet" href="https://bootswatch.com/4/lumen/bootstrap.min.css">
- <meta name="description" content="{% block description %} {% endblock %}">
</head>
<body>
- <main class="container">
+ <main class="container mt-5">
{{ display('success') }}
{{ display('failure') }}
{% block content %} {% endblock %}
</main>
- <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
-
- <script src="{{ js('admin.js') }}"></script>
+ <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+ {{ js('admin.js') }}
{% block js %}
{% endblock %}
diff --git a/app/Views/crud/create.twig b/app/Views/crud/create.twig
index ec32ea1..1bb9e07 100644
--- a/app/Views/crud/create.twig
+++ b/app/Views/crud/create.twig
@@ -1,4 +1,4 @@
-{% extends 'layout.twig' %}
+{% extends 'admin.twig' %}
{% block title '' %}
diff --git a/app/Views/crud/edit.twig b/app/Views/crud/edit.twig
index 72be48d..5c89321 100644
--- a/app/Views/crud/edit.twig
+++ b/app/Views/crud/edit.twig
@@ -1,4 +1,4 @@
-{% extends 'layout.twig' %}
+{% extends 'admin.twig' %}
{% block title '' %}
diff --git a/app/Views/crud/home.twig b/app/Views/crud/home.twig
index 6d98e32..4a79839 100644
--- a/app/Views/crud/home.twig
+++ b/app/Views/crud/home.twig
@@ -1,4 +1,4 @@
-{% extends 'layout.twig' %}
+{% extends 'admin.twig' %}
{% block title '' %}
diff --git a/app/Views/crud/show.twig b/app/Views/crud/show.twig
index 7e99db8..674237c 100644
--- a/app/Views/crud/show.twig
+++ b/app/Views/crud/show.twig
@@ -1,4 +1,4 @@
-{% extends 'layout.twig' %}
+{% extends 'admin.twig' %}
{% block title '' %}
diff --git a/app/Views/home.twig b/app/Views/home.twig
index 0ee627e..d2cad65 100644
--- a/app/Views/home.twig
+++ b/app/Views/home.twig
@@ -1,8 +1,8 @@
{% extends 'layout.twig' %}
-{% block title '' %}
+{% block title 'Shaolin' %}
-{% block description '' %}
+{% block description 'Welcome at shaolin' %}
{% block css %}
diff --git a/app/Views/layout.twig b/app/Views/layout.twig
index ddbf40b..17ccaa6 100644
--- a/app/Views/layout.twig
+++ b/app/Views/layout.twig
@@ -6,17 +6,18 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <title>{% block title %}{% endblock %}</title>
+
+ <meta name="description" content="{% block description %} {% endblock %}">
+
{% if development() %}
{% endif %}
-
+ {{ css('app') }}
{% block css %} {% endblock %}
- <title>{% block title %}{% endblock %}</title>
<link rel='shortcut icon' type='image/x-icon' href="https://git-scm.com/favicon.ico">
- <meta name="description" content="{% block description %} {% endblock %}">
- <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
- <link rel="stylesheet" href="https://bootswatch.com/4/lumen/bootstrap.min.css">
+
</head>
<body>
<main class="container mt-5">
@@ -26,9 +27,8 @@
</main>
- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+ {{ js('app.js') }}
+
{% block js %}
{% endblock %}
diff --git a/app/Views/todo.twig b/app/Views/todo.twig
new file mode 100644
index 0000000..3fd00fc
--- /dev/null
+++ b/app/Views/todo.twig
@@ -0,0 +1,41 @@
+<!doctype html>
+<html lang="{{ lang() }}">
+ <head>
+ <!-- Required meta tags -->
+ <meta charset="utf-8">
+
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+
+ {% if development() %}
+
+ {% endif %}
+
+ {% block css %} {% endblock %}
+
+ <title>{% block title 'todo'%}</title>
+
+ <link rel='shortcut icon' type='image/x-icon' href="https://git-scm.com/favicon.ico">
+
+ <meta name="description" content="{% block description 'todo list'%}">
+
+ <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
+
+ <link rel="stylesheet" href="https://bootswatch.com/4/lumen/bootstrap.min.css">
+
+ </head>
+ <body>
+ <main class="container mt-5">
+ {{ display('success') }}
+ {{ display('failure') }}
+ {% block content %} {% endblock %}
+ </main>
+
+
+ <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+ {% block js %}
+
+ {% endblock %}
+ </body>
+</html> \ No newline at end of file
diff --git a/app/Views/todo/home.twig b/app/Views/todo/home.twig
index 46d48e1..f8eff3c 100644
--- a/app/Views/todo/home.twig
+++ b/app/Views/todo/home.twig
@@ -1,4 +1,4 @@
-{% extends 'layout.twig' %}
+{% extends 'todo.twig' %}
{% block title '' %}
diff --git a/web/js/admin.js b/web/js/admin.js
index 8e224cc..e69de29 100644
--- a/web/js/admin.js
+++ b/web/js/admin.js
@@ -1,3 +0,0 @@
-$(function () {
-
-}); \ No newline at end of file
diff --git a/web/js/app.js b/web/js/app.js
index 8e224cc..e69de29 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -1,3 +0,0 @@
-$(function () {
-
-}); \ No newline at end of file