Added settings page

Added logging to a .log file
Fixed Images loosing colour and rotation on thumbnail generation
Added more info to README
This commit is contained in:
Michał Gdula 2023-03-01 23:29:34 +00:00
parent a9b13f1e39
commit 828167f762
36 changed files with 819 additions and 131 deletions

View file

@ -1,4 +1,4 @@
from flask import Blueprint, flash, g, redirect, render_template, request, url_for, jsonify, current_app
from flask import Blueprint, render_template, current_app
from werkzeug.exceptions import abort
from werkzeug.utils import secure_filename
@ -12,7 +12,6 @@ import os
from datetime import datetime
dt = datetime.now()
blueprint = Blueprint('gallery', __name__)
@ -22,7 +21,11 @@ def index():
images = db.execute('SELECT * FROM posts'
' ORDER BY created_at DESC').fetchall()
return render_template('index.html', images=images)
return render_template('index.html',
images=images,
image_count=len(images),
name=current_app.config['WEBSITE']['name'],
motto=current_app.config['WEBSITE']['motto'])
@blueprint.route('/image/<int:id>')
@ -63,10 +66,4 @@ def profile():
@blueprint.route('/profile/<int:id>')
def profile_id(id):
return render_template('profile.html', user_id=id)
@blueprint.route('/settings')
@login_required
def settings():
return render_template('settings.html')
return render_template('profile.html', user_id=id)