Show last-found location and time on the object card
Surfaces last_seen_location/last_seen_at (recorded by inventory audit scans) on both the admin edit page and the public QR-scan detail page, so it's visible without having to check the audit list. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -122,6 +122,13 @@ export function ObjectFormPage() {
|
|||||||
<div className="mx-auto max-w-lg space-y-6">
|
<div className="mx-auto max-w-lg space-y-6">
|
||||||
<h1 className="text-xl font-semibold">{isEditing ? 'Изменить объект' : 'Новый объект'}</h1>
|
<h1 className="text-xl font-semibold">{isEditing ? 'Изменить объект' : 'Новый объект'}</h1>
|
||||||
|
|
||||||
|
{object?.last_seen_at && (
|
||||||
|
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||||
|
Последний раз найден{object.last_seen_location ? `: ${object.last_seen_location}` : ''} ·{' '}
|
||||||
|
{new Date(object.last_seen_at).toLocaleString('ru-RU', { dateStyle: 'medium', timeStyle: 'short' })}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-4">
|
<form onSubmit={handleSubmit(onSubmit)} className="space-y-4">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<label className="text-sm font-medium">Инвентарный номер</label>
|
<label className="text-sm font-medium">Инвентарный номер</label>
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ export function ObjectDetailPage() {
|
|||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-semibold text-slate-900 dark:text-slate-100">{object.name}</h1>
|
<h1 className="text-2xl font-semibold text-slate-900 dark:text-slate-100">{object.name}</h1>
|
||||||
<p className="text-sm text-slate-500 dark:text-slate-400">Инв. номер: {object.inventory_number}</p>
|
<p className="text-sm text-slate-500 dark:text-slate-400">Инв. номер: {object.inventory_number}</p>
|
||||||
|
{object.last_seen_at && (
|
||||||
|
<p className="text-sm text-slate-500 dark:text-slate-400">
|
||||||
|
Последний раз найден{object.last_seen_location ? `: ${object.last_seen_location}` : ''} ·{' '}
|
||||||
|
{new Date(object.last_seen_at).toLocaleString('ru-RU', { dateStyle: 'medium', timeStyle: 'short' })}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{object.description && (
|
{object.description && (
|
||||||
<p className="whitespace-pre-wrap text-slate-700 dark:text-slate-300">{object.description}</p>
|
<p className="whitespace-pre-wrap text-slate-700 dark:text-slate-300">{object.description}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user