From a54bad02cf7770bcdd8850180f1976df68a5cdda Mon Sep 17 00:00:00 2001 From: FreakJoe Date: Wed, 15 Mar 2017 21:04:34 +0100 Subject: [PATCH 1/9] Search box and set up for api call --- rein/cli.py | 7 +++++++ rein/html/css/style_v2.css | 6 ++++++ rein/html/js/search.js | 18 ++++++++++++++++++ rein/html/layout.html | 7 +++++++ 4 files changed, 38 insertions(+) create mode 100644 rein/html/js/search.js diff --git a/rein/cli.py b/rein/cli.py index 0411411..70af08d 100644 --- a/rein/cli.py +++ b/rein/cli.py @@ -1624,6 +1624,13 @@ def settings(): return render_template('settings.html', user=user, hidden_jobs=hidden_jobs, hidden_bids=hidden_bids, hidden_mediators=hidden_mediators, fee=fee, trust_score=trust_score) + @app.route('/user_search/', methods=['GET']) + def user_search(search_input): + if not search_input: + return 'false' + + return 'true' + @app.route("/post", methods=['POST', 'GET']) def job_post(): form = JobPostForm(request.form) diff --git a/rein/html/css/style_v2.css b/rein/html/css/style_v2.css index 5e6f42c..cbf21b4 100644 --- a/rein/html/css/style_v2.css +++ b/rein/html/css/style_v2.css @@ -2143,6 +2143,12 @@ border-radius: 50%;} right: 36px; background: url(../img/chevron-right.png) 0 0 no-repeat; } +ul li input { + line-height: normal; +} +ul li button { + line-height: normal; +} #social a { margin:0 15px 0 0; color:#e6e6e9; diff --git a/rein/html/js/search.js b/rein/html/js/search.js new file mode 100644 index 0000000..e59edbe --- /dev/null +++ b/rein/html/js/search.js @@ -0,0 +1,18 @@ +function search(inputId) { + searchInput = $("#" + inputId).val(); + if (searchInput == "") { + alert('Please enter user name, msin or contact information of the person you\'re trying to find.') + } + + $.ajax({ + method: "GET", + url: "/user_search/" + searchInput, + contentType: "application/json" + success: function(data) { + alert(data); + if (data != 'true') { + alert('User could not be found') + } + } + }) +} \ No newline at end of file diff --git a/rein/html/layout.html b/rein/html/layout.html index 0b476d4..0992a2a 100644 --- a/rein/html/layout.html +++ b/rein/html/layout.html @@ -61,6 +61,12 @@
about