aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2014-11-29 00:03:28 +0100
committerVG <vg@devys.org>2014-11-29 00:03:28 +0100
commit8abf1c607aa41886992496adf58dd8debd1d0a2e (patch)
treec3afa797958bfc3a782cbfc11979f0e6d46aca21
parenta40fb5c091f33004a250e1128e56dad2701fc054 (diff)
downloadpasteme-8abf1c607aa41886992496adf58dd8debd1d0a2e.tar.gz
pasteme-8abf1c607aa41886992496adf58dd8debd1d0a2e.tar.bz2
pasteme-8abf1c607aa41886992496adf58dd8debd1d0a2e.zip
Factorize templates base and add background color
-rw-r--r--static/base.css3
-rw-r--r--views/bad_format.tpl8
-rw-r--r--views/bad_request.tpl8
-rw-r--r--views/base.tpl10
-rw-r--r--views/not_found.tpl8
-rw-r--r--views/paste.tpl9
-rw-r--r--views/root.tpl10
7 files changed, 18 insertions, 38 deletions
diff --git a/static/base.css b/static/base.css
new file mode 100644
index 0000000..5dc464e
--- /dev/null
+++ b/static/base.css
@@ -0,0 +1,3 @@
+html {
+ background-color: #002b36;
+}
diff --git a/views/bad_format.tpl b/views/bad_format.tpl
index 6efdab8..dbf1376 100644
--- a/views/bad_format.tpl
+++ b/views/bad_format.tpl
@@ -1,10 +1,4 @@
-<html>
-<head>
-<title>Bad paste format requested</title>
-</head>
-<body>
+% rebase('base.tpl', title='Bad paste format requested')
<h2>Hello</h2>
<p>I do not understand the format you are trying to get for the past
requested. Please try again with either <i>colored</i> or <i>raw</i></p>
-</body>
-</html>
diff --git a/views/bad_request.tpl b/views/bad_request.tpl
index e21eddc..813e433 100644
--- a/views/bad_request.tpl
+++ b/views/bad_request.tpl
@@ -1,13 +1,7 @@
-<html>
-<head>
-<title>Bad request (400)</title>
-</head>
-<body>
+% rebase('base.tpl', title='Bad request (400)')
<h2>Hello</h2>
<p>I don't know how to manage your request.</p>
<p>If you think that your request was valid, please report this issue</p>
<p>I'm sorry for you, but <i>nonetheless</i> I whish you a very good day.</p>
-</body>
-</html>
diff --git a/views/base.tpl b/views/base.tpl
new file mode 100644
index 0000000..f3c3744
--- /dev/null
+++ b/views/base.tpl
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>{{title or 'No title'}}</title>
+ <link rel="stylesheet" href="/static/pygments.css" />
+ <link rel="stylesheet" href="/static/base.css" />
+</head>
+<body>
+{{!base}}
+</body>
+</html>
diff --git a/views/not_found.tpl b/views/not_found.tpl
index 50a41db..93d4ad5 100644
--- a/views/not_found.tpl
+++ b/views/not_found.tpl
@@ -1,8 +1,4 @@
-<html>
-<head>
-<title>Paste not available</title>
-</head>
-<body>
+% rebase('base.tpl', title='Paste not available')
<h2>Hello</h2>
<p>I wanted to display you a paste, but I did not find it. There can be two
reason for this:</p>
@@ -12,5 +8,3 @@ reason for this:</p>
</ul>
<p>I'm sorry for you, but <i>nonetheless</i> I whish you a very good day.</p>
-</body>
-</html>
diff --git a/views/paste.tpl b/views/paste.tpl
index 814cccf..6867e11 100644
--- a/views/paste.tpl
+++ b/views/paste.tpl
@@ -1,9 +1,2 @@
-<html>
-<head>
-<title>Paste snippets</title>
-<link rel="stylesheet" href="/static/pygments.css" />
-</head>
-<body>
+% rebase('base.tpl', title='Paste snippets')
{{!content}}
-</body>
-</html>
diff --git a/views/root.tpl b/views/root.tpl
index 53c6393..b9acec8 100644
--- a/views/root.tpl
+++ b/views/root.tpl
@@ -1,9 +1,4 @@
-<html>
-<head>
-<title>Paste snippets</title>
-</head>
-<body>
-
+% rebase('base.tpl', title='Paste snippets')
You are on a simple paste deposit service.
Please copy your text on the box below:
@@ -14,6 +9,3 @@ Please copy your text on the box below:
<button for="content">Paste</button>
</form>
-
-</body>
-</html>