bmc_hub/app/customers/backend/views.py
Christian 770f822fc6 feat: Implement bug reporting feature with screenshot support
- Added a new modal for reporting bugs, including fields for describing the issue and attaching optional files.
- Integrated automatic screenshot capture functionality when the bug report modal is opened.
- Created a new API endpoint for submitting bug reports, including validation and rate limiting.
- Added database migration for tracking bug report submissions.
- Updated frontend scripts to handle bug report submissions and display status messages.
- Enhanced contact search functionality with improved error handling and backward compatibility.
- Introduced a new button in the UI for accessing the bug report modal.
2026-05-06 07:01:43 +02:00

44 lines
1.6 KiB
Python

from fastapi import APIRouter, Request
from fastapi.templating import Jinja2Templates
from fastapi.responses import HTMLResponse
from app.core.config import settings
router = APIRouter()
templates = Jinja2Templates(directory="app")
@router.get("/customers", response_class=HTMLResponse)
async def customers_page(request: Request):
"""
Render the customers page
"""
return templates.TemplateResponse("customers/frontend/customers.html", {"request": request})
@router.get("/customers/{customer_id}", response_class=HTMLResponse)
async def customer_detail_page(request: Request, customer_id: int):
"""
Render the customer detail page
"""
return templates.TemplateResponse("customers/frontend/customer_detail.html", {
"request": request,
"customer_id": customer_id,
"customer_default_margin_percent": settings.CUSTOMER_DEFAULT_MARGIN_PERCENT,
"customer_default_invoice_fee": settings.CUSTOMER_DEFAULT_INVOICE_FEE,
"customer_default_hourly_rate": settings.CUSTOMER_DEFAULT_HOURLY_RATE,
})
@router.get("/admin/bmc-office-upload", response_class=HTMLResponse)
async def bmc_office_upload_page(request: Request):
"""BMC Office subscriptions upload page"""
return templates.TemplateResponse(
"customers/frontend/bmc_office_upload.html",
{"request": request}
)
@router.get("/pipeline", response_class=HTMLResponse)
async def pipeline_page(request: Request):
"""Render the pipeline page"""
return templates.TemplateResponse("customers/frontend/pipeline.html", {"request": request})