Docker and more calendar work
This commit is contained in:
parent
4527504c80
commit
f7a919ebf2
22 changed files with 2036 additions and 79 deletions
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
Main routes for the Podcastrr application.
|
||||
"""
|
||||
from flask import Blueprint, render_template, current_app
|
||||
from flask import Blueprint, render_template, current_app, redirect, url_for, request
|
||||
from app.models.podcast import Podcast
|
||||
|
||||
main_bp = Blueprint('main', __name__)
|
||||
|
@ -9,14 +9,23 @@ main_bp = Blueprint('main', __name__)
|
|||
@main_bp.route('/')
|
||||
def index():
|
||||
"""
|
||||
Render the home page.
|
||||
Redirect to the podcasts page or handle specific views.
|
||||
"""
|
||||
# Get recent podcasts
|
||||
recent_podcasts = Podcast.query.order_by(Podcast.last_updated.desc()).limit(5).all()
|
||||
view = request.args.get('view')
|
||||
|
||||
return render_template('index.html',
|
||||
title='Home',
|
||||
recent_podcasts=recent_podcasts)
|
||||
if view in ['history', 'wanted', 'status']:
|
||||
# Get recent podcasts for the template
|
||||
recent_podcasts = Podcast.query.order_by(Podcast.last_updated.desc()).limit(5).all()
|
||||
|
||||
# For now, just render the index template with the view parameter
|
||||
# In the future, these could be implemented as separate views
|
||||
return render_template('index.html',
|
||||
title=view.capitalize(),
|
||||
view=view,
|
||||
recent_podcasts=recent_podcasts)
|
||||
|
||||
# Default: redirect to podcasts page
|
||||
return redirect(url_for('podcasts.index'))
|
||||
|
||||
@main_bp.route('/about')
|
||||
def about():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue