Make CMS rows clickable
This commit is contained in:
parent
08cb99615f
commit
6da69b57c7
2 changed files with 7 additions and 4 deletions
|
|
@ -19,6 +19,7 @@ interface CategoryRow {
|
|||
}
|
||||
|
||||
const toast = useToast()
|
||||
const router = useRouter()
|
||||
|
||||
const { data, pending, error, refresh } = await useFetch<{ rows: CategoryRow[] }>(
|
||||
'/api/admin/categories',
|
||||
|
|
@ -102,7 +103,8 @@ async function confirmDelete() {
|
|||
<tr
|
||||
v-for="row in data.rows"
|
||||
:key="row.id"
|
||||
class="border-t border-(--ui-border) hover:bg-(--ui-bg-elevated)"
|
||||
class="border-t border-(--ui-border) hover:bg-(--ui-bg-elevated) cursor-pointer"
|
||||
@click="router.push(`/admin/pages/categories/${row.id}`)"
|
||||
>
|
||||
<td class="px-3 py-2">{{ englishName(row) }}</td>
|
||||
<td class="px-3 py-2 font-mono">{{ row.slug }}</td>
|
||||
|
|
@ -124,7 +126,7 @@ async function confirmDelete() {
|
|||
{{ row.page_count }}
|
||||
</UBadge>
|
||||
</td>
|
||||
<td class="px-3 py-2 text-right">
|
||||
<td class="px-3 py-2 text-right" @click.stop>
|
||||
<div class="flex justify-end gap-1">
|
||||
<UButton
|
||||
size="xs"
|
||||
|
|
|
|||
|
|
@ -222,7 +222,8 @@ const filteredRows = computed<PageRow[]>(() => {
|
|||
<tr
|
||||
v-for="row in filteredRows"
|
||||
:key="row.id"
|
||||
class="border-t border-(--ui-border) hover:bg-(--ui-bg-elevated)"
|
||||
class="border-t border-(--ui-border) hover:bg-(--ui-bg-elevated) cursor-pointer"
|
||||
@click="router.push(`/admin/pages/${row.id}`)"
|
||||
>
|
||||
<td class="px-3 py-2">
|
||||
<span v-if="row.title_en">{{ row.title_en }}</span>
|
||||
|
|
@ -239,7 +240,7 @@ const filteredRows = computed<PageRow[]>(() => {
|
|||
</UBadge>
|
||||
</td>
|
||||
<td class="px-3 py-2 text-(--ui-text-muted)">{{ formatDate(row.updated) }}</td>
|
||||
<td class="px-3 py-2 text-right">
|
||||
<td class="px-3 py-2 text-right" @click.stop>
|
||||
<UButton
|
||||
size="xs"
|
||||
variant="outline"
|
||||
|
|
|
|||
Loading…
Reference in a new issue