Adding draft to bible studies display in list and detail.

Adding draft to translation files.
This commit is contained in:
Julio Ruiz 2026-05-22 08:24:11 -05:00
parent c883975e33
commit 3424b22fcf
6 changed files with 33 additions and 5 deletions

View File

@ -50,6 +50,7 @@ interface DocumentDoc {
}
slug?: string
body?: string
draft?: boolean
[key: string]: unknown
}
@ -773,6 +774,10 @@ function highlightTextNodes(root: HTMLElement, terms: string[]): number {
<div class="flex flex-col gap-3 p-4 sm:px-6 border-b border-default shadow-sm z-10">
<div class="flex flex-wrap items-start justify-between gap-2">
<div class="flex flex-wrap items-center gap-x-4 gap-y-1 min-w-0">
<p v-if="document?.draft" class="text-sm text-highlighted flex items-center gap-1.5 shrink-0">
<UIcon name="ph:file-dashed" class="size-4 text-carpared" />
{{ $t('search.draft') }}
</p>
<p v-if="safeDate()" class="text-sm text-highlighted flex items-center gap-1.5 shrink-0">
<UIcon name="ph:calendar" class="size-4 text-green-600" />
{{ safeDate() }}

View File

@ -49,6 +49,7 @@ interface DocMeta {
country?: string
type?: string
slug?: string
draft?: string
}
export interface DocumentDoc extends DocMeta {
@ -188,7 +189,7 @@ async function fetchDocumentMeta(docIds: string[]) {
q: '*',
queryBy: 'title',
filterBy: `id:=[${unique.join(',')}]`,
includeFields: 'id,title,date,timestamp,place,city,state,country,type,slug',
includeFields: 'id,title,date,timestamp,place,city,state,country,type,slug,draft',
perPage: unique.length,
page: 1
}]
@ -320,7 +321,7 @@ async function runBrowse(page = 1, append = false) {
sortBy: 'timestamp:desc',
perPage: settings.pageSize,
page: typePage,
includeFields: 'id,title,date,timestamp,place,city,state,country,type,slug'
includeFields: 'id,title,date,timestamp,place,city,state,country,type,slug,draft'
}]
}
})
@ -675,11 +676,29 @@ function metaLocation(meta: DocMeta | undefined): string {
>
<div class="mb-1">
<p class="text-sm font-semibold line-clamp-2 text-highlighted ">
<UTooltip
:text="$t('search.draft')"
color="error"
>
<UIcon
name="ph-file-dashed"
v-if="group.meta?.draft"
class="bg-carpared"
/>
<!-- <UBadge
v-if="group.meta?.draft"
label="borrador"
variant="solid"
color="error"
size="xs"
class="text-white bg-carpared uppercase font-bold text-xs text-[10px]"
/> -->
</UTooltip>
{{ group.meta?.title || group.docId }}
</p>
</div>
<p class="flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2 text-xs mb-2 text-muted">
<p class="flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2 text-xs mb-2 text-muted justify-between">
<span
v-if="metaDate(group.meta)"
class="flex items-center gap-1"

View File

@ -16,6 +16,7 @@
"searching": "Searching...",
"tip": "Tip: wrap in \"quotes\" for exact phrase in that order.",
"publication": "Publication",
"draft": "Draft",
"country": "Country",
"state": "State",
"city": "City",

View File

@ -15,6 +15,7 @@
"searching": "Buscando...",
"tip": "Consejo: envuelve en \"comillas\" para frase exacta en ese orden.",
"publication": "Publicación",
"draft": "Borrador",
"country": "País",
"state": "Estado",
"city": "Ciudad",

View File

@ -13,7 +13,8 @@
},
"search": {
"placeholder": "Rechercher des activités",
"publication": "Publicación"
"publication": "Publicación",
"draft": ""
},
"locale": {
"en": "English",

View File

@ -14,6 +14,7 @@
"search": {
"placeholder": "Digite para pesquisar...",
"publication": "Publicação",
"draft": "Borrador",
"for": "Para",
"city": "Cidade",
"page": "Página",