portfolio / portfolio-webapp / webapp / views / public.py
public.py
Raw
"""
Public views for the webapp, including the landing page, resume, and portfolio demos.
"""
import datetime
from flask import (
    abort,
    Blueprint, 
    current_app,
    flash,
    g,
    jsonify,
    redirect,
    render_template,
    request,
    session,
    url_for,
)
from .. import models


bp = Blueprint('public', __name__)

    
@bp.route('/', strict_slashes=False)
def landing():
    return render_template('public/landing.html')


@bp.route('/health-check')
def health_check():
    return jsonify(success=True, http_status_code=200)


@bp.route('/resume')
def resume():
    latest_resume = models.Resume.query\
        .filter_by(deleted=None)\
        .order_by(models.Resume.created.desc())\
        .first()
    return render_template('public/resume.html', resume=latest_resume)


@bp.route('/portfolio')
def portfolio():
    return render_template('public/portfolio.html')


#TODO: Implement user login for future features (such as admin views)
# @bp.route('/login')
# def login():
    # return render_template('public/login.html')