mod from tramaulipas

This commit is contained in:
David Itehua Xalamihua 2025-08-28 12:16:41 -06:00
parent 7d96f55670
commit 3b9be320fc
3 changed files with 56 additions and 33 deletions

View File

@ -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'
}

28
main.py
View File

@ -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__':

View File

@ -1,20 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<style>
iframe {
width: 90%;
height: 90vh;
}
</style>
<iframe src="https://1drv.ms/b/c/94fb71847d00f5d9/IQTZ9QB9hHH7IICUNaQJAAAAATl7DPlSGna-Ko1PodcD8Wc" frameborder="0" scrolling="no"></iframe>
{% extends 'template.html' %}
{% block css %}
<!-- <link rel="stylesheet" href="{{ url_for('static', filename='c_more_info/about_me.css') }}"> -->
{% endblock %}
{% block usr_path %}
<li class="breadcrumb-item active" aria-current="page">
<a href="">
<span>Sobre mí</span>
</a>
</li>
{% endblock %}
{% block body %}
<div class="container py-4">
<!-- Encabezado con botón -->
<div class="d-flex justify-content-between align-items-center mb-3">
<a class="btn btn-primary" href="{{ url_for('download_cv') }}">
<i class="bi bi-download"></i> Descargar CV
</a>
</div>
<!-- Contenedor del iframe -->
<div class="ratio ratio-1x1 border rounded shadow-sm">
<iframe
src="{{ url_for('view_cv') }}"
title="cv"
allowfullscreen>
</iframe>
</div>
</body>
</html>
</div>
{% endblock body %}