Changed the landingpage after a new short-request was successfull

This commit is contained in:
sqozz 2015-01-25 06:11:06 +01:00
parent cafe2539c2
commit f77137eed6
4 changed files with 25 additions and 3 deletions

View file

@ -1,2 +0,0 @@
<!doctype html>
<a href="http://localhost:5000/{{paste_id}}">http://localhost:5000/{{paste_id}}</a>

View file

@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>New paste created!</title>
</head>
<body>
<script type="text/javascript">
function selectAll(id) {
document.getElementById(id).focus();
document.getElementById(id).select();
}
</script>
<form>
<div>
<input type="text" id="paste_url" value="{{server_url}}{{paste_id}}" onClick="selectAll('paste_url');">
</div>
<div>
<a href="{{server_url}}{{paste_id}}">{{server_url}}{{paste_id}}</a>
</div>
</form>
</body>
</html>

Binary file not shown.

View file

@ -50,7 +50,7 @@ def paste(pasteID):
def new_short(): def new_short():
target_url = request.args.get("target", "") target_url = request.args.get("target", "")
paste_id = add_redirect(target_url, 1) paste_id = add_redirect(target_url, 1)
return render_template("new_paste.html", paste_id=paste_id) return render_template("short_completed.html", paste_id=paste_id, server_url=request.host + "/")
def add_redirect(target_url, method_id): def add_redirect(target_url, method_id):
paste_id = gen_new_id(5) paste_id = gen_new_id(5)