Enhance settings page; integrate combo box widgets for brands, types, sections, and functions, and add pencil icon for editing functionality

This commit is contained in:
Yaro Kasear 2025-06-18 14:13:16 -05:00
parent dba2438937
commit ad413c3f1b
6 changed files with 177 additions and 67 deletions

View file

@ -1,5 +1,5 @@
from flask import Blueprint, render_template, url_for, request, redirect
from .models import Brand, Item, Inventory, RoomFunction, User, WorkLog, Room
from .models import Brand, Item, Inventory, RoomFunction, User, WorkLog, Room, Area
from sqlalchemy import or_
from sqlalchemy.orm import aliased
from typing import Callable, Any, List
@ -433,4 +433,7 @@ def search():
@main.route('/settings')
def settings():
brands = db.session.query(Brand).order_by(Brand.name).all()
return render_template('settings.html', title="Settings", brands=brands)
types = db.session.query(Item.id, Item.description.label("name")).order_by(Item.description).all()
sections = db.session.query(Area).order_by(Area.name).all()
functions = db.session.query(RoomFunction.id, RoomFunction.description.label("name")).order_by(RoomFunction.description).all()
return render_template('settings.html', title="Settings", brands=brands, types=types, sections=sections, functions=functions)