- Added a new API router for managing vendors with endpoints for listing, creating, updating, retrieving, and deleting vendors. - Implemented frontend views for displaying vendor lists and details using Jinja2 templates. - Created HTML templates for vendor list and detail pages with responsive design and dynamic content loading. - Added JavaScript functionality for vendor management, including pagination, filtering, and modal forms for creating new vendors. - Introduced a settings table in the database for system configuration and extended the users table with additional fields. - Developed a script to import vendors from an OmniSync database into the PostgreSQL database, handling errors and logging progress.
20 lines
521 B
Python
20 lines
521 B
Python
"""
|
|
Settings Frontend Views
|
|
"""
|
|
|
|
from fastapi import APIRouter, Request
|
|
from fastapi.responses import HTMLResponse
|
|
from fastapi.templating import Jinja2Templates
|
|
|
|
router = APIRouter()
|
|
templates = Jinja2Templates(directory="app")
|
|
|
|
|
|
@router.get("/settings", response_class=HTMLResponse, tags=["Frontend"])
|
|
async def settings_page(request: Request):
|
|
"""Render settings page"""
|
|
return templates.TemplateResponse("settings/frontend/settings.html", {
|
|
"request": request,
|
|
"title": "Indstillinger"
|
|
})
|