Release 2025-05-25-ELtG
This commit is contained in:
@@ -2,13 +2,15 @@
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import { tv, type VariantProps } from 'tailwind-variants'
|
||||
|
||||
import { cn } from '../lib/cn'
|
||||
|
||||
import type { HTMLAttributes, Polymorphic } from 'astro/types'
|
||||
|
||||
type Props<Tag extends 'a' | 'button' | 'label' = 'button'> = Polymorphic<
|
||||
Required<Pick<HTMLAttributes<'label'>, Tag extends 'label' ? 'for' : never>> &
|
||||
VariantProps<typeof button> & {
|
||||
as: Tag
|
||||
label?: string
|
||||
label: string
|
||||
icon?: string
|
||||
endIcon?: string
|
||||
classNames?: {
|
||||
@@ -55,6 +57,7 @@ const button = tv({
|
||||
iconOnly: {
|
||||
true: {
|
||||
base: 'p-0',
|
||||
label: 'sr-only',
|
||||
},
|
||||
},
|
||||
color: {
|
||||
@@ -137,49 +140,49 @@ const button = tv({
|
||||
color: 'black',
|
||||
variant: 'faded',
|
||||
class: {
|
||||
base: 'border-night-300/30 bg-night-800/30 hover:bg-night-700/50 text-white/70 hover:text-white/90 focus-visible:ring-white/50',
|
||||
base: 'bg2night-800/15 hover:bg-night-700/30 border-current/30 text-white/70 hover:text-white/90 focus-visible:ring-white/50',
|
||||
},
|
||||
},
|
||||
{
|
||||
color: 'white',
|
||||
variant: 'faded',
|
||||
class: {
|
||||
base: 'border-day-300/30 bg-day-100/30 hover:bg-day-200/50 text-white/70 hover:text-white/90 focus-visible:ring-white/50',
|
||||
base: 'b2-day-100/15 hover:bg-day-200/30 border-current/30 text-white/70 hover:text-white/90 focus-visible:ring-white/50',
|
||||
},
|
||||
},
|
||||
{
|
||||
color: 'gray',
|
||||
variant: 'faded',
|
||||
class: {
|
||||
base: 'border-day-500/30 bg-day-400/30 hover:bg-day-500/50 text-day-300 hover:text-day-100 focus-visible:ring-white/50',
|
||||
base: 'b2-day-400/15 hover:bg-day-500/30 text-day-300 hover:text-day-100 border-current/30 focus-visible:ring-white/50',
|
||||
},
|
||||
},
|
||||
{
|
||||
color: 'success',
|
||||
variant: 'faded',
|
||||
class: {
|
||||
base: 'border-green-600/30 bg-green-500/30 text-green-300 hover:bg-green-500/50 hover:text-green-100',
|
||||
base: 'border-current/20 bg-green-500/15 text-green-300 hover:bg-green-500/30 hover:text-green-100',
|
||||
},
|
||||
},
|
||||
{
|
||||
color: 'danger',
|
||||
variant: 'faded',
|
||||
class: {
|
||||
base: 'border-red-600/30 bg-red-500/30 text-red-300 hover:bg-red-500/50 hover:text-red-100',
|
||||
base: 'border-current/20 bg-red-500/15 text-red-300 hover:bg-red-500/30 hover:text-red-100',
|
||||
},
|
||||
},
|
||||
{
|
||||
color: 'warning',
|
||||
variant: 'faded',
|
||||
class: {
|
||||
base: 'border-yellow-600/30 bg-yellow-500/30 text-yellow-300 hover:bg-yellow-500/50 hover:text-yellow-100',
|
||||
base: 'border-current/20 bg-yellow-500/15 text-yellow-300 hover:bg-yellow-500/30 hover:text-yellow-100',
|
||||
},
|
||||
},
|
||||
{
|
||||
color: 'info',
|
||||
variant: 'faded',
|
||||
class: {
|
||||
base: 'border-blue-600/30 bg-blue-500/30 text-blue-300 hover:bg-blue-500/50 hover:text-blue-100',
|
||||
base: 'border-current/20 bg-blue-500/15 text-blue-300 hover:bg-blue-500/30 hover:text-blue-100',
|
||||
},
|
||||
},
|
||||
// Shadow variants
|
||||
@@ -260,6 +263,7 @@ const {
|
||||
dataAstroReload,
|
||||
disabled,
|
||||
inlineIcon,
|
||||
iconOnly,
|
||||
...htmlProps
|
||||
} = Astro.props
|
||||
|
||||
@@ -268,13 +272,20 @@ const {
|
||||
icon: iconSlot,
|
||||
label: labelSlot,
|
||||
endIcon: endIconSlot,
|
||||
} = button({ size, color, variant, shadow, disabled, iconOnly: !label && !(!!icon && !!endIcon) })
|
||||
} = button({
|
||||
size,
|
||||
color,
|
||||
variant,
|
||||
shadow,
|
||||
disabled,
|
||||
iconOnly: iconOnly ?? (!label && !(!!icon && !!endIcon)),
|
||||
})
|
||||
|
||||
const ActualTag = disabled && Tag === 'a' ? 'span' : Tag
|
||||
---
|
||||
|
||||
<ActualTag
|
||||
class={base({ class: className })}
|
||||
class={base({ class: cn({ 'opacity-20 hover:opacity-50': disabled }, className) })}
|
||||
role={role ??
|
||||
(ActualTag === 'button' || ActualTag === 'label' || ActualTag === 'span' ? undefined : 'button')}
|
||||
aria-disabled={disabled}
|
||||
@@ -282,7 +293,7 @@ const ActualTag = disabled && Tag === 'a' ? 'span' : Tag
|
||||
{...htmlProps}
|
||||
>
|
||||
{!!icon && <Icon name={icon} class={iconSlot({ class: classNames?.icon })} is:inline={inlineIcon} />}
|
||||
{!!label && <span class={labelSlot({ class: classNames?.label })}>{label}</span>}
|
||||
<span class={labelSlot({ class: classNames?.label })}>{label}</span>
|
||||
{
|
||||
!!endIcon && (
|
||||
<Icon name={endIcon} class={endIconSlot({ class: classNames?.endIcon })} is:inline={inlineIcon}>
|
||||
|
||||
@@ -52,7 +52,7 @@ const { class: className, ...htmlProps } = Astro.props
|
||||
href={href}
|
||||
target={external ? '_blank' : undefined}
|
||||
rel={external ? 'noopener noreferrer' : undefined}
|
||||
class="text-day-500 dark:text-day-400 dark:hover:text-day-300 flex items-center gap-1 text-sm transition-colors hover:text-gray-700"
|
||||
class="text-day-500 flex items-center gap-1 text-sm transition-colors hover:text-gray-200 hover:underline"
|
||||
>
|
||||
<Icon name={icon} class="h-4 w-4" />
|
||||
{label}
|
||||
|
||||
@@ -40,6 +40,7 @@ const {
|
||||
hx-select={`#${searchResultsId}`}
|
||||
hx-push-url="true"
|
||||
hx-indicator="#search-indicator"
|
||||
hx-swap="outerHTML"
|
||||
data-services-filters-form
|
||||
data-default-verification-filter={options.verification
|
||||
.filter((verification) => verification.default)
|
||||
@@ -107,7 +108,7 @@ const {
|
||||
{
|
||||
options.categories?.map((category) => (
|
||||
<li data-show-always={category.showAlways ? '' : undefined}>
|
||||
<label class="flex cursor-pointer items-center space-x-2 text-sm text-white">
|
||||
<label class="flex cursor-pointer items-center gap-2 text-sm text-white">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="peer text-green-500"
|
||||
@@ -116,6 +117,7 @@ const {
|
||||
checked={category.checked}
|
||||
data-trigger-on-change
|
||||
/>
|
||||
<Icon name={category.icon} class="size-4" />
|
||||
<span class="peer-checked:font-bold">
|
||||
{category.name}
|
||||
<span class="text-day-500 font-normal">{category._count.services}</span>
|
||||
|
||||
@@ -205,6 +205,13 @@ const urlIfIncludingCommunity = urlWithParams(Astro.url, {
|
||||
inlineIcon={inlineIcons}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
as="a"
|
||||
href="/service-suggestion/new"
|
||||
label="Add service"
|
||||
icon="ri:add-line"
|
||||
inlineIcon={inlineIcons}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@@ -241,14 +248,18 @@ const urlIfIncludingCommunity = urlWithParams(Astro.url, {
|
||||
</>
|
||||
)
|
||||
}
|
||||
<div class="mt-4 text-center">
|
||||
<Button
|
||||
as="a"
|
||||
href="/service-suggestion/new"
|
||||
label="Add service"
|
||||
icon="ri:add-line"
|
||||
inlineIcon={inlineIcons}
|
||||
class="mx-auto"
|
||||
/>
|
||||
</div>
|
||||
{
|
||||
services && services.length > 0 && (
|
||||
<div class="mt-4 text-center">
|
||||
<Button
|
||||
as="a"
|
||||
href="/service-suggestion/new"
|
||||
label="Add service"
|
||||
icon="ri:add-line"
|
||||
inlineIcon={inlineIcons}
|
||||
class="mx-auto"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import type { MaybePromise } from 'astro/actions/runtime/utils.js'
|
||||
import type { z } from 'astro/zod'
|
||||
|
||||
type SpecialUserPermission = 'admin' | 'verified' | 'moderator'
|
||||
type SpecialUserPermission = 'admin' | 'moderator' | 'verified'
|
||||
type Permission = SpecialUserPermission | 'guest' | 'not-spammer' | 'user'
|
||||
|
||||
type ActionAPIContextWithUser = ActionAPIContext & {
|
||||
|
||||
@@ -206,7 +206,6 @@ You can contact via direct chat:
|
||||
|
||||
- [SimpleX Chat](https://simplex.chat/contact#/?v=2&smp=smp%3A%2F%2F0YuTwO05YJWS8rkjn9eLJDjQhFKvIYd8d4xG8X1blIU%3D%40smp8.simplex.im%2FcgKHYUYnpAIVoGb9lxb0qEMEpvYIvc1O%23%2F%3Fv%3D1-2%26dh%3DMCowBQYDK2VuAyEAIW_JSq8wOsLKG4Xv4O54uT2D_l8MJBYKQIFj1FjZpnU%253D%26srv%3Dbeccx4yfxxbvyhqypaavemqurytl6hozr47wfc7uuecacjqdvwpw2xid.onion)
|
||||
|
||||
|
||||
## Disclaimer
|
||||
|
||||
This website is strictly for informational purposes regarding privacy technology in the cryptocurrency space. We unequivocally condemn and do not endorse, support, or facilitate money laundering, terrorist financing, or any other illegal financial activities. The use of any information or service mentioned herein for such purposes is strictly prohibited and contrary to the core principles of this project.
|
||||
|
||||
@@ -143,9 +143,9 @@ if (toggleResult?.error) {
|
||||
}
|
||||
---
|
||||
|
||||
<BaseLayout pageTitle="Announcement Management" widthClassName="max-w-screen-xl">
|
||||
<BaseLayout pageTitle="Announcements" widthClassName="max-w-screen-xl">
|
||||
<div class="mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between">
|
||||
<h1 class="font-title text-2xl font-bold text-white">Announcement Management</h1>
|
||||
<h1 class="font-title text-2xl font-bold text-white">Announcements</h1>
|
||||
<div class="mt-2 flex items-center gap-4 sm:mt-0">
|
||||
<span class="text-sm text-zinc-400">{announcements.length} announcements</span>
|
||||
</div>
|
||||
@@ -193,12 +193,17 @@ if (toggleResult?.error) {
|
||||
<option value="active" selected={filters.status === 'active'}>Active</option>
|
||||
<option value="inactive" selected={filters.status === 'inactive'}>Inactive</option>
|
||||
</select>
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="inline-flex items-center rounded-r-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
<Icon name="ri:search-2-line" class="h-4 w-4" />
|
||||
</button>
|
||||
color="info"
|
||||
variant="solid"
|
||||
size="md"
|
||||
iconOnly
|
||||
icon="ri:search-2-line"
|
||||
label="Search"
|
||||
class="rounded-l-none"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -206,13 +211,16 @@ if (toggleResult?.error) {
|
||||
|
||||
<!-- Create New Announcement Form -->
|
||||
<div class="mb-6">
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
id="toggle-new-announcement-form"
|
||||
class="mb-4 inline-flex items-center rounded-md bg-green-600 px-4 py-2 text-sm font-medium text-white hover:bg-green-700 focus:ring-2 focus:ring-green-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
<Icon name="ri:add-line" class="mr-1 h-4 w-4" />
|
||||
Create New Announcement
|
||||
</button>
|
||||
color="success"
|
||||
variant="solid"
|
||||
size="md"
|
||||
icon="ri:add-line"
|
||||
label="Create"
|
||||
class="mb-4"
|
||||
/>
|
||||
|
||||
<div
|
||||
id="new-announcement-form"
|
||||
@@ -306,13 +314,16 @@ if (toggleResult?.error) {
|
||||
|
||||
<div class="pt-4">
|
||||
<InputSubmitButton label="Create Announcement" icon="ri:save-line" hideCancel />
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="button"
|
||||
id="cancel-create"
|
||||
class="ml-2 inline-flex items-center rounded-md border border-zinc-600 bg-zinc-800 px-4 py-2 text-sm font-medium text-zinc-300 hover:bg-zinc-700 focus:ring-2 focus:ring-zinc-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
color="gray"
|
||||
variant="faded"
|
||||
size="md"
|
||||
label="Cancel"
|
||||
class="ml-2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -339,19 +350,24 @@ if (toggleResult?.error) {
|
||||
<form method="POST" action={actions.admin.announcement.delete} id="delete-form">
|
||||
<input type="hidden" name="id" id="delete-id" />
|
||||
<div class="flex justify-end gap-2">
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="button"
|
||||
class="close-modal inline-flex items-center rounded-md border border-zinc-600 bg-zinc-800 px-4 py-2 text-sm font-medium text-zinc-300 hover:bg-zinc-700 focus:ring-2 focus:ring-zinc-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
class="close-modal"
|
||||
color="gray"
|
||||
variant="faded"
|
||||
size="md"
|
||||
label="Cancel"
|
||||
/>
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="inline-flex items-center rounded-md bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700 focus:ring-2 focus:ring-red-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
<Icon name="ri:delete-bin-line" class="mr-1 h-4 w-4" />
|
||||
Delete
|
||||
</button>
|
||||
color="danger"
|
||||
variant="solid"
|
||||
size="md"
|
||||
icon="ri:delete-bin-line"
|
||||
label="Delete"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -497,60 +513,64 @@ if (toggleResult?.error) {
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex justify-center gap-2">
|
||||
<Tooltip
|
||||
as="button"
|
||||
type="button"
|
||||
data-id={announcement.id}
|
||||
class="edit-button inline-flex items-center rounded-md border border-blue-500/50 bg-blue-500/20 px-1 py-1 text-xs text-blue-400 transition-colors hover:bg-blue-500/30"
|
||||
text="Edit"
|
||||
onclick={`document.getElementById('edit-announcement-form-${announcement.id}').classList.toggle('hidden')`}
|
||||
>
|
||||
<Icon name="ri:edit-line" class="size-4" />
|
||||
<Tooltip text="Edit">
|
||||
<Button
|
||||
as="button"
|
||||
type="button"
|
||||
data-id={announcement.id}
|
||||
class="edit-button"
|
||||
color="info"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:edit-line"
|
||||
label="Edit"
|
||||
onclick={`document.getElementById('edit-announcement-form-${announcement.id}').classList.toggle('hidden')`}
|
||||
/>
|
||||
</Tooltip>
|
||||
|
||||
<form
|
||||
method="POST"
|
||||
action={actions.admin.announcement.toggleActive}
|
||||
class="inline-block"
|
||||
data-confirm={`Are you sure you want to ${announcement.isActive ? 'deactivate' : 'activate'} this announcement?`}
|
||||
>
|
||||
<input type="hidden" name="id" value={announcement.id} />
|
||||
<input type="hidden" name="isActive" value={String(!announcement.isActive)} />
|
||||
<button
|
||||
type="submit"
|
||||
class={`rounded-md border px-1 py-1 text-xs transition-colors ${
|
||||
announcement.isActive
|
||||
? 'border-yellow-500/50 bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/30'
|
||||
: 'border-green-500/50 bg-green-500/20 text-green-400 hover:bg-green-500/30'
|
||||
}`}
|
||||
<Tooltip text={announcement.isActive ? 'Deactivate' : 'Activate'}>
|
||||
<form
|
||||
method="POST"
|
||||
action={actions.admin.announcement.toggleActive}
|
||||
class="inline-block"
|
||||
data-confirm={`Are you sure you want to ${announcement.isActive ? 'deactivate' : 'activate'} this announcement?`}
|
||||
>
|
||||
<Tooltip text={announcement.isActive ? 'Deactivate' : 'Activate'}>
|
||||
<Icon
|
||||
name={
|
||||
announcement.isActive ? 'ri:pause-circle-line' : 'ri:play-circle-line'
|
||||
}
|
||||
class="size-4"
|
||||
/>
|
||||
</Tooltip>
|
||||
</button>
|
||||
</form>
|
||||
<input type="hidden" name="id" value={announcement.id} />
|
||||
<input type="hidden" name="isActive" value={String(!announcement.isActive)} />
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
color={announcement.isActive ? 'warning' : 'success'}
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon={announcement.isActive ? 'ri:pause-circle-line' : 'ri:play-circle-line'}
|
||||
label={announcement.isActive ? 'Deactivate' : 'Activate'}
|
||||
/>
|
||||
</form>
|
||||
</Tooltip>
|
||||
|
||||
<form
|
||||
method="POST"
|
||||
action={actions.admin.announcement.delete}
|
||||
class="inline-block"
|
||||
data-confirm="Are you sure you want to delete this announcement?"
|
||||
>
|
||||
<input type="hidden" name="id" value={announcement.id} />
|
||||
<button
|
||||
type="submit"
|
||||
class="rounded-md border border-red-500/50 bg-red-500/20 px-1 py-1 text-xs text-red-400 transition-colors hover:bg-red-500/30"
|
||||
<Tooltip text="Delete">
|
||||
<form
|
||||
method="POST"
|
||||
action={actions.admin.announcement.delete}
|
||||
class="inline-block"
|
||||
data-confirm="Are you sure you want to delete this announcement?"
|
||||
>
|
||||
<Tooltip text="Delete">
|
||||
<Icon name="ri:delete-bin-line" class="size-4" />
|
||||
</Tooltip>
|
||||
</button>
|
||||
</form>
|
||||
<input type="hidden" name="id" value={announcement.id} />
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
color="danger"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:delete-bin-line"
|
||||
label="Delete"
|
||||
/>
|
||||
</form>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -648,9 +668,12 @@ if (toggleResult?.error) {
|
||||
<div class="pt-4">
|
||||
<InputSubmitButton label="Save Changes" icon="ri:save-line" hideCancel />
|
||||
<Button
|
||||
as="button"
|
||||
type="button"
|
||||
label="Cancel"
|
||||
color="gray"
|
||||
variant="faded"
|
||||
size="md"
|
||||
onclick={`document.getElementById('edit-announcement-form-${announcement.id}').classList.toggle('hidden')`}
|
||||
class="ml-2"
|
||||
/>
|
||||
|
||||
@@ -5,7 +5,9 @@ import { actions, isInputError } from 'astro:actions'
|
||||
import { z } from 'astro:content'
|
||||
import { orderBy as lodashOrderBy } from 'lodash-es'
|
||||
|
||||
import Button from '../../components/Button.astro'
|
||||
import SortArrowIcon from '../../components/SortArrowIcon.astro'
|
||||
import Tooltip from '../../components/Tooltip.astro'
|
||||
import { getAttributeCategoryInfo } from '../../constants/attributeCategories'
|
||||
import { getAttributeTypeInfo } from '../../constants/attributeTypes'
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro'
|
||||
@@ -136,14 +138,15 @@ const makeSortUrl = (slug: NonNullable<(typeof filters)['sort-by']>) => {
|
||||
<h1 class="font-title text-2xl font-bold text-white">Attribute Management</h1>
|
||||
<div class="mt-2 flex items-center gap-4 sm:mt-0">
|
||||
<span class="text-sm text-zinc-400">{attributeCount} attributes</span>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-2 rounded-md bg-green-600 px-4 py-2 text-sm font-medium text-white hover:bg-green-700 focus:ring-2 focus:ring-green-500 focus:ring-offset-2 focus:outline-none"
|
||||
<Button
|
||||
as="button"
|
||||
color="success"
|
||||
variant="solid"
|
||||
size="md"
|
||||
icon="ri:add-line"
|
||||
label="New Attribute"
|
||||
onclick="document.getElementById('create-attribute-form').classList.toggle('hidden')"
|
||||
>
|
||||
<Icon name="ri:add-line" class="size-4" />
|
||||
<span>New Attribute</span>
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -286,12 +289,15 @@ const makeSortUrl = (slug: NonNullable<(typeof filters)['sort-by']>) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="w-full rounded-md bg-green-600 py-2 text-sm font-medium text-white hover:bg-green-700 focus:ring-2 focus:ring-green-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
Create Attribute
|
||||
</button>
|
||||
color="success"
|
||||
variant="solid"
|
||||
size="md"
|
||||
label="Create Attribute"
|
||||
class="w-full"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -343,12 +349,17 @@ const makeSortUrl = (slug: NonNullable<(typeof filters)['sort-by']>) => {
|
||||
))
|
||||
}
|
||||
</select>
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="inline-flex items-center rounded-r-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
<Icon name="ri:search-2-line" class="h-4 w-4" />
|
||||
</button>
|
||||
color="info"
|
||||
variant="solid"
|
||||
size="md"
|
||||
iconOnly
|
||||
icon="ri:search-2-line"
|
||||
label="Search"
|
||||
class="rounded-l-none"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -519,25 +530,34 @@ const makeSortUrl = (slug: NonNullable<(typeof filters)['sort-by']>) => {
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<div class="flex justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center justify-center rounded-md border border-blue-500/50 bg-blue-500/20 p-1.5 text-blue-400 transition-colors hover:bg-blue-500/30 focus:outline-none"
|
||||
onclick={`document.getElementById('edit-form-${index}').classList.toggle('hidden')`}
|
||||
title="Edit attribute"
|
||||
>
|
||||
<Icon name="ri:edit-line" class="size-3.5" />
|
||||
</button>
|
||||
<form method="POST" action={actions.admin.attribute.delete} class="inline-block">
|
||||
<input type="hidden" name="id" value={attribute.id} />
|
||||
<button
|
||||
type="submit"
|
||||
class="inline-flex items-center justify-center rounded-md border border-red-500/50 bg-red-500/20 p-1.5 text-red-400 transition-colors hover:bg-red-500/30 focus:outline-none"
|
||||
onclick="return confirm('Are you sure you want to delete this attribute?')"
|
||||
title="Delete attribute"
|
||||
>
|
||||
<Icon name="ri:delete-bin-line" class="size-3.5" />
|
||||
</button>
|
||||
</form>
|
||||
<Tooltip text="Edit">
|
||||
<Button
|
||||
as="button"
|
||||
color="info"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:edit-line"
|
||||
label="Edit"
|
||||
onclick={`document.getElementById('edit-form-${index}').classList.toggle('hidden')`}
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip text="Delete">
|
||||
<form method="POST" action={actions.admin.attribute.delete} class="inline-block">
|
||||
<input type="hidden" name="id" value={attribute.id} />
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
color="danger"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:delete-bin-line"
|
||||
label="Delete"
|
||||
onclick="return confirm('Are you sure you want to delete this attribute?')"
|
||||
/>
|
||||
</form>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -673,19 +693,23 @@ const makeSortUrl = (slug: NonNullable<(typeof filters)['sort-by']>) => {
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end space-x-3">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-md border border-zinc-600 bg-zinc-800 px-3 py-2 text-sm font-medium text-zinc-300 hover:bg-zinc-700 focus:outline-none"
|
||||
<Button
|
||||
as="button"
|
||||
color="gray"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
label="Cancel"
|
||||
onclick={`document.getElementById('edit-form-${index}').classList.toggle('hidden')`}
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
/>
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="rounded-md bg-blue-600 px-3 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
Save Changes
|
||||
</button>
|
||||
color="info"
|
||||
variant="solid"
|
||||
size="sm"
|
||||
icon="ri:save-line"
|
||||
label="Save"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import { actions } from 'astro:actions'
|
||||
|
||||
import Button from '../../../components/Button.astro'
|
||||
import Chat from '../../../components/Chat.astro'
|
||||
import ServiceCard from '../../../components/ServiceCard.astro'
|
||||
import UserBadge from '../../../components/UserBadge.astro'
|
||||
import { getServiceSuggestionStatusInfo } from '../../../constants/serviceSuggestionStatus'
|
||||
import {
|
||||
getServiceSuggestionStatusInfo,
|
||||
serviceSuggestionStatuses,
|
||||
} from '../../../constants/serviceSuggestionStatus'
|
||||
import BaseLayout from '../../../layouts/BaseLayout.astro'
|
||||
import { cn } from '../../../lib/cn'
|
||||
import { parseIntWithFallback } from '../../../lib/numbers'
|
||||
@@ -96,13 +100,15 @@ const statusInfo = getServiceSuggestionStatusInfo(serviceSuggestion.status)
|
||||
widthClassName="max-w-screen-md"
|
||||
>
|
||||
<div class="mb-4 flex items-center gap-4">
|
||||
<a
|
||||
<Button
|
||||
as="a"
|
||||
href="/admin/service-suggestions"
|
||||
class="font-title inline-flex items-center justify-center rounded-md border border-green-500/30 bg-green-500/10 px-3 py-2 text-sm text-green-400 shadow-xs transition-colors duration-200 hover:bg-green-500/20 focus:ring-2 focus:ring-green-500 focus:ring-offset-2 focus:ring-offset-black focus:outline-hidden"
|
||||
>
|
||||
<Icon name="ri:arrow-left-s-line" class="mr-1 size-4" />
|
||||
Back
|
||||
</a>
|
||||
color="success"
|
||||
variant="faded"
|
||||
size="md"
|
||||
icon="ri:arrow-left-s-line"
|
||||
label="Back"
|
||||
/>
|
||||
|
||||
<h1 class="font-title text-xl text-green-500">Service Suggestion</h1>
|
||||
</div>
|
||||
@@ -170,17 +176,23 @@ const statusInfo = getServiceSuggestionStatusInfo(serviceSuggestion.status)
|
||||
name="status"
|
||||
class="font-title w-full rounded-md border border-green-500/30 bg-black/50 p-2 text-sm text-gray-300 placeholder-gray-500 focus:border-green-500 focus:ring-green-500 disabled:opacity-50"
|
||||
>
|
||||
<option value="PENDING" selected={serviceSuggestion.status === 'PENDING'}> Pending </option>
|
||||
<option value="APPROVED" selected={serviceSuggestion.status === 'APPROVED'}> Approve </option>
|
||||
<option value="REJECTED" selected={serviceSuggestion.status === 'REJECTED'}> Reject </option>
|
||||
<option value="WITHDRAWN" selected={serviceSuggestion.status === 'WITHDRAWN'}> Withdrawn </option>
|
||||
{
|
||||
serviceSuggestionStatuses.map((status) => (
|
||||
<option value={status.value} selected={serviceSuggestion.status === status.value}>
|
||||
{status.label}
|
||||
</option>
|
||||
))
|
||||
}
|
||||
</select>
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="font-title inline-flex items-center justify-center rounded-md border border-green-500/30 bg-green-500/10 px-4 py-2 text-sm text-green-400 shadow-xs transition-colors duration-200 hover:bg-green-500/20 focus:ring-2 focus:ring-green-500 focus:ring-offset-2 focus:ring-offset-black focus:outline-hidden"
|
||||
>
|
||||
<Icon name="ri:save-line" class="mr-1 size-4" /> Update
|
||||
</button>
|
||||
color="success"
|
||||
variant="faded"
|
||||
size="md"
|
||||
icon="ri:save-line"
|
||||
label="Update"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@ import { actions } from 'astro:actions'
|
||||
import { z } from 'astro:content'
|
||||
import { orderBy } from 'lodash-es'
|
||||
|
||||
import Button from '../../../components/Button.astro'
|
||||
import SortArrowIcon from '../../../components/SortArrowIcon.astro'
|
||||
import TimeFormatted from '../../../components/TimeFormatted.astro'
|
||||
import Tooltip from '../../../components/Tooltip.astro'
|
||||
import UserBadge from '../../../components/UserBadge.astro'
|
||||
import {
|
||||
getServiceSuggestionStatusInfo,
|
||||
@@ -183,12 +185,16 @@ const makeSortUrl = (slug: string) => {
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex items-end">
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="inline-flex items-center rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
<Icon name="ri:search-2-line" class="h-4 w-4" />
|
||||
</button>
|
||||
color="info"
|
||||
variant="solid"
|
||||
size="md"
|
||||
iconOnly
|
||||
icon="ri:search-2-line"
|
||||
label="Search"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -317,13 +323,18 @@ const makeSortUrl = (slug: string) => {
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<div class="flex justify-end gap-1">
|
||||
<a
|
||||
href={`/admin/service-suggestions/${suggestion.id}`}
|
||||
class="inline-flex items-center justify-center rounded-full border border-green-500/40 bg-green-500/10 p-1.5 text-green-400 shadow-xs transition-colors duration-200 hover:bg-green-500/20 focus:ring-2 focus:ring-green-500 focus:ring-offset-2 focus:ring-offset-black focus:outline-hidden"
|
||||
title="View"
|
||||
>
|
||||
<Icon name="ri:external-link-line" class="size-4" />
|
||||
</a>
|
||||
<Tooltip text="Manage">
|
||||
<Button
|
||||
as="a"
|
||||
href={`/admin/service-suggestions/${suggestion.id}`}
|
||||
color="success"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:arrow-right-line"
|
||||
label="Manage"
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -27,46 +27,54 @@ import { eventTypes, getEventTypeInfo } from '../../../../constants/eventTypes'
|
||||
import { kycLevels } from '../../../../constants/kycLevels'
|
||||
import { serviceVisibilities } from '../../../../constants/serviceVisibility'
|
||||
import { verificationStatuses } from '../../../../constants/verificationStatus'
|
||||
import { getVerificationStepStatusInfo } from '../../../../constants/verificationStepStatus'
|
||||
import {
|
||||
getVerificationStepStatusInfo,
|
||||
verificationStepStatuses,
|
||||
} from '../../../../constants/verificationStepStatus'
|
||||
import BaseLayout from '../../../../layouts/BaseLayout.astro'
|
||||
import { pluralize } from '../../../../lib/pluralize'
|
||||
import { prisma } from '../../../../lib/prisma'
|
||||
|
||||
const { slug } = Astro.params
|
||||
|
||||
const serviceResult = Astro.getActionResult(actions.admin.service.update)
|
||||
const eventCreateResult = Astro.getActionResult(actions.admin.event.create)
|
||||
const eventToggleResult = Astro.getActionResult(actions.admin.event.toggle)
|
||||
const eventDeleteResult = Astro.getActionResult(actions.admin.event.delete)
|
||||
const eventUpdateResult = Astro.getActionResult(actions.admin.event.update)
|
||||
const verificationStepCreateResult = Astro.getActionResult(actions.admin.verificationStep.create)
|
||||
const verificationStepUpdateResult = Astro.getActionResult(actions.admin.verificationStep.update)
|
||||
const verificationStepDeleteResult = Astro.getActionResult(actions.admin.verificationStep.delete)
|
||||
if (!slug) return Astro.rewrite('/404')
|
||||
|
||||
const serviceResult = Astro.getActionResult(actions.admin.service.update)
|
||||
Astro.locals.banners.addIfSuccess(serviceResult, 'Service updated successfully')
|
||||
Astro.locals.banners.addIfSuccess(eventCreateResult, 'Event created successfully')
|
||||
Astro.locals.banners.addIfSuccess(eventToggleResult, 'Event visibility updated successfully')
|
||||
Astro.locals.banners.addIfSuccess(eventDeleteResult, 'Event deleted successfully')
|
||||
Astro.locals.banners.addIfSuccess(eventUpdateResult, 'Event updated successfully')
|
||||
Astro.locals.banners.addIfSuccess(verificationStepCreateResult, 'Verification step added successfully')
|
||||
Astro.locals.banners.addIfSuccess(verificationStepUpdateResult, 'Verification step updated successfully')
|
||||
Astro.locals.banners.addIfSuccess(verificationStepDeleteResult, 'Verification step deleted successfully')
|
||||
const serviceInputErrors = isInputError(serviceResult?.error) ? serviceResult.error.fields : {}
|
||||
|
||||
if (serviceResult && !serviceResult.error && slug !== serviceResult.data.service.slug) {
|
||||
return Astro.redirect(`/admin/services/${serviceResult.data.service.slug}/edit`)
|
||||
}
|
||||
|
||||
const serviceInputErrors = isInputError(serviceResult?.error) ? serviceResult.error.fields : {}
|
||||
const eventCreateResult = Astro.getActionResult(actions.admin.event.create)
|
||||
Astro.locals.banners.addIfSuccess(eventCreateResult, 'Event created successfully')
|
||||
const eventInputErrors = isInputError(eventCreateResult?.error) ? eventCreateResult.error.fields : {}
|
||||
|
||||
const eventUpdateResult = Astro.getActionResult(actions.admin.event.update)
|
||||
Astro.locals.banners.addIfSuccess(eventUpdateResult, 'Event updated successfully')
|
||||
const eventUpdateInputErrors = isInputError(eventUpdateResult?.error) ? eventUpdateResult.error.fields : {}
|
||||
|
||||
const eventToggleResult = Astro.getActionResult(actions.admin.event.toggle)
|
||||
Astro.locals.banners.addIfSuccess(eventToggleResult, 'Event visibility updated successfully')
|
||||
|
||||
const eventDeleteResult = Astro.getActionResult(actions.admin.event.delete)
|
||||
Astro.locals.banners.addIfSuccess(eventDeleteResult, 'Event deleted successfully')
|
||||
|
||||
const verificationStepCreateResult = Astro.getActionResult(actions.admin.verificationStep.create)
|
||||
Astro.locals.banners.addIfSuccess(verificationStepCreateResult, 'Verification step added successfully')
|
||||
const verificationStepInputErrors = isInputError(verificationStepCreateResult?.error)
|
||||
? verificationStepCreateResult.error.fields
|
||||
: {}
|
||||
|
||||
const verificationStepUpdateResult = Astro.getActionResult(actions.admin.verificationStep.update)
|
||||
Astro.locals.banners.addIfSuccess(verificationStepUpdateResult, 'Verification step updated successfully')
|
||||
const verificationStepUpdateInputErrors = isInputError(verificationStepUpdateResult?.error)
|
||||
? verificationStepUpdateResult.error.fields
|
||||
: {}
|
||||
|
||||
if (!slug) return Astro.rewrite('/404')
|
||||
const verificationStepDeleteResult = Astro.getActionResult(actions.admin.verificationStep.delete)
|
||||
Astro.locals.banners.addIfSuccess(verificationStepDeleteResult, 'Verification step deleted successfully')
|
||||
|
||||
const [service, categories, attributes] = await Astro.locals.banners.tryMany([
|
||||
[
|
||||
@@ -715,7 +723,7 @@ if (!service) return Astro.rewrite('/404')
|
||||
<InputSelect
|
||||
label="Status"
|
||||
name="status"
|
||||
options={verificationStatuses.map((status) => ({
|
||||
options={verificationStepStatuses.map((status) => ({
|
||||
label: status.label,
|
||||
value: status.value,
|
||||
}))}
|
||||
@@ -763,7 +771,7 @@ if (!service) return Astro.rewrite('/404')
|
||||
<InputSelect
|
||||
label="Status"
|
||||
name="status"
|
||||
options={verificationStatuses.map((status) => ({
|
||||
options={verificationStepStatuses.map((status) => ({
|
||||
label: status.label,
|
||||
value: status.value,
|
||||
}))}
|
||||
|
||||
@@ -3,8 +3,10 @@ import { ServiceVisibility, VerificationStatus, type Prisma } from '@prisma/clie
|
||||
import { z } from 'astro/zod'
|
||||
import { Icon } from 'astro-icon/components'
|
||||
|
||||
import Button from '../../../components/Button.astro'
|
||||
import MyPicture from '../../../components/MyPicture.astro'
|
||||
import SortArrowIcon from '../../../components/SortArrowIcon.astro'
|
||||
import Tooltip from '../../../components/Tooltip.astro'
|
||||
import { getKycLevelInfo } from '../../../constants/kycLevels'
|
||||
import { getVerificationStatusInfo } from '../../../constants/verificationStatus'
|
||||
import BaseLayout from '../../../layouts/BaseLayout.astro'
|
||||
@@ -171,13 +173,15 @@ const truncate = (text: string, length: number) => {
|
||||
<h1 class="font-title text-2xl font-bold text-white">Service Management</h1>
|
||||
<div class="mt-2 flex items-center gap-4 sm:mt-0">
|
||||
<span class="text-sm text-zinc-400">{totalServicesCount} services</span>
|
||||
<a
|
||||
<Button
|
||||
as="a"
|
||||
href="/admin/services/new"
|
||||
class="inline-flex items-center gap-2 rounded-md bg-green-600 px-4 py-2 text-sm font-medium text-white hover:bg-green-700 focus:ring-2 focus:ring-green-500 focus:ring-offset-2 focus:outline-none"
|
||||
>
|
||||
<Icon name="ri:add-line" class="size-4" />
|
||||
<span>New Service</span>
|
||||
</a>
|
||||
color="success"
|
||||
variant="solid"
|
||||
size="md"
|
||||
icon="ri:add-line"
|
||||
label="New Service"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -250,12 +254,17 @@ const truncate = (text: string, length: number) => {
|
||||
))
|
||||
}
|
||||
</select>
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="ml-2 inline-flex items-center rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
<Icon name="ri:search-2-line" class="h-4 w-4" />
|
||||
</button>
|
||||
color="info"
|
||||
variant="solid"
|
||||
size="md"
|
||||
iconOnly
|
||||
icon="ri:search-2-line"
|
||||
label="Search"
|
||||
class="ml-2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -437,20 +446,30 @@ const truncate = (text: string, length: number) => {
|
||||
<td class="px-4 py-3 text-center text-xs text-zinc-400">{service.formattedDate}</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<div class="flex justify-end space-x-2">
|
||||
<a
|
||||
href={`/service/${service.slug}`}
|
||||
target="_blank"
|
||||
class="inline-flex items-center rounded-md border border-zinc-600 bg-zinc-800 px-2 py-1 text-xs text-zinc-300 transition-colors hover:bg-zinc-700"
|
||||
title="View on site"
|
||||
>
|
||||
<Icon name="ri:external-link-line" class="size-3.5" />
|
||||
</a>
|
||||
<a
|
||||
href={`/admin/services/${service.slug}/edit`}
|
||||
class="inline-flex items-center rounded-md border border-blue-500/50 bg-blue-500/20 px-2 py-1 text-xs text-blue-400 transition-colors hover:bg-blue-500/30"
|
||||
>
|
||||
Edit
|
||||
</a>
|
||||
<Tooltip text="View">
|
||||
<Button
|
||||
as="a"
|
||||
href={`/service/${service.slug}`}
|
||||
color="success"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:global-line"
|
||||
label="View"
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip text="Edit">
|
||||
<Button
|
||||
as="a"
|
||||
href={`/admin/services/${service.slug}/edit`}
|
||||
color="info"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:edit-line"
|
||||
label="Edit"
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Icon } from 'astro-icon/components'
|
||||
import { z } from 'astro:content'
|
||||
import { orderBy as lodashOrderBy } from 'lodash-es'
|
||||
|
||||
import Button from '../../../components/Button.astro'
|
||||
import SortArrowIcon from '../../../components/SortArrowIcon.astro'
|
||||
import TimeFormatted from '../../../components/TimeFormatted.astro'
|
||||
import Tooltip from '../../../components/Tooltip.astro'
|
||||
@@ -151,12 +152,17 @@ const makeSortUrl = (sortBy: NonNullable<(typeof filters)['sort-by']>) => {
|
||||
<option value="verified" selected={filters.role === 'verified'}>Verified Users</option>
|
||||
<option value="spammer" selected={filters.role === 'spammer'}>Spammers</option>
|
||||
</select>
|
||||
<button
|
||||
<Button
|
||||
as="button"
|
||||
type="submit"
|
||||
class="inline-flex items-center rounded-r-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-zinc-900 focus:outline-none"
|
||||
>
|
||||
<Icon name="ri:search-2-line" class="h-4 w-4" />
|
||||
</button>
|
||||
color="info"
|
||||
variant="solid"
|
||||
size="md"
|
||||
iconOnly
|
||||
icon="ri:search-2-line"
|
||||
label="Search"
|
||||
class="rounded-l-none"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -320,30 +326,43 @@ const makeSortUrl = (sortBy: NonNullable<(typeof filters)['sort-by']>) => {
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex justify-center gap-2">
|
||||
<Tooltip
|
||||
as="a"
|
||||
href={`/account/impersonate?targetUserId=${user.id}&redirect=/account`}
|
||||
data-astro-prefetch="tap"
|
||||
class="inline-flex items-center rounded-md border border-orange-500/50 bg-orange-500/20 px-1 py-1 text-xs text-orange-400 transition-colors hover:bg-orange-500/30"
|
||||
text="Impersonate"
|
||||
>
|
||||
<Icon name="ri:spy-line" class="size-4" />
|
||||
<Tooltip text="Impersonate">
|
||||
<Button
|
||||
as="a"
|
||||
href={`/account/impersonate?targetUserId=${user.id}&redirect=/account`}
|
||||
data-astro-prefetch="tap"
|
||||
color="warning"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:spy-line"
|
||||
label="Impersonate"
|
||||
disabled={user.admin}
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
as="a"
|
||||
href={`/admin/users/${user.name}`}
|
||||
class="inline-flex items-center rounded-md border border-blue-500/50 bg-blue-500/20 px-1 py-1 text-xs text-blue-400 transition-colors hover:bg-blue-500/30"
|
||||
text="Edit"
|
||||
>
|
||||
<Icon name="ri:edit-line" class="size-4" />
|
||||
<Tooltip text="Edit">
|
||||
<Button
|
||||
as="a"
|
||||
href={`/admin/users/${user.name}`}
|
||||
color="info"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:edit-line"
|
||||
label="Edit"
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
as="a"
|
||||
href={`/u/${user.name}`}
|
||||
class="inline-flex items-center rounded-md border border-green-500/50 bg-green-500/20 px-1 py-1 text-xs text-green-400 transition-colors hover:bg-green-500/30"
|
||||
text="Public profile"
|
||||
>
|
||||
<Icon name="ri:global-line" class="size-4" />
|
||||
<Tooltip text="Public profile">
|
||||
<Button
|
||||
as="a"
|
||||
href={`/u/${user.name}`}
|
||||
color="success"
|
||||
variant="faded"
|
||||
size="sm"
|
||||
iconOnly
|
||||
icon="ri:global-line"
|
||||
label="Public profile"
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -322,7 +322,11 @@ const [categories, [services, totalServices], countCommunityOnly, attributes] =
|
||||
icon: true,
|
||||
_count: {
|
||||
select: {
|
||||
services: true,
|
||||
services: {
|
||||
where: {
|
||||
serviceVisibility: 'PUBLIC',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -530,6 +534,7 @@ const showFiltersId = 'show-filters'
|
||||
hx-trigger="input delay:500ms, keyup[key=='Enter']"
|
||||
hx-target={`#${searchResultsId}`}
|
||||
hx-select={`#${searchResultsId}`}
|
||||
hx-swap="outerHTML"
|
||||
hx-push-url="true"
|
||||
hx-indicator="#search-indicator"
|
||||
class="contents"
|
||||
|
||||
Reference in New Issue
Block a user