diff options
-rwxr-xr-x | pasteme.py | 2 | ||||
-rwxr-xr-x | scripts/pastit.py | 2 | ||||
-rw-r--r-- | static/base.css | 15 | ||||
-rw-r--r-- | views/bad_format.tpl | 8 | ||||
-rw-r--r-- | views/bad_request.tpl | 8 | ||||
-rw-r--r-- | views/base.tpl | 10 | ||||
-rw-r--r-- | views/not_found.tpl | 8 | ||||
-rw-r--r-- | views/paste.tpl | 13 | ||||
-rw-r--r-- | views/root.tpl | 10 |
9 files changed, 36 insertions, 40 deletions
@@ -54,7 +54,7 @@ def route_paste_get(pid, pformat='colored'): content = pygments.highlight(content, lexer, pygment_formater) except pygments.util.ClassNotFound: pass - return bottle.template('paste', content=content) + return bottle.template('paste', content=content, pid=pid) bottle.response.content_type = 'text/plain; charset=UTF8' # HTTP header return content diff --git a/scripts/pastit.py b/scripts/pastit.py index 3527b4f..63e5ab3 100755 --- a/scripts/pastit.py +++ b/scripts/pastit.py @@ -42,7 +42,7 @@ def get(url): if req.status_code == 404: return "Paste not found" elif not req.ok: - return "An error occured" + return "An error occured (%s)" % req.status_code return req.text diff --git a/static/base.css b/static/base.css new file mode 100644 index 0000000..9569be1 --- /dev/null +++ b/static/base.css @@ -0,0 +1,15 @@ +html { + background-color: #002b36; +} + +#floatingmenu { + border: 1px solid #000; + width: 200px; + height: 50px; + background-color: #002D38; + display: block; + position: absolute; + right: 0px; + top: 0px; + position: absolute; +} 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..56902a4 100644 --- a/views/paste.tpl +++ b/views/paste.tpl @@ -1,9 +1,6 @@ -<html> -<head> -<title>Paste snippets</title> -<link rel="stylesheet" href="/static/pygments.css" /> -</head> -<body> +% rebase('base.tpl', title='Paste snippets') {{!content}} -</body> -</html> +<div id="floatingmenu"> +<a href="/">Paste something again</a><br /> +<a href="/{{pid}}/raw">Raw format</a><br /> +</div> 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> |