Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

quick template + redirect fix

  • Loading branch information...
commit 445389d48d4ce24dd171795ed94b76ba79a7ecf9 1 parent cbf664f
Gleicon Moraes authored
Showing with 8 additions and 2 deletions.
  1. +7 −1 uurl.py
  2. +1 −1  views/stats.tpl
8 uurl.py
View
@@ -93,7 +93,13 @@ def quick_link():
if not uurl:
abort(500, "empty or invalid url")
else:
- return template('stats', uurl = uurl, base_url = BASE_URL, url = url)
+ # two options here: render the status page or redirect to it. You might
+ # want to redirect to somewhere else passing the new uurl as parameter,
+ # etc. Dont forget that the full url == BASE_URL + uurl (+ '!' if you
+ # want the status page
+
+ #return template('stats', uurl = uurl, base_url = BASE_URL, url = url)
+ redirect(BASE_URL + uurl+"!")
@route('/url', method='POST')
def post_url():
2  views/stats.tpl
View
@@ -42,7 +42,7 @@
$('#content').prepend('<p>Original URL: <a href="'+data.url+'">'+data.url+'</a></p>'
+ '<p>Shortened URL: <a href="{{base_url}}{{uurl}}">{{base_url}}{{uurl}}</a></p>'
- + '<p>Stats URL (with ! in the end): <a href="{{base_url}}{{uurl}}">{{base_url}}{{uurl}}!</a></p>'
+ + '<p>Stats URL (with ! in the end): <a href="{{base_url}}{{uurl}}!">{{base_url}}{{uurl}}!</a></p>'
+ '<p>Clicks since '+date_creation+': '+data.clicks + '</p>'
+ '<p>Visitors: '+data.visitors+'</p>'
+ '<p>Referers: '+data.referers+'</p>');
Please sign in to comment.
Something went wrong with that request. Please try again.