mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-07 14:50:11 +00:00
Add request approval system and audiobook path template
Implements admin approval workflow for user requests with global and per-user auto-approve controls. Adds new request statuses ('awaiting_approval', 'denied'), related API endpoints, and UI for pending approvals. Introduces configurable audiobook organization path template with validation and preview in settings, updates database schema and migrations for new fields.
This commit is contained in:
@@ -411,16 +411,27 @@ export function AudiobookDetailsModal({
|
||||
'processing',
|
||||
'downloaded',
|
||||
'awaiting_import',
|
||||
'awaiting_approval',
|
||||
'denied',
|
||||
];
|
||||
if (
|
||||
isRequested &&
|
||||
requestStatus &&
|
||||
inProgressStatuses.includes(requestStatus)
|
||||
) {
|
||||
// Special text for 'downloaded' status (waiting for Plex scan)
|
||||
// Determine button text and styling based on status
|
||||
let buttonText;
|
||||
let buttonClass = 'w-full cursor-not-allowed opacity-75';
|
||||
|
||||
if (requestStatus === 'downloaded') {
|
||||
buttonText = 'Processing...';
|
||||
} else if (requestStatus === 'awaiting_approval') {
|
||||
buttonText = requestedByUsername
|
||||
? `Pending Approval (${requestedByUsername})`
|
||||
: 'Pending Approval';
|
||||
} else if (requestStatus === 'denied') {
|
||||
buttonText = 'Request Denied';
|
||||
buttonClass = 'w-full cursor-not-allowed opacity-75 bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-900/30';
|
||||
} else {
|
||||
buttonText = requestedByUsername
|
||||
? `Requested by ${requestedByUsername}`
|
||||
@@ -434,7 +445,7 @@ export function AudiobookDetailsModal({
|
||||
disabled={true}
|
||||
variant="primary"
|
||||
size="lg"
|
||||
className="w-full cursor-not-allowed opacity-75"
|
||||
className={buttonClass}
|
||||
>
|
||||
{buttonText}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user