diff --git a/src/rubintv/handlers/external.py b/src/rubintv/handlers/external.py index 4b44fb74..2604cff3 100644 --- a/src/rubintv/handlers/external.py +++ b/src/rubintv/handlers/external.py @@ -67,6 +67,12 @@ async def get_location_camera( return (location, camera) +# @external_router.get( +# "/api/location/{location_name}/camera/{camera_name}", +# response_model=Tuple[Location, Camera], +# ) + + @external_router.get( "/{location_name}", response_class=HTMLResponse, name="location" ) @@ -93,7 +99,10 @@ async def get_camera_page( location, camera = await get_location_camera( location_name, camera_name, request ) + template = "camera" + if not camera.online: + template = "not_online" return templates.TemplateResponse( - "camera.jinja", + f"{template}.jinja", {"request": request, "location": location, "camera": camera}, ) diff --git a/src/rubintv/templates/_camera.jinja b/src/rubintv/templates/_camera.jinja new file mode 100644 index 00000000..32603821 --- /dev/null +++ b/src/rubintv/templates/_camera.jinja @@ -0,0 +1,12 @@ +{% extends "_layout.jinja" %} +{% block pagetitle %} + + {{ camera.title }} + + {% block inline_status %} + {% endblock inline_status %} +{% endblock pagetitle %} diff --git a/src/rubintv/templates/camera.jinja b/src/rubintv/templates/camera.jinja index 5aa50257..5ade7ed9 100644 --- a/src/rubintv/templates/camera.jinja +++ b/src/rubintv/templates/camera.jinja @@ -1,9 +1,74 @@ -{% extends "_layout.jinja" %} -{% block pagetitle %} - {{ camera.title }} -{% endblock pagetitle %} +{% extends "_camera.jinja" %} +{% block pagesubtitle %} + Latest +{% endblock pagesubtitle %} + +{% block undertitle %} + {{ date }} + + Historical + +{% endblock undertitle %} {% block breadcrumb %} -Home> -
{{ location.title }}
-{% endblock breadcrumb %} + + Home + > + + {{ location.title }} + > +{{ camera.title }}
+{% endblock breadcrumb %} + +{% block content %} +