diff --git a/db_xala_dev/views.py b/db_xala_dev/views.py index 3c91f20..fc29110 100644 --- a/db_xala_dev/views.py +++ b/db_xala_dev/views.py @@ -7,8 +7,8 @@ v = { 'me': 'more_info/about_me.html', 'np': 'new_posts.html', 'pjs': 'more_info/personal_projects.html', - 'cv': 'more_info/cv.html' + 'cv': 'more_info/cv.html', + 'cv-file': 'static/source_imgs/cv/CV_David_Itehua_Xalamihua.pdf' } -} - # 'cv': 'static/source_imgs/cv/CV_David_Itehua_Xalamihua.pdf' \ No newline at end of file +} \ No newline at end of file diff --git a/main.py b/main.py index 98f68ed..4f84a6e 100644 --- a/main.py +++ b/main.py @@ -31,9 +31,9 @@ DB = DBSQLite(db_path) @app.route('/') def home(): - q_dataHome = "SELECT pk, label, svg_data FROM home;" + q_dataHome = 'SELECT pk, label, svg_data FROM home where pk <> "data analytics";' + # q_dataHome = "SELECT pk, label, svg_data FROM home;" dataHome = DB.get_data(q_dataHome) - return render_template(v['home'], dataHome=dataHome, n_server=n_server) @app.route('/latest-posts') @@ -118,8 +118,6 @@ def all_posts(): ''' db_newPosts = DB.get_data(q) return render_template(v['m.i.']['np'], db_newPosts=db_newPosts, db_mainSections=final) - - @app.route('/more-info/projects') def projects(): @@ -129,10 +127,16 @@ def projects(): def cv(): return render_template(v['m.i.']['cv']) -# @app.route('/more-info/cv') -# def cv(): -# filePath=v['m.i.']['cv'] -# return send_file(filePath, as_attachment=True) +@app.route('/more-info/cv/download') +def download_cv(): + filePath = v['m.i.']['cv-file'] + return send_file(filePath, as_attachment=True) + +@app.route('/more-info/cv/view') +def view_cv(): + filePath = v['m.i.']['cv-file'] + return send_file(filePath) + # solo ayuda dix template @app.route('/ayuda-template') @@ -141,10 +145,10 @@ def ayuda_template(): return render_template(v['test'], data_links=data_links) -# # Manejo del error 404 -# @app.errorhandler(404) -# def page_not_found(error): -# return render_template('404.html'), 404 +# Manejo del error 404 +@app.errorhandler(404) +def page_not_found(error): + return render_template('404.html'), 404 if __name__ == '__main__': diff --git a/templates/more_info/cv.html b/templates/more_info/cv.html index cd0e879..5587d21 100644 --- a/templates/more_info/cv.html +++ b/templates/more_info/cv.html @@ -1,20 +1,39 @@ - - -
- - -