Skip to content

Commit

Permalink
new look and feel working!
Browse files Browse the repository at this point in the history
  • Loading branch information
howardvickers committed Jul 25, 2018
1 parent d8979d0 commit 0948001
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 184 deletions.
36 changes: 24 additions & 12 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ def index():
# Load page
return flask.render_template('index.html')



@app.route('/newlook')
def newlook():
# Load page
return flask.render_template('newlook.html')


@app.route('/upload_resume', methods=["POST"])
def upload_resume():
# Accept uploaded resume and return raw text
Expand All @@ -99,25 +107,29 @@ def upload_resume():
@app.route('/demo_resumes', methods=["POST"])
def demo_resumes():
# Accept selected demo resume and return raw text
resumes_dict = {'mkt': 'marketing', 'dta': 'data', 'web': 'webdev', 'hcv': 'howardvickers'}
resumes_dict = {'mkt': 'marketing', 'dta': 'data', 'web': 'webdev', 'sls': 'sales', 'act': 'accountant'}
print('request.form: ', request.form)
for k, v in request.form.items():
selected_resume = request.form[k]
print('selected_resume: ', selected_resume)
resume_pdf = "../data/resumes/{}_resume.pdf".format(resumes_dict[selected_resume])

resume_text = ocr_on_pdf(resume_pdf)
global_resume.text = resume_text

return flask.jsonify(resume_text = build_resume_html(resume_text))

@app.route('/predict', methods=["GET"])
def predict():
# Run predict function and return prediction
resume_text = global_resume.text
resume_prediction = predict_resume(resume_text)

return flask.jsonify(resume_prediction = '<h3>'+resume_prediction+'</h3>')
# global_resume.text = resume_text
prediction_dict = {'JavaScript': 'Web Developer', 'Python': 'Data Scientist', 'Marketing': 'Marketing Manager', 'Sales': 'Sales Manager', 'Accounting': 'Accountant', 'Operations': 'Operations Manager'}
resume_prediction = prediction_dict[predict_resume(resume_text)]
return flask.jsonify(
resume_text = build_resume_html(resume_text),
resume_prediction = '<h3>'+resume_prediction+'</h3>'
)

# @app.route('/predict', methods=["GET"])
# def predict():
# # Run predict function and return prediction
# resume_text = global_resume.text
# resume_prediction = predict_resume(resume_text)
#
# return flask.jsonify(resume_prediction = '<h3>'+resume_prediction+'</h3>')


if __name__ == "__main__":
Expand Down
22 changes: 22 additions & 0 deletions src/static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
.card-img-top {
-moz-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}

.card-img-top:hover {
-webkit-transform: scale(.8);
-moz-transform: scale(.8);
-o-transform: scale(.8);
-ms-transform: scale(.8);
transform: scale(.8);
}

.backgroundIm {
background-image: url("../img/background4.png");
background-size: cover;
left: 0px;
right: 0px;
width: 100%;
height: 400px;
}
.i
{
margin: 150px 300px
Expand Down
Loading

0 comments on commit 0948001

Please sign in to comment.