From 4fec192939635ad5fc14d80e73ec0f999681c623 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Tue, 5 Feb 2013 10:59:49 +0100 Subject: [PATCH] First working version of hashtag adding in html. To be merged --- twiderboard/flask_app.py | 8 +-- twiderboard/templates/add_hash.html | 31 +++++++++++ twiderboard/templates/statistics.html | 30 ----------- twiderboard/templates/statistics_sav.html | 64 +++++++++++++++++++++++ 4 files changed, 99 insertions(+), 34 deletions(-) create mode 100644 twiderboard/templates/add_hash.html create mode 100644 twiderboard/templates/statistics_sav.html diff --git a/twiderboard/flask_app.py b/twiderboard/flask_app.py index 3e8ca9c..08cbd33 100644 --- a/twiderboard/flask_app.py +++ b/twiderboard/flask_app.py @@ -50,15 +50,15 @@ def nb_trendy(): @app.route('/_add_hashtag') def add_hashtag(): - new_hash = request.args.get('new_hash', 0) - print "Request to add %s !" % (new_hash) - return jsonify(result="Added %s" % (new_hash)) + new_hash = request.args.get('new_hash') + return jsonify(hash="Adding %s !" % (new_hash)) @app.route('/') def index(): #return render_template('index_dyn.html') - return render_template('statistics.html') + #return render_template('statistics.html') + return render_template('add_hash.html') if __name__ == '__main__': app.run() diff --git a/twiderboard/templates/add_hash.html b/twiderboard/templates/add_hash.html new file mode 100644 index 0000000..bb35a80 --- /dev/null +++ b/twiderboard/templates/add_hash.html @@ -0,0 +1,31 @@ +{% extends "layout.html" %} +{% block body %} + +

Hashtags

+

+ + +

calculate server side +{% endblock %} \ No newline at end of file diff --git a/twiderboard/templates/statistics.html b/twiderboard/templates/statistics.html index 1a89219..82b9826 100644 --- a/twiderboard/templates/statistics.html +++ b/twiderboard/templates/statistics.html @@ -15,29 +15,6 @@ }); })(); -

Database information

Current number of active hastags in database : @@ -51,11 +28,4 @@ Current number of members in database : ?

- -

Hashtags

-

- Add new hashtag! -
- ? -

{% endblock %} \ No newline at end of file diff --git a/twiderboard/templates/statistics_sav.html b/twiderboard/templates/statistics_sav.html new file mode 100644 index 0000000..ffc26aa --- /dev/null +++ b/twiderboard/templates/statistics_sav.html @@ -0,0 +1,64 @@ +{% extends "layout.html" %} +{% block body %} + + +

Database information

+

+ Current number of active hastags in database : + ? +

+

+ Current number of tweets in database : + ? +

+

+ Current number of members in database : + ? +

+ +

Hashtags

+

+

+
+
+ + + +
+
+
+ +

+{% endblock %} \ No newline at end of file