aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpasteme.py9
-rw-r--r--static/base.css21
-rw-r--r--views/base.tpl2
-rw-r--r--views/paste.tpl4
-rw-r--r--views/root.tpl6
5 files changed, 27 insertions, 15 deletions
diff --git a/pasteme.py b/pasteme.py
index 09b3351..fae3922 100755
--- a/pasteme.py
+++ b/pasteme.py
@@ -21,13 +21,8 @@ def route_root():
@bottle.route('/', method='POST')
def route_paste_post():
- content = bottle.request.forms.getunicode('content', '')
-
- try:
- pid = identigen.generate(content)
- except AttributeError as e:
- print(e)
- bottle.abort(400)
+ content = bottle.request.forms.getunicode('content', '') or ''
+ pid = identigen.generate(content)
path = pathbase / pid
with path.open(mode='wb') as fd:
fd.write(content.encode('utf8'))
diff --git a/static/base.css b/static/base.css
index ca6f9be..84c8598 100644
--- a/static/base.css
+++ b/static/base.css
@@ -4,6 +4,10 @@ html {
body {
color: #aaaaaa;
+ position: relative;
+ max-width: 750px;
+ margin-right: auto;
+ margin-left: auto;
}
#content {
@@ -20,7 +24,20 @@ body {
#floatingmenu {
display: block;
position: absolute;
- right: 0px;
- top: 0px;
+ right: 0;
+ top: 0;
position: absolute;
}
+
+#floatingmenu a img {
+ margin: 0;
+}
+
+#floatingmenu button {
+ border: 0;
+ padding: 0;
+ background: transparent;
+ display: inline;
+ width: 96px;
+ height: 96px;
+}
diff --git a/views/base.tpl b/views/base.tpl
index 9f3046b..0fe2ad0 100644
--- a/views/base.tpl
+++ b/views/base.tpl
@@ -5,7 +5,7 @@
<link rel="stylesheet" href="/static/base.css" />
</head>
<body>
-<img id="banner" alt="Pasteme" src="/static/banner.png"><br/>
+<img id="banner" alt="Pasteme" src="/static/banner.png"><br />
{{!base}}
</body>
</html>
diff --git a/views/paste.tpl b/views/paste.tpl
index 574717a..dc60a24 100644
--- a/views/paste.tpl
+++ b/views/paste.tpl
@@ -1,6 +1,6 @@
% rebase('base.tpl', title='Paste snippets')
{{!content}}
<div id="floatingmenu">
- <a href="/"><img alt="return" src="static/esc-icon.png"/></a><br/>
- <a href="/{{pid}}/raw"><img alt="raw" src="static/download-icon.png"/></a>
+ <a href="/"><img alt="return" src="static/esc-icon.png" /></a><br />
+ <a href="/{{pid}}/raw"><img alt="raw" src="static/download-icon.png" /></a>
</div>
diff --git a/views/root.tpl b/views/root.tpl
index 44a6028..179dde8 100644
--- a/views/root.tpl
+++ b/views/root.tpl
@@ -6,9 +6,9 @@ Please copy your text on the box below:
<form action="/" method="POST">
<textarea id="content" name="content"></textarea>
-<div id=floatingmenu>
- <button for="content" style="border:0;background:transparent">
- <img alt="paste" src="/static/enter-icon.png"/>
+<div id="floatingmenu">
+ <button for="content">
+ <img alt="Paste" src="/static/enter-icon.png" />
</button>
</div>