feat(manager): customer display looks: several, a default, one per display; pictures from the library (platform-v2 step 5.3)
Settings → Customer display lists the looks (default starred, how many displays each), edits one (logo / picture with MediaField, the slideshow's pictures picked several at a time, reordered, removed), new look (empty or a copy), make default, delete, and "Which display shows which look". The Devices page offers the looks for a display's Idle screen. MediaPicker: `multiple`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,22 @@
|
|||||||
// Settings → Customer display (plan step 3.4). What the customer displays show between sales,
|
// Settings → Customer display (plan steps 3.4, 5.3). What the customer displays show between
|
||||||
// the venue's own style (owner, 2026-11-16): the name, the logo, both, nothing, one image, a
|
// sales is a **look** the venue designs (owner, 2026-11-16: "configurable, so each venue can
|
||||||
// slideshow of photos, or a QR code (the venue's ordering link, its QR menu, or any link), with
|
// choose their style"): the name, the logo, both, nothing, one picture, a slideshow, or a QR code
|
||||||
// an optional line of text, dark or light. Images are uploaded here (JPG/PNG/WebP/GIF, ≤ 5 MB).
|
// (the venue's ordering link, its QR menu, or any link), with an optional line of text, dark or
|
||||||
// Saving reaches every display at once. Backend: /api/display/settings, /api/display/media.
|
// light. A venue can have several looks; one is the default and each display can show its own
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
// (also its "Idle screen" in Devices). Pictures come from the media library (Management → Media).
|
||||||
|
// Saving reaches the displays that show the look at once.
|
||||||
|
// Backend: /api/display/looks, /api/display/displays (routers/customer_display.py).
|
||||||
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import toast from 'react-hot-toast'
|
import toast from 'react-hot-toast'
|
||||||
import { Check, ImagePlus, Trash2 } from 'lucide-react'
|
import { ArrowLeft, ArrowRight, Check, Images, Plus, Star, Trash2, X } from 'lucide-react'
|
||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
import { Button, Field, IconButton, Input, Select, Spinner } from '@xenia/ui'
|
import { Button, Dialog, Field, IconButton, Input, Select, Spinner, Switch } from '@xenia/ui'
|
||||||
import client from '../../../api/client'
|
import client from '../../../api/client'
|
||||||
|
import MediaField from '../../media/MediaField'
|
||||||
|
import MediaPicker from '../../media/MediaPicker'
|
||||||
|
import { imageOf } from '../../media/mediaLogic'
|
||||||
|
import { MediaThumb } from '../../media/MediaParts'
|
||||||
import { useSettings } from './useSettings'
|
import { useSettings } from './useSettings'
|
||||||
|
|
||||||
const STYLES = ['name', 'logo', 'name_logo', 'blank', 'image', 'slideshow', 'qr']
|
const STYLES = ['name', 'logo', 'name_logo', 'blank', 'image', 'slideshow', 'qr']
|
||||||
@@ -17,59 +24,53 @@ const STYLES = ['name', 'logo', 'name_logo', 'blank', 'image', 'slideshow', 'qr'
|
|||||||
export default function CustomerDisplaySettings() {
|
export default function CustomerDisplaySettings() {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
const venue = useSettings()
|
const venue = useSettings()
|
||||||
const [data, setData] = useState(null)
|
const [looks, setLooks] = useState(null)
|
||||||
const [form, setForm] = useState(null)
|
const [displays, setDisplays] = useState([])
|
||||||
|
const [current, setCurrent] = useState(null) // the look being edited (id)
|
||||||
|
const [form, setForm] = useState(null) // its config
|
||||||
|
const [pics, setPics] = useState({}) // media id → image {id, name, thumb, card, full}
|
||||||
|
const [lookName, setLookName] = useState('')
|
||||||
const [busy, setBusy] = useState(false)
|
const [busy, setBusy] = useState(false)
|
||||||
const [name, setName] = useState(null)
|
const [venueName, setVenueName] = useState(null)
|
||||||
const fileRef = useRef(null)
|
const [adding, setAdding] = useState(false)
|
||||||
|
const [confirmDelete, setConfirmDelete] = useState(false)
|
||||||
|
|
||||||
const load = useCallback(async () => {
|
const open = useCallback(look => {
|
||||||
|
setCurrent(look.id)
|
||||||
|
setForm(look.config)
|
||||||
|
setLookName(look.name)
|
||||||
|
setPics(p => ({ ...p, ...Object.fromEntries(Object.entries(look.pictures || {}).map(([k, v]) => [Number(k), v])) }))
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const load = useCallback(async (pick) => {
|
||||||
try {
|
try {
|
||||||
const { data: d } = await client.get('/api/display/settings')
|
const [{ data: ls }, { data: ds }] = await Promise.all([client.get('/api/display/looks'), client.get('/api/display/displays')])
|
||||||
setData(d)
|
setLooks(ls)
|
||||||
setForm(f => f ?? d.idle)
|
setDisplays(ds)
|
||||||
} catch (err) { toast.error(errorMessage(err, t)) }
|
const target = ls.find(l => l.id === pick) || null
|
||||||
}, [t])
|
if (target) open(target)
|
||||||
useEffect(() => { load() }, [load])
|
return ls
|
||||||
|
} catch (err) { toast.error(errorMessage(err, t)); return null }
|
||||||
|
}, [t, open])
|
||||||
|
useEffect(() => { load().then(ls => { if (ls?.length) open(ls[0]) }) }, [load, open])
|
||||||
|
|
||||||
|
const look = looks?.find(l => l.id === current)
|
||||||
|
const dirty = useMemo(() => look && (JSON.stringify(look.config) !== JSON.stringify(form) || lookName.trim() !== look.name), [look, form, lookName])
|
||||||
|
if (!looks || !form || !look || venue.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
||||||
|
|
||||||
if (!data || !form || venue.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
|
||||||
const set = (k, v) => setForm(f => ({ ...f, [k]: v }))
|
const set = (k, v) => setForm(f => ({ ...f, [k]: v }))
|
||||||
const media = data.media
|
const shows = part => ({ logo: ['logo', 'name_logo'], image: ['image'], slides: ['slideshow'], qr: ['qr'] })[part].includes(form.style)
|
||||||
const needs = { logo: ['logo', 'name_logo'], image: ['image'], slides: ['slideshow'], qr: ['qr'] }
|
const picOf = id => (id ? pics[id] ?? null : null)
|
||||||
const shows = part => needs[part].includes(form.style)
|
const setPic = (key, image) => { if (image) setPics(p => ({ ...p, [image.id]: image })); set(key, image?.id ?? null) }
|
||||||
|
|
||||||
const save = async () => {
|
const act = async (fn, done, pick = current) => {
|
||||||
setBusy(true)
|
setBusy(true)
|
||||||
try {
|
try { await fn(); if (done) toast.success(done); await load(pick) } catch (err) { toast.error(errorMessage(err, t)) }
|
||||||
const { data: d } = await client.put('/api/display/settings', form)
|
|
||||||
setData(d)
|
|
||||||
setForm(d.idle)
|
|
||||||
toast.success(t('settings.saved'))
|
|
||||||
} catch (err) { toast.error(errorMessage(err, t)) }
|
|
||||||
setBusy(false)
|
setBusy(false)
|
||||||
}
|
}
|
||||||
const upload = async e => {
|
const save = () => act(() => client.put(`/api/display/looks/${look.id}`, { name: lookName.trim() || look.name, config: form }), t('settings.saved'))
|
||||||
const files = [...(e.target.files ?? [])]
|
const lookLabel = l => `${l.name}${l.is_default ? ` (${t('display.looks.default')})` : ''}`
|
||||||
e.target.value = ''
|
const defaultLook = looks.find(l => l.is_default)
|
||||||
for (const file of files) {
|
|
||||||
const body = new FormData()
|
|
||||||
body.append('file', file)
|
|
||||||
try {
|
|
||||||
const { data: m } = await client.post('/api/display/media', body)
|
|
||||||
setData(d => ({ ...d, media: [...d.media, m] }))
|
|
||||||
if (form.style === 'slideshow') setForm(f => ({ ...f, slides: [...f.slides, m.name] }))
|
|
||||||
} catch (err) { toast.error(errorMessage(err, t)) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const remove = async m => {
|
|
||||||
try {
|
|
||||||
await client.delete(`/api/display/media/${m.name}`)
|
|
||||||
setData(d => ({ ...d, media: d.media.filter(x => x.name !== m.name) }))
|
|
||||||
setForm(f => ({ ...f, logo: f.logo === m.name ? null : f.logo, image: f.image === m.name ? null : f.image,
|
|
||||||
slides: f.slides.filter(n => n !== m.name) }))
|
|
||||||
} catch (err) { toast.error(errorMessage(err, t)) }
|
|
||||||
}
|
|
||||||
const toggleSlide = n => set('slides', form.slides.includes(n) ? form.slides.filter(x => x !== n) : [...form.slides, n])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="bg-surface border border-line rounded-card shadow-raised grid gap-5 p-5" data-testid="settings-display">
|
<section className="bg-surface border border-line rounded-card shadow-raised grid gap-5 p-5" data-testid="settings-display">
|
||||||
@@ -78,6 +79,39 @@ export default function CustomerDisplaySettings() {
|
|||||||
<p className="text-label text-ink-2">{t('display.intro')}</p>
|
<p className="text-label text-ink-2">{t('display.intro')}</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
{/* the looks */}
|
||||||
|
<div className="grid gap-2">
|
||||||
|
<span className="text-label font-medium text-ink-2">{t('display.looks.title')}</span>
|
||||||
|
<div className="flex flex-wrap gap-2" role="tablist" aria-label={t('display.looks.title')}>
|
||||||
|
{looks.map(l => (
|
||||||
|
<button key={l.id} type="button" role="tab" aria-selected={l.id === current} data-testid="display-look" data-name={l.name}
|
||||||
|
onClick={() => (dirty && !window.confirm(t('display.looks.discard')) ? null : open(l))}
|
||||||
|
className={`px-3 py-2 rounded-control border text-label font-medium flex items-center gap-1.5 transition-colors duration-fast
|
||||||
|
${l.id === current ? 'border-accent bg-accent-soft text-accent-ink' : 'border-line bg-surface-2 text-ink hover:bg-surface-3'}`}>
|
||||||
|
{l.is_default && <Star size={14} aria-label={t('display.looks.default')} />}
|
||||||
|
{l.name}
|
||||||
|
<span className="text-caption text-ink-3 font-normal">{t('display.looks.screens', { count: l.displays.length })}</span>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
<Button size="sm" variant="ghost" icon={<Plus size={14} />} onClick={() => setAdding(true)} data-testid="display-look-new">{t('display.looks.new')}</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* the look being edited */}
|
||||||
|
<div className="grid gap-5 rounded-card border border-line p-4" data-testid="display-look-editor" data-id={look.id}>
|
||||||
|
<div className="flex flex-wrap items-end gap-2">
|
||||||
|
<Field label={t('display.looks.name')} className="flex-1 min-w-[12rem]">
|
||||||
|
<Input value={lookName} maxLength={60} onChange={e => setLookName(e.target.value)} data-testid="display-look-name" />
|
||||||
|
</Field>
|
||||||
|
{look.is_default
|
||||||
|
? <span className="text-label text-ink-2 flex items-center gap-1 h-control"><Star size={14} aria-hidden="true" />{t('display.looks.isDefault')}</span>
|
||||||
|
: <>
|
||||||
|
<Button variant="secondary" disabled={busy} onClick={() => act(() => client.post(`/api/display/looks/${look.id}/default`), t('display.looks.madeDefault'))}
|
||||||
|
data-testid="display-look-default">{t('display.looks.makeDefault')}</Button>
|
||||||
|
<IconButton variant="ghost" label={t('fees.delete')} disabled={busy} onClick={() => setConfirmDelete(true)} data-testid="display-look-delete"><Trash2 size={16} /></IconButton>
|
||||||
|
</>}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="grid gap-2" role="radiogroup" aria-label={t('display.style')}>
|
<div className="grid gap-2" role="radiogroup" aria-label={t('display.style')}>
|
||||||
<span className="text-label font-medium text-ink-2">{t('display.style')}</span>
|
<span className="text-label font-medium text-ink-2">{t('display.style')}</span>
|
||||||
<div className="grid gap-2" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(10rem, 1fr))' }}>
|
<div className="grid gap-2" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(10rem, 1fr))' }}>
|
||||||
@@ -93,13 +127,6 @@ export default function CustomerDisplaySettings() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid gap-3 sm:grid-cols-2">
|
<div className="grid gap-3 sm:grid-cols-2">
|
||||||
<div className="flex items-start gap-2">
|
|
||||||
<Field label={t('display.venueName')} hint={t('display.venueNameHint')} className="flex-1">
|
|
||||||
<Input value={name ?? venue.get('venue.name', '')} onChange={e => setName(e.target.value)} maxLength={80} data-testid="display-venue-name" />
|
|
||||||
</Field>
|
|
||||||
<Button variant="secondary" className="mt-7" disabled={name == null || venue.saving} data-testid="display-venue-name-save"
|
|
||||||
onClick={() => { venue.save('venue.name', name.trim()); setName(null) }}>{t('fees.save')}</Button>
|
|
||||||
</div>
|
|
||||||
{form.style !== 'blank' && (
|
{form.style !== 'blank' && (
|
||||||
<Field label={t('display.message')} hint={t('display.messageHint')}>
|
<Field label={t('display.message')} hint={t('display.messageHint')}>
|
||||||
<Input value={form.message ?? ''} onChange={e => set('message', e.target.value)} maxLength={120} data-testid="display-message" />
|
<Input value={form.message ?? ''} onChange={e => set('message', e.target.value)} maxLength={120} data-testid="display-message" />
|
||||||
@@ -137,42 +164,125 @@ export default function CustomerDisplaySettings() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{(shows('logo') || shows('image') || shows('slides')) && (
|
{shows('logo') && <MediaField value={picOf(form.logo)} onChange={img => setPic('logo', img)} label={t('display.pickLogo')} testid="display-logo" />}
|
||||||
<div className="grid gap-3">
|
{shows('image') && <MediaField value={picOf(form.image)} onChange={img => setPic('image', img)} label={t('display.pickImage')} testid="display-image" />}
|
||||||
<div className="flex items-center gap-2">
|
{shows('slides') && <Slides ids={form.slides} pics={pics} onChange={(ids, more) => { if (more) setPics(p => ({ ...p, ...more })); set('slides', ids) }} />}
|
||||||
<span className="flex-1 text-label font-medium text-ink-2">
|
|
||||||
{t(shows('logo') ? 'display.pickLogo' : shows('image') ? 'display.pickImage' : 'display.pickSlides')}
|
<div className="flex gap-2 items-center">
|
||||||
</span>
|
<Button onClick={save} loading={busy} data-testid="display-save">{t('fees.save')}</Button>
|
||||||
<input ref={fileRef} type="file" accept="image/jpeg,image/png,image/webp,image/gif" multiple className="hidden" onChange={upload} data-testid="display-upload" />
|
{dirty && <span className="text-label text-ink-3">{t('display.looks.unsaved')}</span>}
|
||||||
<Button size="sm" variant="secondary" icon={<ImagePlus size={16} />} onClick={() => fileRef.current?.click()}>{t('display.upload')}</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{media.length === 0 ? (
|
</div>
|
||||||
<p className="text-label text-ink-3">{t('display.noImages')}</p>
|
|
||||||
) : (
|
{/* which display shows which look */}
|
||||||
<ul className="grid gap-3" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(9rem, 1fr))' }} data-testid="display-media">
|
<div className="grid gap-2" data-testid="display-screens">
|
||||||
{media.map(m => {
|
<span className="text-label font-medium text-ink-2">{t('display.looks.whichScreen')}</span>
|
||||||
const chosen = shows('logo') ? form.logo === m.name : shows('image') ? form.image === m.name : form.slides.includes(m.name)
|
{displays.length === 0 ? <p className="text-label text-ink-3">{t('display.looks.noScreens')}</p> : (
|
||||||
const pick = () => (shows('logo') ? set('logo', m.name) : shows('image') ? set('image', m.name) : toggleSlide(m.name))
|
<ul className="grid gap-2">
|
||||||
return (
|
{displays.map(d => (
|
||||||
<li key={m.name} className={`relative rounded-control border-2 overflow-hidden ${chosen ? 'border-accent' : 'border-line'}`}>
|
<li key={d.id} className="flex flex-wrap items-center gap-3">
|
||||||
<button type="button" onClick={pick} aria-pressed={chosen} className="block w-full aspect-video bg-surface-2" data-testid="display-media-pick">
|
<span className="text-body text-ink min-w-[10rem]">{d.name}</span>
|
||||||
<img src={m.url} alt="" className="w-full h-full object-contain" />
|
<Select value={d.look_id == null ? '' : String(d.look_id)} aria-label={t('display.looks.lookFor', { name: d.name })} data-testid={`display-assign-${d.id}`}
|
||||||
</button>
|
onChange={e => act(() => client.put(`/api/display/displays/${d.id}/look`, { look_id: e.target.value ? Number(e.target.value) : null }), t('settings.saved'))}
|
||||||
{chosen && shows('slides') && (
|
options={[{ value: '', label: t('display.looks.followDefault', { name: defaultLook?.name ?? '' }) },
|
||||||
<span className="absolute top-1 left-1 min-w-6 h-6 px-1 rounded-full bg-accent text-accent-fg text-caption font-bold flex items-center justify-center">
|
...looks.map(l => ({ value: String(l.id), label: lookLabel(l) }))]} />
|
||||||
{form.slides.indexOf(m.name) + 1}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
<IconButton size="sm" variant="secondary" label={t('fees.delete')} className="absolute top-1 right-1" onClick={() => remove(m)}><Trash2 size={14} /></IconButton>
|
|
||||||
</li>
|
</li>
|
||||||
)
|
))}
|
||||||
})}
|
|
||||||
</ul>
|
</ul>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
<div><Button onClick={save} loading={busy} data-testid="display-save">{t('fees.save')}</Button></div>
|
<div className="flex items-start gap-2 max-w-xl">
|
||||||
|
<Field label={t('display.venueName')} hint={t('display.venueNameHint')} className="flex-1">
|
||||||
|
<Input value={venueName ?? venue.get('venue.name', '')} onChange={e => setVenueName(e.target.value)} maxLength={80} data-testid="display-venue-name" />
|
||||||
|
</Field>
|
||||||
|
<Button variant="secondary" className="mt-7" disabled={venueName == null || venue.saving} data-testid="display-venue-name-save"
|
||||||
|
onClick={() => { venue.save('venue.name', venueName.trim()); setVenueName(null) }}>{t('fees.save')}</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{adding && <NewLook looks={looks} current={look} onClose={() => setAdding(false)}
|
||||||
|
onCreate={async body => {
|
||||||
|
setBusy(true)
|
||||||
|
try {
|
||||||
|
const { data } = await client.post('/api/display/looks', body)
|
||||||
|
setAdding(false)
|
||||||
|
toast.success(t('display.looks.created'))
|
||||||
|
await load(data.id)
|
||||||
|
} catch (err) { toast.error(errorMessage(err, t)) }
|
||||||
|
setBusy(false)
|
||||||
|
}} />}
|
||||||
|
|
||||||
|
{confirmDelete && (
|
||||||
|
<Dialog open size="sm" title={t('display.looks.deleteTitle', { name: look.name })} onClose={() => setConfirmDelete(false)}
|
||||||
|
footer={<>
|
||||||
|
<Button variant="secondary" onClick={() => setConfirmDelete(false)}>{t('fees.cancel')}</Button>
|
||||||
|
<Button variant="danger" loading={busy} data-testid="display-look-delete-confirm"
|
||||||
|
onClick={() => act(() => client.delete(`/api/display/looks/${look.id}`), t('display.looks.deleted'), defaultLook?.id)
|
||||||
|
.then(() => setConfirmDelete(false))}>{t('fees.delete')}</Button>
|
||||||
|
</>}>
|
||||||
|
<p className="text-body text-ink-2">{t('display.looks.deleteBody', { name: defaultLook?.name ?? '' })}</p>
|
||||||
|
</Dialog>
|
||||||
|
)}
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The slideshow's pictures, in order: move, remove, add from the library (several at once). */
|
||||||
|
function Slides({ ids, pics, onChange }) {
|
||||||
|
const { t } = useTranslation('manager')
|
||||||
|
const [picking, setPicking] = useState(false)
|
||||||
|
const move = (i, d) => { const next = [...ids]; [next[i], next[i + d]] = [next[i + d], next[i]]; onChange(next) }
|
||||||
|
return (
|
||||||
|
<div className="grid gap-2" data-testid="display-slides">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="flex-1 text-label font-medium text-ink-2">{t('display.pickSlides')}</span>
|
||||||
|
<Button size="sm" variant="secondary" icon={<Images size={14} />} onClick={() => setPicking(true)} data-testid="display-slides-add">{t('display.addSlides')}</Button>
|
||||||
|
</div>
|
||||||
|
{ids.length === 0 ? <p className="text-label text-ink-3">{t('display.noSlides')}</p> : (
|
||||||
|
<ol className="grid gap-3" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(8.5rem, 1fr))' }}>
|
||||||
|
{ids.map((id, i) => (
|
||||||
|
<li key={`${id}:${i}`} className="relative rounded-control border border-line overflow-hidden bg-surface-2" data-testid="display-slide-item" data-id={id}>
|
||||||
|
<MediaThumb item={pics[id]} className="w-full aspect-video" />
|
||||||
|
<span className="absolute top-1 left-1 min-w-6 h-6 px-1 rounded-full bg-accent text-accent-fg text-caption font-bold flex items-center justify-center">{i + 1}</span>
|
||||||
|
<span className="block px-2 pt-1 text-caption text-ink-2 truncate" title={pics[id]?.name}>{pics[id]?.name}</span>
|
||||||
|
<div className="flex items-center justify-between px-1 pb-1 gap-1">
|
||||||
|
<IconButton size="sm" variant="ghost" label={t('display.earlier')} disabled={i === 0} onClick={() => move(i, -1)}><ArrowLeft size={14} /></IconButton>
|
||||||
|
<IconButton size="sm" variant="ghost" label={t('display.later')} disabled={i === ids.length - 1} onClick={() => move(i, 1)}><ArrowRight size={14} /></IconButton>
|
||||||
|
<IconButton size="sm" variant="ghost" label={t('media.removePhoto')} onClick={() => onChange(ids.filter((_, j) => j !== i))}><X size={14} /></IconButton>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ol>
|
||||||
|
)}
|
||||||
|
{picking && <MediaPicker open multiple onClose={() => setPicking(false)}
|
||||||
|
onPickMany={items => {
|
||||||
|
const more = Object.fromEntries(items.map(it => [it.id, imageOf(it)]).filter(([, v]) => v))
|
||||||
|
onChange([...ids, ...items.map(it => it.id).filter(id => more[id])], more)
|
||||||
|
setPicking(false)
|
||||||
|
}} />}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A new look: a name, empty or a copy of the one on screen. */
|
||||||
|
function NewLook({ looks, current, onClose, onCreate }) {
|
||||||
|
const { t } = useTranslation('manager')
|
||||||
|
const [name, setName] = useState('')
|
||||||
|
const [copy, setCopy] = useState(true)
|
||||||
|
const taken = looks.some(l => l.name.toLowerCase() === name.trim().toLowerCase())
|
||||||
|
return (
|
||||||
|
<Dialog open size="sm" title={t('display.looks.new')} onClose={onClose}
|
||||||
|
footer={<>
|
||||||
|
<Button variant="secondary" onClick={onClose}>{t('fees.cancel')}</Button>
|
||||||
|
<Button disabled={!name.trim() || taken} data-testid="display-look-create"
|
||||||
|
onClick={() => onCreate({ name: name.trim(), ...(copy ? { copy_of: current.id } : {}) })}>{t('display.looks.create')}</Button>
|
||||||
|
</>}>
|
||||||
|
<div className="grid gap-3">
|
||||||
|
<Field label={t('display.looks.name')} error={taken ? t('display.looks.taken') : undefined}>
|
||||||
|
<Input value={name} autoFocus maxLength={60} onChange={e => setName(e.target.value)} placeholder={t('display.looks.namePlaceholder')} data-testid="display-look-new-name" />
|
||||||
|
</Field>
|
||||||
|
<Switch checked={copy} onChange={setCopy} label={t('display.looks.copyOf', { name: current.name })} />
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,16 +18,17 @@ export function MediaThumb({ item, className }) {
|
|||||||
return <img src={src} alt="" loading="lazy" onError={() => setBroken(true)} className={cx('object-cover bg-surface-3', className)} />
|
return <img src={src} alt="" loading="lazy" onError={() => setBroken(true)} className={cx('object-cover bg-surface-3', className)} />
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A grid of library items; `selectedId` marks one (the picker). */
|
/** A grid of library items; `selectedId` marks one, `selectedIds` (a Set) several (the picker). */
|
||||||
export function MediaGrid({ items, onOpen, selectedId, testid = 'media-grid' }) {
|
export function MediaGrid({ items, onOpen, selectedId, selectedIds, testid = 'media-grid' }) {
|
||||||
const meta = useMediaMeta()
|
const meta = useMediaMeta()
|
||||||
return (
|
return (
|
||||||
<ul className="grid gap-3" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(9.5rem, 1fr))' }} data-testid={testid}>
|
<ul className="grid gap-3" style={{ gridTemplateColumns: 'repeat(auto-fill, minmax(9.5rem, 1fr))' }} data-testid={testid}>
|
||||||
{items.map(item => (
|
{items.map(item => (
|
||||||
<li key={item.id}>
|
<li key={item.id}>
|
||||||
<button type="button" onClick={() => onOpen(item)} data-testid="media-item" data-id={item.id} data-name={item.name}
|
<button type="button" onClick={() => onOpen(item)} data-testid="media-item" data-id={item.id} data-name={item.name}
|
||||||
|
aria-pressed={selectedIds ? selectedIds.has(item.id) : undefined}
|
||||||
className={cx('w-full text-left rounded-card border bg-surface overflow-hidden transition-colors duration-fast hover:border-line-strong focus-visible:shadow-focus outline-none',
|
className={cx('w-full text-left rounded-card border bg-surface overflow-hidden transition-colors duration-fast hover:border-line-strong focus-visible:shadow-focus outline-none',
|
||||||
selectedId === item.id ? 'border-accent ring-2 ring-accent' : 'border-line')}>
|
selectedId === item.id || selectedIds?.has(item.id) ? 'border-accent ring-2 ring-accent' : 'border-line')}>
|
||||||
<MediaThumb item={item} className="w-full aspect-square" />
|
<MediaThumb item={item} className="w-full aspect-square" />
|
||||||
<span className="block px-2 pt-1.5 text-label font-medium text-ink truncate" title={item.name}>{item.name}</span>
|
<span className="block px-2 pt-1.5 text-label font-medium text-ink truncate" title={item.name}>{item.name}</span>
|
||||||
<span className="block px-2 pb-2 text-caption text-ink-3 truncate">{meta(item)}</span>
|
<span className="block px-2 pb-2 text-caption text-ink-3 truncate">{meta(item)}</span>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Pick a picture from the media library (plan step 5.2), or upload one here: an upload made from
|
// Pick a picture from the media library (plan step 5.2), or upload one here: an upload made from
|
||||||
// the picker is picked at once. Used by MediaField (products, categories; more places later).
|
// the picker is picked at once. Used by MediaField (products, categories; more places later).
|
||||||
|
// `multiple` (5.3, a slideshow): tap pictures to select several, then "Add"; uploads are selected.
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import { Upload } from 'lucide-react'
|
import { Upload } from 'lucide-react'
|
||||||
import { errorMessage } from '@xenia/api'
|
import { errorMessage } from '@xenia/api'
|
||||||
@@ -10,13 +11,15 @@ import { ACCEPT } from './mediaLogic'
|
|||||||
import { MediaGrid, UploadQueue } from './MediaParts'
|
import { MediaGrid, UploadQueue } from './MediaParts'
|
||||||
import { useUploadQueue } from './mediaHooks'
|
import { useUploadQueue } from './mediaHooks'
|
||||||
|
|
||||||
export default function MediaPicker({ open, onClose, onPick, kind = 'image', selectedId }) {
|
export default function MediaPicker({ open, onClose, onPick, onPickMany, multiple = false, kind = 'image', selectedId }) {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
const [q, setQ] = useState('')
|
const [q, setQ] = useState('')
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
const [page, setPage] = useState(null)
|
const [page, setPage] = useState(null)
|
||||||
const [error, setError] = useState(null)
|
const [error, setError] = useState(null)
|
||||||
const input = useRef(null)
|
const input = useRef(null)
|
||||||
|
const [chosen, setChosen] = useState([]) // multiple: the items picked so far, in order
|
||||||
|
const toggle = item => setChosen(c => (c.some(x => x.id === item.id) ? c.filter(x => x.id !== item.id) : [...c, item]))
|
||||||
|
|
||||||
useEffect(() => { const h = setTimeout(() => setSearch(q.trim()), 250); return () => clearTimeout(h) }, [q])
|
useEffect(() => { const h = setTimeout(() => setSearch(q.trim()), 250); return () => clearTimeout(h) }, [q])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -26,25 +29,34 @@ export default function MediaPicker({ open, onClose, onPick, kind = 'image', sel
|
|||||||
return () => { live = false }
|
return () => { live = false }
|
||||||
}, [open, kind, search, t])
|
}, [open, kind, search, t])
|
||||||
|
|
||||||
const { queue, add, clear, summary } = useUploadQueue(useCallback(item => onPick(item, { uploaded: !item.existing }), [onPick]))
|
const { queue, add, clear, summary } = useUploadQueue(useCallback(item => {
|
||||||
|
setPage(p => (p && !p.items.some(x => x.id === item.id) ? { ...p, items: [item, ...p.items], total: p.total + 1 } : p))
|
||||||
|
if (multiple) setChosen(c => (c.some(x => x.id === item.id) ? c : [...c, item]))
|
||||||
|
else onPick(item, { uploaded: !item.existing })
|
||||||
|
}, [onPick, multiple]))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} size="lg" title={t('media.pickTitle')} onClose={onClose}
|
<Dialog open={open} size="lg" title={t('media.pickTitle')} onClose={onClose}
|
||||||
footer={<Button variant="secondary" onClick={onClose}>{t('fees.cancel')}</Button>}>
|
footer={<>
|
||||||
|
<Button variant="secondary" onClick={onClose}>{t('fees.cancel')}</Button>
|
||||||
|
{multiple && <Button disabled={!chosen.length} onClick={() => onPickMany(chosen)} data-testid="media-picker-add">
|
||||||
|
{t('media.addChosen', { count: chosen.length })}</Button>}
|
||||||
|
</>}>
|
||||||
<div className="grid gap-3" data-testid="media-picker">
|
<div className="grid gap-3" data-testid="media-picker">
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className="flex flex-wrap gap-2">
|
||||||
<Input value={q} onChange={e => setQ(e.target.value)} placeholder={t('media.search')} aria-label={t('media.search')}
|
<Input value={q} onChange={e => setQ(e.target.value)} placeholder={t('media.search')} aria-label={t('media.search')}
|
||||||
className="flex-1 min-w-[10rem]" data-testid="media-picker-search" />
|
className="flex-1 min-w-[10rem]" data-testid="media-picker-search" />
|
||||||
<Button variant="secondary" icon={<Upload size={16} />} onClick={() => input.current?.click()} disabled={summary.busy}>{t('media.uploadNew')}</Button>
|
<Button variant="secondary" icon={<Upload size={16} />} onClick={() => input.current?.click()} disabled={summary.busy}>{t('media.uploadNew')}</Button>
|
||||||
<input ref={input} type="file" accept={kind === 'image' ? ACCEPT.split(',').filter(a => a.startsWith('image/')).join(',') : ACCEPT}
|
<input ref={input} type="file" accept={kind === 'image' ? ACCEPT.split(',').filter(a => a.startsWith('image/')).join(',') : ACCEPT}
|
||||||
className="sr-only" data-testid="media-picker-file" onChange={e => { if (e.target.files?.length) add([e.target.files[0]]); e.target.value = '' }} />
|
className="sr-only" data-testid="media-picker-file" multiple={multiple} onChange={e => { if (e.target.files?.length) add(multiple ? e.target.files : [e.target.files[0]]); e.target.value = '' }} />
|
||||||
</div>
|
</div>
|
||||||
<UploadQueue queue={queue} summary={summary} onClear={clear} />
|
<UploadQueue queue={queue} summary={summary} onClear={clear} />
|
||||||
{error ? <EmptyState title={error} />
|
{error ? <EmptyState title={error} />
|
||||||
: !page ? <div className="flex justify-center p-6"><Spinner /></div>
|
: !page ? <div className="flex justify-center p-6"><Spinner /></div>
|
||||||
: page.items.length === 0 ? <EmptyState title={t(search ? 'media.noMatch' : 'media.empty')} />
|
: page.items.length === 0 ? <EmptyState title={t(search ? 'media.noMatch' : 'media.empty')} />
|
||||||
: <div className="max-h-[55vh] overflow-auto pr-1">
|
: <div className="max-h-[55vh] overflow-auto pr-1">
|
||||||
<MediaGrid items={page.items} selectedId={selectedId} onOpen={item => onPick(item, { uploaded: false })} testid="media-picker-grid" />
|
<MediaGrid items={page.items} selectedId={multiple ? undefined : selectedId} selectedIds={multiple ? new Set(chosen.map(c => c.id)) : undefined}
|
||||||
|
onOpen={item => (multiple ? toggle(item) : onPick(item, { uploaded: false }))} testid="media-picker-grid" />
|
||||||
</div>}
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import client from '../../api/client'
|
|||||||
import { configGroups, configValue, refOptions } from './devicesLogic'
|
import { configGroups, configValue, refOptions } from './devicesLogic'
|
||||||
|
|
||||||
// Where a `ref` field's choices come from (the device list is passed in)
|
// Where a `ref` field's choices come from (the device list is passed in)
|
||||||
const REF_URLS = { prep_zones: '/api/prep-zones', categories: '/api/products/categories', printers: '/api/system/printers' }
|
const REF_URLS = { prep_zones: '/api/prep-zones', categories: '/api/products/categories', printers: '/api/system/printers', display_looks: '/api/display/looks' }
|
||||||
|
|
||||||
export default function DeviceConfigFields({ appKey, fields = [], value, onChange, devices = [], selfId = null }) {
|
export default function DeviceConfigFields({ appKey, fields = [], value, onChange, devices = [], selfId = null }) {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
@@ -28,6 +28,7 @@ export default function DeviceConfigFields({ appKey, fields = [], value, onChang
|
|||||||
const zones = lists.prep_zones ?? []
|
const zones = lists.prep_zones ?? []
|
||||||
const categories = lists.categories ?? []
|
const categories = lists.categories ?? []
|
||||||
const printers = lists.printers ?? []
|
const printers = lists.printers ?? []
|
||||||
|
const looks = lists.display_looks ?? []
|
||||||
|
|
||||||
if (!fields.length) return null
|
if (!fields.length) return null
|
||||||
const base = key => `modules:${appKey}.config.${key}`
|
const base = key => `modules:${appKey}.config.${key}`
|
||||||
@@ -53,7 +54,7 @@ export default function DeviceConfigFields({ appKey, fields = [], value, onChang
|
|||||||
<Field key={f.key} label={label} hint={hint}>
|
<Field key={f.key} label={label} hint={hint}>
|
||||||
<Select value={v == null ? '' : String(v)} onChange={e => set(f, e.target.value)} data-config={f.key}
|
<Select value={v == null ? '' : String(v)} onChange={e => set(f, e.target.value)} data-config={f.key}
|
||||||
options={[{ value: '', label: t(`${base(f.key)}.none`, { defaultValue: t('devices.form.none') }) },
|
options={[{ value: '', label: t(`${base(f.key)}.none`, { defaultValue: t('devices.form.none') }) },
|
||||||
...refOptions(f, { zones, categories, printers, devices, selfId })]} />
|
...refOptions(f, { zones, categories, printers, looks, devices, selfId })]} />
|
||||||
</Field>
|
</Field>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,8 +85,9 @@ export function configGroups(fields = []) {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Options of a `ref` field: prep zones, categories, printers, or live devices of one app ("devices:<app>"). */
|
/** Options of a `ref` field: prep zones, categories, printers, customer display looks, or live devices of one app ("devices:<app>"). */
|
||||||
export function refOptions(field, { zones = [], categories = [], printers = [], devices = [], selfId = null } = {}) {
|
export function refOptions(field, { zones = [], categories = [], printers = [], looks = [], devices = [], selfId = null } = {}) {
|
||||||
|
if (field.choices_from === 'display_looks') return looks.map(l => ({ value: String(l.id), label: l.name }))
|
||||||
if (field.choices_from === 'prep_zones') return zones.map(z => ({ value: String(z.id), label: z.name }))
|
if (field.choices_from === 'prep_zones') return zones.map(z => ({ value: String(z.id), label: z.name }))
|
||||||
if (field.choices_from === 'categories') return categories.map(c => ({ value: String(c.id), label: c.name }))
|
if (field.choices_from === 'categories') return categories.map(c => ({ value: String(c.id), label: c.name }))
|
||||||
if (field.choices_from === 'printers') return printers.filter(p => p.is_active !== false).map(p => ({ value: String(p.id), label: p.name }))
|
if (field.choices_from === 'printers') return printers.filter(p => p.is_active !== false).map(p => ({ value: String(p.id), label: p.name }))
|
||||||
|
|||||||
@@ -628,7 +628,7 @@
|
|||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"title": "Οθόνη πελάτη",
|
"title": "Οθόνη πελάτη",
|
||||||
"intro": "Η οθόνη προς τους πελάτες στο ταμείο δείχνει την πώληση και το σύνολο όσο χτυπάτε, και \"Ευχαριστούμε\" με τα ρέστα μετά την πληρωμή. Εδώ διαλέγετε τι δείχνει στο ενδιάμεσο.",
|
"intro": "Η οθόνη που βλέπουν οι πελάτες στο ταμείο δείχνει την πώληση και το σύνολο όσο πουλάτε, και «Ευχαριστούμε» με τα ρέστα μετά την πληρωμή. Ενδιάμεσα δείχνει μια εμφάνιση που σχεδιάζετε εδώ. Φτιάξτε πολλές (π.χ. μια προσφορά, έναν QR κωδικό) και διαλέξτε ποια οθόνη δείχνει ποια.",
|
||||||
"style": "Ανάμεσα στις πωλήσεις, δείξε",
|
"style": "Ανάμεσα στις πωλήσεις, δείξε",
|
||||||
"styles": {
|
"styles": {
|
||||||
"name": {
|
"name": {
|
||||||
@@ -664,7 +664,7 @@
|
|||||||
"venueNameHint": "Εμφανίζεται στην οθόνη (και σε άλλες οθόνες).",
|
"venueNameHint": "Εμφανίζεται στην οθόνη (και σε άλλες οθόνες).",
|
||||||
"message": "Μια γραμμή κειμένου (προαιρετικά)",
|
"message": "Μια γραμμή κειμένου (προαιρετικά)",
|
||||||
"messageHint": "π.χ. \"Καλώς ήρθατε!\" ή \"Δωρεάν Wi-Fi: Taverna\"",
|
"messageHint": "π.χ. \"Καλώς ήρθατε!\" ή \"Δωρεάν Wi-Fi: Taverna\"",
|
||||||
"theme": "Εμφάνιση",
|
"theme": "Χρώματα",
|
||||||
"themes": {
|
"themes": {
|
||||||
"dark": "Σκούρα",
|
"dark": "Σκούρα",
|
||||||
"light": "Φωτεινή"
|
"light": "Φωτεινή"
|
||||||
@@ -678,11 +678,38 @@
|
|||||||
},
|
},
|
||||||
"qrUrl": "Σύνδεσμος",
|
"qrUrl": "Σύνδεσμος",
|
||||||
"qrCaption": "Κείμενο κάτω από τον κωδικό (προαιρετικά)",
|
"qrCaption": "Κείμενο κάτω από τον κωδικό (προαιρετικά)",
|
||||||
"pickLogo": "Διαλέξτε το λογότυπο",
|
"pickLogo": "Το λογότυπό σας",
|
||||||
"pickImage": "Διαλέξτε την εικόνα",
|
"pickImage": "Η εικόνα",
|
||||||
"pickSlides": "Διαλέξτε τις φωτογραφίες, με τη σειρά (ξανά πάτημα για αφαίρεση)",
|
"pickSlides": "Οι φωτογραφίες, με αυτή τη σειρά",
|
||||||
"upload": "Ανέβασμα εικόνων",
|
"addSlides": "Προσθήκη εικόνων",
|
||||||
"noImages": "Δεν υπάρχουν εικόνες: ανεβάστε (JPG, PNG, WebP ή GIF, έως 5 MB)."
|
"noSlides": "Δεν υπάρχουν φωτογραφίες ακόμα: προσθέστε από τη βιβλιοθήκη πολυμέσων.",
|
||||||
|
"earlier": "Νωρίτερα",
|
||||||
|
"later": "Αργότερα",
|
||||||
|
"looks": {
|
||||||
|
"title": "Εμφανίσεις",
|
||||||
|
"default": "προεπιλογή",
|
||||||
|
"isDefault": "Η προεπιλεγμένη εμφάνιση",
|
||||||
|
"makeDefault": "Ορισμός ως προεπιλογή",
|
||||||
|
"madeDefault": "Είναι πλέον η προεπιλεγμένη εμφάνιση.",
|
||||||
|
"screens_one": "{{count}} οθόνη",
|
||||||
|
"screens_other": "{{count}} οθόνες",
|
||||||
|
"new": "Νέα εμφάνιση",
|
||||||
|
"create": "Δημιουργία",
|
||||||
|
"created": "Η εμφάνιση δημιουργήθηκε.",
|
||||||
|
"name": "Όνομα εμφάνισης",
|
||||||
|
"namePlaceholder": "π.χ. Καλοκαιρινή προσφορά",
|
||||||
|
"taken": "Υπάρχει ήδη εμφάνιση με αυτό το όνομα.",
|
||||||
|
"copyOf": "Ξεκινήστε από αντίγραφο της «{{name}}»",
|
||||||
|
"unsaved": "Δεν έχει αποθηκευτεί",
|
||||||
|
"discard": "Αυτή η εμφάνιση έχει αλλαγές που δεν αποθηκεύτηκαν. Να φύγετε;",
|
||||||
|
"whichScreen": "Ποια οθόνη δείχνει ποια εμφάνιση",
|
||||||
|
"noScreens": "Δεν έχει συνδεθεί ακόμα οθόνη πελάτη (Συσκευές → Σύνδεση συσκευής).",
|
||||||
|
"followDefault": "Η προεπιλεγμένη εμφάνιση ({{name}})",
|
||||||
|
"lookFor": "Εμφάνιση της {{name}}",
|
||||||
|
"deleteTitle": "Διαγραφή «{{name}}»;",
|
||||||
|
"deleteBody": "Οι οθόνες που τη δείχνουν επιστρέφουν στην προεπιλεγμένη εμφάνιση ({{name}}). Οι εικόνες της μένουν στη βιβλιοθήκη πολυμέσων.",
|
||||||
|
"deleted": "Η εμφάνιση διαγράφηκε."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"calls": {
|
"calls": {
|
||||||
"title": "Αναγνώριση κλήσης",
|
"title": "Αναγνώριση κλήσης",
|
||||||
@@ -767,6 +794,8 @@
|
|||||||
"fromLibrary": "Από τη βιβλιοθήκη",
|
"fromLibrary": "Από τη βιβλιοθήκη",
|
||||||
"removePhoto": "Αφαίρεση",
|
"removePhoto": "Αφαίρεση",
|
||||||
"nameAfterProduct": "Ονομασία με το όνομα του προϊόντος",
|
"nameAfterProduct": "Ονομασία με το όνομα του προϊόντος",
|
||||||
"nameAfterCategory": "Ονομασία με το όνομα της κατηγορίας"
|
"nameAfterCategory": "Ονομασία με το όνομα της κατηγορίας",
|
||||||
|
"addChosen_one": "Προσθήκη {{count}} εικόνας",
|
||||||
|
"addChosen_other": "Προσθήκη {{count}} εικόνων"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -628,7 +628,7 @@
|
|||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"title": "Customer display",
|
"title": "Customer display",
|
||||||
"intro": "The screen facing your customers at the counter shows the sale and the total while you sell, and \"Thank you\" with the change after payment. Here you choose what it shows in between.",
|
"intro": "The screen facing your customers at the counter shows the sale and the total while you sell, and \"Thank you\" with the change after payment. In between it shows a look you design here. Make several looks (e.g. a menu promo, a QR code) and choose which display shows which.",
|
||||||
"style": "Between sales, show",
|
"style": "Between sales, show",
|
||||||
"styles": {
|
"styles": {
|
||||||
"name": {
|
"name": {
|
||||||
@@ -664,7 +664,7 @@
|
|||||||
"venueNameHint": "Shown on the display (and other screens).",
|
"venueNameHint": "Shown on the display (and other screens).",
|
||||||
"message": "A line of text (optional)",
|
"message": "A line of text (optional)",
|
||||||
"messageHint": "e.g. \"Welcome!\" or \"Free Wi-Fi: Taverna\"",
|
"messageHint": "e.g. \"Welcome!\" or \"Free Wi-Fi: Taverna\"",
|
||||||
"theme": "Look",
|
"theme": "Colours",
|
||||||
"themes": {
|
"themes": {
|
||||||
"dark": "Dark",
|
"dark": "Dark",
|
||||||
"light": "Light"
|
"light": "Light"
|
||||||
@@ -678,11 +678,38 @@
|
|||||||
},
|
},
|
||||||
"qrUrl": "Link",
|
"qrUrl": "Link",
|
||||||
"qrCaption": "Text under the code (optional)",
|
"qrCaption": "Text under the code (optional)",
|
||||||
"pickLogo": "Pick your logo",
|
"pickLogo": "Your logo",
|
||||||
"pickImage": "Pick the picture",
|
"pickImage": "The picture",
|
||||||
"pickSlides": "Pick the photos, in order (tap again to remove)",
|
"pickSlides": "The photos, in this order",
|
||||||
"upload": "Upload images",
|
"addSlides": "Add pictures",
|
||||||
"noImages": "No images yet: upload some (JPG, PNG, WebP or GIF, up to 5 MB)."
|
"noSlides": "No photos yet: add some from the media library.",
|
||||||
|
"earlier": "Earlier",
|
||||||
|
"later": "Later",
|
||||||
|
"looks": {
|
||||||
|
"title": "Looks",
|
||||||
|
"default": "default",
|
||||||
|
"isDefault": "The default look",
|
||||||
|
"makeDefault": "Make default",
|
||||||
|
"madeDefault": "Now the default look.",
|
||||||
|
"screens_one": "{{count}} display",
|
||||||
|
"screens_other": "{{count}} displays",
|
||||||
|
"new": "New look",
|
||||||
|
"create": "Create",
|
||||||
|
"created": "Look created.",
|
||||||
|
"name": "Name of the look",
|
||||||
|
"namePlaceholder": "e.g. Summer promo",
|
||||||
|
"taken": "There is already a look with this name.",
|
||||||
|
"copyOf": "Start from a copy of \"{{name}}\"",
|
||||||
|
"unsaved": "Not saved yet",
|
||||||
|
"discard": "This look has changes that aren't saved. Leave it anyway?",
|
||||||
|
"whichScreen": "Which display shows which look",
|
||||||
|
"noScreens": "No customer display is paired yet (Devices → Pair a device).",
|
||||||
|
"followDefault": "The default look ({{name}})",
|
||||||
|
"lookFor": "Look of {{name}}",
|
||||||
|
"deleteTitle": "Delete \"{{name}}\"?",
|
||||||
|
"deleteBody": "Displays showing it go back to the default look ({{name}}). Its pictures stay in the media library.",
|
||||||
|
"deleted": "Look deleted."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"calls": {
|
"calls": {
|
||||||
"title": "Caller ID",
|
"title": "Caller ID",
|
||||||
@@ -767,6 +794,8 @@
|
|||||||
"fromLibrary": "From the library",
|
"fromLibrary": "From the library",
|
||||||
"removePhoto": "Remove",
|
"removePhoto": "Remove",
|
||||||
"nameAfterProduct": "Name it after the product",
|
"nameAfterProduct": "Name it after the product",
|
||||||
"nameAfterCategory": "Name it after the category"
|
"nameAfterCategory": "Name it after the category",
|
||||||
|
"addChosen_one": "Add {{count}} picture",
|
||||||
|
"addChosen_other": "Add {{count}} pictures"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user