generated from john/python-template
@@ -53,9 +53,9 @@ def render_sources_table(rows: Sequence[SourceTableRow]) -> None:
|
||||
rows=_serialize_rows(rows),
|
||||
columns=[
|
||||
{
|
||||
"name": "document_name",
|
||||
"label": "Document Name",
|
||||
"field": "document_name",
|
||||
"name": "upload_name",
|
||||
"label": "Upload Title",
|
||||
"field": "upload_name",
|
||||
"sortable": True,
|
||||
"classes": "font-serif text-left ui-table-cell-wrap",
|
||||
"align": "left",
|
||||
@@ -69,9 +69,9 @@ def render_sources_table(rows: Sequence[SourceTableRow]) -> None:
|
||||
"style": "width: 10%;",
|
||||
},
|
||||
{
|
||||
"name": "upload_name",
|
||||
"label": "Upload Title",
|
||||
"field": "upload_name",
|
||||
"name": "document_name",
|
||||
"label": "Document Name",
|
||||
"field": "document_name",
|
||||
"sortable": True,
|
||||
"classes": "font-serif text-left ui-table-cell-wrap",
|
||||
"align": "left",
|
||||
|
||||
@@ -27,10 +27,12 @@ from transcription.ui.components.confirm_delete import dependency_summary
|
||||
from transcription.ui.components.confirm_delete import render_delete_actions
|
||||
from transcription.ui.components.confirm_delete import render_delete_blocked_notice
|
||||
from transcription.ui.components.data_display import archival_badge
|
||||
from transcription.ui.components.data_display import metadata_link_row
|
||||
from transcription.ui.components.data_display import metadata_row
|
||||
from transcription.ui.components.error_presenter import run_ui_action
|
||||
from transcription.ui.components.error_presenter import show_error
|
||||
from transcription.ui.components.formatters import compact_date
|
||||
from transcription.ui.components.formatters import google_maps_search_url
|
||||
from transcription.ui.components.formatters import parse_iso_date
|
||||
from transcription.ui.components.formatters import parse_uuid
|
||||
from transcription.ui.components.guards import parsed_record_id
|
||||
@@ -560,7 +562,14 @@ def _render_bento_metadata_zone(document: Document) -> None:
|
||||
)
|
||||
metadata_row("Tags:", ", ".join(tags) if tags else "Not set")
|
||||
metadata_row("Document Date:", _detail_document_date(document.document_date, document.document_date_raw))
|
||||
metadata_row("Location Created:", document.location_created or "Not set")
|
||||
if document.location_created:
|
||||
metadata_link_row(
|
||||
"Location Created:",
|
||||
document.location_created,
|
||||
google_maps_search_url(document.location_created),
|
||||
)
|
||||
else:
|
||||
metadata_row("Location Created:", "Not set")
|
||||
metadata_row("Archive Identifier:", document.archive_identifier or "Not set")
|
||||
|
||||
with ui.column().classes("w-full mt-2"):
|
||||
|
||||
@@ -655,13 +655,22 @@ async def _render_person_photo_zone(
|
||||
active_index = [0]
|
||||
|
||||
with ui.column().classes("col-span-12 lg:col-span-4"), archival_card(title="Photos", extra_classes="gap-3"):
|
||||
_render_photo_viewer_with_navigation(
|
||||
photos=photos,
|
||||
active_index=active_index,
|
||||
settings=settings,
|
||||
request=request,
|
||||
empty_message="No portrait photo uploaded yet.",
|
||||
)
|
||||
|
||||
@ui.refreshable
|
||||
def render_photo_viewer() -> None:
|
||||
def refresh_photo_viewer() -> None:
|
||||
render_photo_viewer.refresh()
|
||||
|
||||
_render_photo_viewer_with_navigation(
|
||||
photos=photos,
|
||||
active_index=active_index,
|
||||
settings=settings,
|
||||
request=request,
|
||||
empty_message="No portrait photo uploaded yet.",
|
||||
on_change=refresh_photo_viewer,
|
||||
)
|
||||
|
||||
render_photo_viewer()
|
||||
|
||||
|
||||
def _shift_gallery_index(*, photos: list, active_index: list[int], step: int) -> None:
|
||||
|
||||
Reference in New Issue
Block a user