mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 11:36:16 +00:00
Move contrast checking into Python
Change banner size dependent on group content Tidy up inline JS for some files Correct spelling
This commit is contained in:
parent
cdb3836dab
commit
2b795e520f
21 changed files with 194 additions and 164 deletions
|
@ -29,7 +29,7 @@ db_session = db_session()
|
|||
|
||||
|
||||
@blueprint.route('/file/<file_name>', methods=['GET'])
|
||||
def get_file(file_name):
|
||||
def file(file_name):
|
||||
"""
|
||||
Returns a file from the uploads folder
|
||||
r for resolution, 400x400 or thumb for thumbnail
|
||||
|
|
|
@ -7,6 +7,7 @@ from flask import Blueprint, abort, render_template, url_for
|
|||
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from gallery import db
|
||||
from gallery.utils import contrast
|
||||
|
||||
|
||||
blueprint = Blueprint('group', __name__, url_prefix='/group')
|
||||
|
@ -59,8 +60,13 @@ def group(group_id):
|
|||
for image in group_images:
|
||||
image = db_session.query(db.Posts).filter(db.Posts.id == image[0]).first()
|
||||
images.append(image)
|
||||
|
||||
if images:
|
||||
text_colour = contrast.contrast(images[0].image_colours[0], 'rgb(var(--fg-black))', 'rgb(var(--fg-white))')
|
||||
else:
|
||||
text_colour = 'rgb(var(--fg-black))'
|
||||
|
||||
return render_template('groups/group.html', group=group_item, images=images)
|
||||
return render_template('groups/group.html', group=group_item, images=images, text_colour=text_colour)
|
||||
|
||||
|
||||
@blueprint.route('/<int:group_id>/<int:image_id>')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue