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 %} +
+ {% include "camera_parts/per-day-refresh.jinja" %} +
+ +
+ +
+ +
+

metadata service: 

+
+
+
+
+ +
+ {# {% include "cameras/data-table-header.jinja" %} #} +
+ {% if camera.metadata_headers %} + + {% endif %} +{% endblock content %} + +{% block footer_scripts %} + {% if camera.js_entry %} + {% set cam_js = "assets/" + camera.js_entry + ".js" %} + + {% endif %} + {{ super() }} +{% endblock footer_scripts %} diff --git a/src/rubintv/templates/camera_parts/night-report-link.jinja b/src/rubintv/templates/camera_parts/night-report-link.jinja new file mode 100644 index 00000000..789ddbe1 --- /dev/null +++ b/src/rubintv/templates/camera_parts/night-report-link.jinja @@ -0,0 +1,20 @@ +{% if night_reports_link %} + {% set label = camera.night_report_label %} + +{% endif %} diff --git a/src/rubintv/templates/camera_parts/per-day-channels.jinja b/src/rubintv/templates/camera_parts/per-day-channels.jinja new file mode 100644 index 00000000..c7b1d545 --- /dev/null +++ b/src/rubintv/templates/camera_parts/per-day-channels.jinja @@ -0,0 +1,21 @@ + {% if per_day | length %} + +{% endif %} diff --git a/src/rubintv/templates/camera_parts/per-day-refresh.jinja b/src/rubintv/templates/camera_parts/per-day-refresh.jinja new file mode 100644 index 00000000..b5101358 --- /dev/null +++ b/src/rubintv/templates/camera_parts/per-day-refresh.jinja @@ -0,0 +1,2 @@ +{% include "camera_parts/night-report-link.jinja" %} +{% include "camera_parts/per-day-channels.jinja" %} diff --git a/src/rubintv/templates/not_online.jinja b/src/rubintv/templates/not_online.jinja new file mode 100644 index 00000000..16dc45cd --- /dev/null +++ b/src/rubintv/templates/not_online.jinja @@ -0,0 +1,5 @@ +{% extends "_camera.jinja" %} + +{% block content %} +

Coming soon...

+{% endblock content %}