Refactor project dashboard and device list templates; add modals for editing projects and locations

- Updated project_dashboard.html to conditionally display NRLs or Locations based on project type, and added a button to open a modal for adding locations.
- Enhanced slm_device_list.html with a configuration button for each unit, allowing users to open a modal for device configuration.
- Modified detail.html to include an edit project modal with a form for updating project details, including client name, status, and dates.
- Improved sound_level_meters.html by restructuring the layout and adding a configuration modal for SLM devices.
- Implemented JavaScript functions for handling modal interactions, including opening, closing, and submitting forms for project and location management.
This commit is contained in:
serversdwn
2026-01-12 23:07:25 +00:00
parent 8a5fadb5df
commit 04c66bdf9c
9 changed files with 705 additions and 226 deletions

View File

@@ -61,13 +61,9 @@ async def get_slm_stats(request: Request, db: Session = Depends(get_db)):
async def get_slm_units(
request: Request,
db: Session = Depends(get_db),
<<<<<<< Updated upstream
search: str = Query(None)
=======
search: str = Query(None),
project: str = Query(None),
include_measurement: bool = Query(False),
>>>>>>> Stashed changes
):
"""
Get list of SLM units for the sidebar.
@@ -75,6 +71,10 @@ async def get_slm_units(
"""
query = db.query(RosterUnit).filter_by(device_type="sound_level_meter")
# Filter by project if provided
if project:
query = query.filter(RosterUnit.project_id == project)
# Filter by search term if provided
if search:
search_term = f"%{search}%"