Adds book deletion and restore to the web client.

Soft deletes books so the scan keeps their paths reserved, lists the deleted books on a themed page, and lets the user restore them. Updates the API, bundled themes, localization, documentation and tests.

Closes #213
This commit is contained in:
BinaryAlley committed 2026-11-13 18:00:00 +02:00
1 parent ef5ede6325
commit f26b07d4ff
125 files changed
+9856 -378

No files matched your search

@@ -0,0 +1,27 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Data transfer object for a book that the user deleted and can restore.
/// </summary>
/// <param name="Id">The Id of the deleted book.</param>
/// <param name="LibraryId">The Id of the media library the deleted book belongs to.</param>
/// <param name="Title">The title of the deleted book.</param>
/// <param name="OriginalTitle">The original title of the deleted book, when it differs from the current one.</param>
/// <param name="Path">The file system path of the deleted book.</param>
/// <param name="DeletedOnUtc">The date and time when the book was deleted.</param>
/// <param name="CoverPath">The relative path of the stored cover image of the deleted book, when it has one.</param>
[DebuggerDisplay("Title: {Title}")]
public sealed record DeletedBookDto(
Guid Id,
Guid LibraryId,
string Title,
string? OriginalTitle,
string Path,
DateTime DeletedOnUtc,
string? CoverPath
);
@@ -0,0 +1,16 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.Libraries;
using System.Collections.Generic;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
/// <summary>
/// Data transfer object carrying the data needed by the deleted items page of a book library.
/// </summary>
/// <param name="Library">The media library whose deleted books are shown.</param>
/// <param name="DeletedBooks">The deleted books of the media library, ordered by the time they were deleted, most recent first.</param>
public sealed record DeletedBooksPageDto(
LibraryDto Library,
IReadOnlyList<DeletedBookDto> DeletedBooks
);
@@ -13,6 +13,9 @@ public static partial class ApiRoutes
public const string GET_BOOKS_LITE = "libraries/{libraryId}/books/lite";
public const string GET_BOOK = "libraries/{libraryId}/books/{bookId}";
public const string UPDATE_BOOK = "libraries/{libraryId}/books/{bookId}";
public const string DELETE_BOOK = "libraries/{libraryId}/books/{bookId}";
public const string GET_DELETED_BOOKS = "libraries/{libraryId}/books/deleted-items";
public const string RESTORE_BOOK = "libraries/{libraryId}/books/{bookId}/restore";
public const string UPDATE_BOOK_COVER = "libraries/{libraryId}/books/{bookId}/cover";
public const string GET_BOOK_READING_MANIFEST = "libraries/{libraryId}/books/{bookId}/reading/manifest";
public const string GET_BOOK_READING_AVAILABILITY = "libraries/{libraryId}/books/{bookId}/reading/availability";
@@ -15,6 +15,9 @@ public static partial class WebRoutes
public const string EDIT_BOOK = "{culture}/library/written-content-library/books-library/books/{bookId}";
public const string GET_BOOK_DETAILS = "{culture}/library/written-content-library/books-library/books/{bookId}/api-get-book";
public const string SAVE_BOOK = "{culture}/library/written-content-library/books-library/books/{bookId}/api-save-book";
public const string DELETE_BOOK = "{culture}/library/written-content-library/books-library/books/{bookId}/api-delete-book";
public const string DELETED_BOOKS = "{culture}/library/written-content-library/books-library/books/deleted-items";
public const string RESTORE_BOOK = "{culture}/library/written-content-library/books-library/books/{bookId}/api-restore-book";
public const string UPDATE_BOOK_COVER = "{culture}/library/written-content-library/books-library/books/{bookId}/api-update-cover";
public const string READ = "{culture}/library/written-content-library/books-library/books/{bookId}/read";
public const string GET_READING_MANIFEST = "{culture}/library/written-content-library/books-library/books/{bookId}/api-get-reading-manifest";
@@ -0,0 +1,62 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.DeleteBook;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{bookId}/api-delete-book</c> route.
/// </summary>
public class DeleteBookEndpoint : BaseEndpoint<EmptyRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="DeleteBookEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public DeleteBookEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.DELETE);
Routes(WebRoutes.Books.DELETE_BOOK);
DontAutoTag();
Options(options => options.WithTags("Books"));
EnableAntiforgery();
}
/// <summary>
/// Deletes the book identified by the route.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
{
// The book is identified by the {bookId} route value and the owning library by the {libraryId} query string; both ids are
// normalized to Guids before they are substituted into the upstream URL, so that a crafted value can never escape its URL
// segment, and an unparseable id is reported by the API as a missing id.
string routeBookId = HttpContext.Request.RouteValues["bookId"]?.ToString() ?? string.Empty;
string bookId = Guid.TryParse(routeBookId, out Guid parsedBookId) ? parsedBookId.ToString() : Guid.Empty.ToString();
string queryLibraryId = HttpContext.Request.Query["libraryId"].ToString();
string libraryId = Guid.TryParse(queryLibraryId, out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString();
await _apiHttpClient.DeleteAsync(ApiRoutes.Books.DELETE_BOOK.Replace("{libraryId}", libraryId).Replace("{bookId}", bookId), cancellationToken).ConfigureAwait(false);
return JsonSuccess();
}
}
@@ -0,0 +1,24 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.DeleteBook;
/// <summary>
/// Class used for providing a textual description for the <see cref="DeleteBookEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class DeleteBookEndpointSummary : Summary<DeleteBookEndpoint>
{
/// <summary>
/// Initializes a new instance of the <see cref="DeleteBookEndpointSummary"/> class.
/// </summary>
public DeleteBookEndpointSummary()
{
Summary = "Deletes a book.";
Description = "Moves the book identified by the route to the deleted items of its library, where its metadata and stored artwork are kept so that the deletion can be undone.";
Response(200, "The book was moved to the deleted items of its library.");
}
}
@@ -0,0 +1,135 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.DTO.Libraries;
using Lumina.Presentation.Web.Common.DTO.Themes;
using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary;
using Lumina.Presentation.Web.Common.Primitives;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Common.Services;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Lumina.Presentation.Web.Core.Themes;
using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.DeletedBooks;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/deleted-items</c> route.
/// </summary>
public class DeletedBooksViewEndpoint : BaseEndpoint<GetBooksViewRequest, IResult>
{
// The resource base name deliberately excludes the "Core.Resources" segment: the localization factory re-roots it with the configured ResourcesPath.
private const string VIEW_RESOURCE_BASE_NAME = "Lumina.Presentation.Web.Views.Library.WrittenContentLibrary.BookLibrary.Books.DeletedItems";
private const string VIEW_RESOURCE_LOCATION = "Lumina.Presentation.Web";
// The page key mirrors the path of the Razor view under Core/Views, so that theme templates can override it at the page, section or default scope.
private const string VIEW_PAGE_KEY = "library/written-content-library/book-library/books/deleted-items";
private static readonly JsonSerializerOptions s_camelCaseJsonOptions = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
Converters = { new JsonStringEnumConverter() }
};
private readonly IApiHttpClient _apiHttpClient;
private readonly IUrlService _urlService;
private readonly ThemePageRenderer _themePageRenderer;
private readonly IAntiforgery _antiforgery;
private readonly IStringLocalizer _localizer;
/// <summary>
/// Initializes a new instance of the <see cref="DeletedBooksViewEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
/// <param name="urlService">Injected service for generating URLs from action and controller names, with localization.</param>
/// <param name="themePageRenderer">Injected service for rendering themed pages.</param>
/// <param name="antiforgery">Injected service for anti-forgery token handling.</param>
/// <param name="stringLocalizerFactory">Injected factory used to create the localizer of the view resources.</param>
public DeletedBooksViewEndpoint(IApiHttpClient apiHttpClient, IUrlService urlService, ThemePageRenderer themePageRenderer, IAntiforgery antiforgery, IStringLocalizerFactory stringLocalizerFactory)
{
_apiHttpClient = apiHttpClient;
_urlService = urlService;
_themePageRenderer = themePageRenderer;
_antiforgery = antiforgery;
_localizer = stringLocalizerFactory.Create(VIEW_RESOURCE_BASE_NAME, VIEW_RESOURCE_LOCATION);
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.GET);
Routes(WebRoutes.Books.DELETED_BOOKS);
DontAutoTag();
Options(options => options.WithTags("Books"));
}
/// <summary>
/// Displays the deleted books of a media library, rendered by the active theme with a fallback to the Razor view.
/// </summary>
/// <param name="request">The request containing the Id of the media library whose deleted books are shown.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(GetBooksViewRequest request, CancellationToken cancellationToken)
{
if (request.LibraryId is null)
return Results.Redirect(_urlService.GetAbsoluteUrl(WebRoutes.Home.INDEX_CULTURED)!);
LibraryDto library = await _apiHttpClient.GetAsync<LibraryDto>(
ApiRoutes.Libraries.GET_LIBRARY_BY_ID.Replace("{id}", request.LibraryId.Value.ToString()), cancellationToken).ConfigureAwait(false);
DeletedBookDto[] deletedBooks = await _apiHttpClient.GetAsync<DeletedBookDto[]>(
ApiRoutes.Books.GET_DELETED_BOOKS.Replace("{libraryId}", request.LibraryId.Value.ToString()), cancellationToken).ConfigureAwait(false);
// The page restores books, which submit through the form anti-forgery token, so a fresh token must be issued for it.
AntiforgeryTokenSet antiforgeryTokens = _antiforgery.GetAndStoreTokens(HttpContext);
string title = _localizer["Title"].Value;
string backUrl = (_urlService.GetAbsoluteUrl(WebRoutes.Books.INDEX) ?? string.Empty) + "?libraryId=" + request.LibraryId.Value;
Dictionary<string, object?> strings = ThemePageDataFactory.CreateLocalizedStrings(_localizer);
// The themed page script reads the localized strings through camel case keys, and they are serialized as JSON so that quotes and
// apostrophes in translations never terminate the JavaScript string literals of the template.
string stringsJson = JsonSerializer.Serialize(strings.ToDictionary(
entry => JsonNamingPolicy.CamelCase.ConvertName(entry.Key),
entry => entry.Value));
ThemePageDto pageModel = new()
{
PageKey = VIEW_PAGE_KEY,
Title = title,
Description = string.Empty,
PageData = new Dictionary<string, object?>
{
["libraryId"] = request.LibraryId.Value.ToString(),
["libraryTitle"] = library.Title ?? string.Empty,
["deletedBooksJson"] = JsonSerializer.Serialize(deletedBooks, s_camelCaseJsonOptions),
["restoreUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.RESTORE_BOOK, new { bookId = default(Guid) }) ?? string.Empty,
["backUrl"] = backUrl,
["antiforgeryToken"] = antiforgeryTokens.RequestToken,
["strings"] = strings,
["stringsJson"] = stringsJson
}
};
Result<ThemePageRenderResultDto> sectionResult = await _themePageRenderer.RenderAsync(pageModel, requestedThemeId: null, cancellationToken).ConfigureAwait(false);
if (sectionResult.IsFailure)
return View("/Core/Views/Library/WrittenContentLibrary/BookLibrary/Books/DeletedItems.cshtml",
new DeletedBooksPageDto(library, deletedBooks),
new Dictionary<string, object?> { ["Title"] = title });
return View(
"/Core/Views/Shared/_ThemedView.cshtml",
new ThemeViewDto(sectionResult.Value.Content, sectionResult.Value.Script),
new Dictionary<string, object?> { ["Title"] = title });
}
}
@@ -0,0 +1,25 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.DeletedBooks;
/// <summary>
/// Class used for providing a textual description for the <see cref="DeletedBooksViewEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class DeletedBooksViewEndpointSummary : Summary<DeletedBooksViewEndpoint, GetBooksViewRequest>
{
/// <summary>
/// Initializes a new instance of the <see cref="DeletedBooksViewEndpointSummary"/> class.
/// </summary>
public DeletedBooksViewEndpointSummary()
{
Summary = "Renders the deleted items page of a book library.";
Description = "Renders the page that lists the books the user deleted from a book library and lets the user restore them.";
Response(200, "The deleted items page is rendered.");
}
}
@@ -105,6 +105,7 @@ public class EditBookViewEndpoint : BaseEndpoint<GetBookRequest, IResult>
["libraryId"] = book.LibraryId.ToString(),
["antiforgeryToken"] = antiforgeryTokens.RequestToken,
["saveUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.SAVE_BOOK, new { bookId = default(Guid) }) ?? string.Empty,
["deleteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.DELETE_BOOK, new { bookId = default(Guid) }) ?? string.Empty,
["coverUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.UPDATE_BOOK_COVER, new { bookId = default(Guid) }) ?? string.Empty,
["backUrl"] = (_urlService.GetAbsoluteUrl(WebRoutes.Books.INDEX) ?? string.Empty) + "?libraryId=" + book.LibraryId,
["bookJson"] = JsonSerializer.Serialize(book, s_camelCaseJsonOptions),
@@ -9,11 +9,12 @@ using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Common.Services;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Lumina.Presentation.Web.Core.Themes;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
#endregion
@@ -76,6 +77,13 @@ public class BooksIndexViewEndpoint : BaseEndpoint<GetBooksViewRequest, IResult>
return Results.Redirect(_urlService.GetAbsoluteUrl(WebRoutes.Home.INDEX_CULTURED)!);
LibraryDto library = await _apiHttpClient.GetAsync<LibraryDto>(ApiRoutes.Libraries.GET_LIBRARY_BY_ID.Replace("{id}", request.LibraryId.Value.ToString()), cancellationToken).ConfigureAwait(false);
Dictionary<string, object?> strings = ThemePageDataFactory.CreateLocalizedStrings(_localizer);
// The themed page script reads the localized strings through camel case keys, and they are serialized as JSON so that quotes and
// apostrophes in translations never terminate the JavaScript string literals of the template.
string stringsJson = JsonSerializer.Serialize(strings.ToDictionary(
entry => JsonNamingPolicy.CamelCase.ConvertName(entry.Key),
entry => entry.Value));
ThemePageDto pageModel = new()
{
PageKey = VIEW_PAGE_KEY,
@@ -88,8 +96,11 @@ public class BooksIndexViewEndpoint : BaseEndpoint<GetBooksViewRequest, IResult>
["settingsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Settings.GET_USER_SETTINGS) ?? string.Empty,
["readUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.READ, new { bookId = default(Guid) }) ?? string.Empty,
["detailsUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.EDIT_BOOK, new { bookId = default(Guid) }) ?? string.Empty,
["deleteUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.DELETE_BOOK, new { bookId = default(Guid) }) ?? string.Empty,
["deletedBooksUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.DELETED_BOOKS) ?? string.Empty,
["availabilityUrl"] = _urlService.GetAbsoluteUrl(WebRoutes.Books.GET_READING_AVAILABILITY, new { bookId = default(Guid) }) ?? string.Empty,
["strings"] = ThemePageDataFactory.CreateLocalizedStrings(_localizer)
["strings"] = strings,
["stringsJson"] = stringsJson
}
};
@@ -0,0 +1,65 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Core.Endpoints.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.RestoreBook;
/// <summary>
/// API endpoint for the <c>/{culture}/library/written-content-library/books-library/books/{bookId}/api-restore-book</c> route.
/// </summary>
public class RestoreBookEndpoint : BaseEndpoint<EmptyRequest, IResult>
{
private readonly IApiHttpClient _apiHttpClient;
/// <summary>
/// Initializes a new instance of the <see cref="RestoreBookEndpoint"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public RestoreBookEndpoint(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
/// <summary>
/// Configures the endpoint.
/// </summary>
public override void Configure()
{
base.Configure();
Verbs(Http.POST);
Routes(WebRoutes.Books.RESTORE_BOOK);
DontAutoTag();
Options(options => options.WithTags("Books"));
EnableAntiforgery();
}
/// <summary>
/// Restores the deleted book identified by the route.
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
{
// The book is identified by the {bookId} route value and the owning library by the {libraryId} query string; both ids are
// normalized to Guids before they are substituted into the upstream URL, so that a crafted value can never escape its URL
// segment, and an unparseable id is reported by the API as a missing id.
string routeBookId = HttpContext.Request.RouteValues["bookId"]?.ToString() ?? string.Empty;
string bookId = Guid.TryParse(routeBookId, out Guid parsedBookId) ? parsedBookId.ToString() : Guid.Empty.ToString();
string queryLibraryId = HttpContext.Request.Query["libraryId"].ToString();
string libraryId = Guid.TryParse(queryLibraryId, out Guid parsedLibraryId) ? parsedLibraryId.ToString() : Guid.Empty.ToString();
await _apiHttpClient.PostAsync<Web.Common.Requests.Common.EmptyRequest, Web.Common.Requests.Common.EmptyRequest>(
ApiRoutes.Books.RESTORE_BOOK.Replace("{libraryId}", libraryId).Replace("{bookId}", bookId),
new Web.Common.Requests.Common.EmptyRequest(),
cancellationToken).ConfigureAwait(false);
return JsonSuccess(new { isRestored = true });
}
}
@@ -0,0 +1,24 @@
#region ========================================================================= USING =====================================================================================
using FastEndpoints;
using System.Diagnostics.CodeAnalysis;
#endregion
namespace Lumina.Presentation.Web.Core.Endpoints.Library.WrittenContentLibrary.BookLibrary.Books.RestoreBook;
/// <summary>
/// Class used for providing a textual description for the <see cref="RestoreBookEndpoint"/> endpoint, for OpenAPI.
/// </summary>
[ExcludeFromCodeCoverage]
public class RestoreBookEndpointSummary : Summary<RestoreBookEndpoint>
{
/// <summary>
/// Initializes a new instance of the <see cref="RestoreBookEndpointSummary"/> class.
/// </summary>
public RestoreBookEndpointSummary()
{
Summary = "Restores a deleted book.";
Description = "Restores the deleted book identified by the route to the catalogue of its library, together with the metadata and artwork that were kept while it was deleted.";
Response(200, "The book was restored.");
}
}
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>العناصر المحذوفة</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>العودة إلى المكتبة</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>لا توجد عناصر محذوفة في هذه المكتبة.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>الكتاب</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>تاريخ الحذف</value>
</data>
<data name="Restore" xml:space="preserve">
<value>استعادة</value>
</data>
<data name="Restored" xml:space="preserve">
<value>تمت استعادة الكتاب.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>تعذرت استعادة الكتاب.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Gelöschte Elemente</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Zurück zur Bibliothek</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>In dieser Bibliothek gibt es keine gelöschten Elemente.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>Buch</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>Gelöscht am</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Wiederherstellen</value>
</data>
<data name="Restored" xml:space="preserve">
<value>Das Buch wurde wiederhergestellt.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>Das Buch konnte nicht wiederhergestellt werden.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Deleted items</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Back to library</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>There are no deleted items in this library.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>Book</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>Deleted on</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Restore</value>
</data>
<data name="Restored" xml:space="preserve">
<value>The book was restored.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>The book could not be restored.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Elementos eliminados</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Volver a la biblioteca</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>No hay elementos eliminados en esta biblioteca.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>Libro</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>Eliminado el</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Restaurar</value>
</data>
<data name="Restored" xml:space="preserve">
<value>El libro se ha restaurado.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>El libro no se ha podido restaurar.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Éléments supprimés</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Retour à la bibliothèque</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>Cette bibliothèque ne contient aucun élément supprimé.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>Livre</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>Supprimé le</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Restaurer</value>
</data>
<data name="Restored" xml:space="preserve">
<value>Le livre a été restauré.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>Le livre n'a pas pu être restauré.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Elementi eliminati</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Torna alla biblioteca</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>Non ci sono elementi eliminati in questa biblioteca.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>Libro</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>Eliminato il</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Ripristina</value>
</data>
<data name="Restored" xml:space="preserve">
<value>Il libro è stato ripristinato.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>Non è stato possibile ripristinare il libro.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>削除済みアイテム</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>ライブラリに戻る</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>このライブラリに削除済みアイテムはありません。</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>本</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>削除日</value>
</data>
<data name="Restore" xml:space="preserve">
<value>復元</value>
</data>
<data name="Restored" xml:space="preserve">
<value>本が復元されました。</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>本を復元できませんでした。</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Deleted items</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Back to library</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>There are no deleted items in this library.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>Book</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>Deleted on</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Restore</value>
</data>
<data name="Restored" xml:space="preserve">
<value>The book was restored.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>The book could not be restored.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Elemente șterse</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Înapoi la bibliotecă</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>Nu există elemente șterse în această bibliotecă.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>Carte</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>Șters la</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Restaurează</value>
</data>
<data name="Restored" xml:space="preserve">
<value>Cartea a fost restaurată.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>Cartea nu a putut fi restaurată.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>Видалені елементи</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>Повернутися до бібліотеки</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>У цій бібліотеці немає видалених елементів.</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>Книга</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>Видалено</value>
</data>
<data name="Restore" xml:space="preserve">
<value>Відновити</value>
</data>
<data name="Restored" xml:space="preserve">
<value>Книгу відновлено.</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>Не вдалося відновити книгу.</value>
</data>
</root>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Title" xml:space="preserve">
<value>已删除项目</value>
</data>
<data name="BackToLibrary" xml:space="preserve">
<value>返回图书馆</value>
</data>
<data name="NoDeletedItems" xml:space="preserve">
<value>此库中没有已删除项目。</value>
</data>
<data name="BookTitle" xml:space="preserve">
<value>图书</value>
</data>
<data name="DeletedOn" xml:space="preserve">
<value>删除时间</value>
</data>
<data name="Restore" xml:space="preserve">
<value>恢复</value>
</data>
<data name="Restored" xml:space="preserve">
<value>图书已恢复。</value>
</data>
<data name="RestoreFailed" xml:space="preserve">
<value>无法恢复图书。</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>عرض التفاصيل</value>
</data>
<data name="Delete" xml:space="preserve">
<value>حذف</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>هل أنت متأكد من أنك تريد حذف هذا العنصر؟</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>تعذر حذف العنصر.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>العناصر المحذوفة</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>Details anzeigen</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Löschen</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Möchten Sie dieses Element wirklich löschen?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>Das Element konnte nicht gelöscht werden.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>Gelöschte Elemente</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>View details</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Delete</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Are you sure you want to delete this item?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>The item could not be deleted.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>Deleted items</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>Ver detalles</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Eliminar</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>¿Seguro que quieres eliminar este elemento?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>No se ha podido eliminar el elemento.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>Elementos eliminados</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>Voir les détails</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Supprimer</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Voulez-vous vraiment supprimer cet élément ?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>L'élément n'a pas pu être supprimé.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>Éléments supprimés</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>Visualizza dettagli</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Elimina</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Sei sicuro di voler eliminare questo elemento?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>Non è stato possibile eliminare l'elemento.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>Elementi eliminati</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>詳細を表示</value>
</data>
<data name="Delete" xml:space="preserve">
<value>削除</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>この項目を削除してもよろしいですか?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>項目を削除できませんでした。</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>削除済みアイテム</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>View details</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Delete</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Are you sure you want to delete this item?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>The item could not be deleted.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>Deleted items</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>Vezi detalii</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Șterge</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Sigur doriți să ștergeți acest element?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>Elementul nu a putut fi șters.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>Elemente șterse</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>Переглянути деталі</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Видалити</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Ви впевнені, що хочете видалити цей елемент?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>Не вдалося видалити елемент.</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>Видалені елементи</value>
</data>
</root>
@@ -57,4 +57,16 @@
<data name="ViewDetails" xml:space="preserve">
<value>查看详情</value>
</data>
<data name="Delete" xml:space="preserve">
<value>删除</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>确定要删除此项目吗?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>无法删除该项目。</value>
</data>
<data name="DeletedItems" xml:space="preserve">
<value>已删除项目</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>إضافة وسم</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>حذف الكتاب</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>تم حذف الكتاب.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>هل أنت متأكد من أنك تريد حذف هذا العنصر؟</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>تعذر حذف العنصر.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>Schlagwort hinzufügen</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>Buch löschen</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>Das Buch wurde gelöscht.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Möchten Sie dieses Element wirklich löschen?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>Das Element konnte nicht gelöscht werden.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>Add tag</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>Delete book</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>The book was deleted.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Are you sure you want to delete this item?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>The item could not be deleted.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>Añadir etiqueta</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>Eliminar libro</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>El libro se ha eliminado.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>¿Seguro que quieres eliminar este elemento?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>El elemento no se ha podido eliminar.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>Ajouter une étiquette</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>Supprimer le livre</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>Le livre a été supprimé.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Voulez-vous vraiment supprimer cet élément ?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>L'élément n'a pas pu être supprimé.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>Aggiungi etichetta</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>Elimina libro</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>Il libro è stato eliminato.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Sei sicuro di voler eliminare questo elemento?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>Non è stato possibile eliminare l'elemento.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>タグを追加</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>本を削除</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>本が削除されました。</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>この項目を削除してもよろしいですか?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>項目を削除できませんでした。</value>
</data>
</root>
@@ -1083,4 +1083,16 @@
<data name="AddTag" xml:space="preserve">
<value>Add tag</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>Delete book</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>The book was deleted.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Are you sure you want to delete this item?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>The item could not be deleted.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>Adaugă etichetă</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>Șterge cartea</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>Cartea a fost ștearsă.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Sigur doriți să ștergeți acest element?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>Elementul nu a putut fi șters.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>Додати тег</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>Видалити книгу</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>Книгу видалено.</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>Ви впевнені, що хочете видалити цей елемент?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>Не вдалося видалити елемент.</value>
</data>
</root>
@@ -1084,4 +1084,16 @@
<data name="AddTag" xml:space="preserve">
<value>添加标签</value>
</data>
<data name="DeleteBook" xml:space="preserve">
<value>删除图书</value>
</data>
<data name="BookDeleted" xml:space="preserve">
<value>图书已删除。</value>
</data>
<data name="DeleteConfirm" xml:space="preserve">
<value>确定要删除此项目吗?</value>
</data>
<data name="DeleteFailed" xml:space="preserve">
<value>无法删除该项目。</value>
</data>
</root>
@@ -127,7 +127,7 @@
const result = await callApiPutAsync('@_urlService.GetAbsoluteUrl(WebRoutes.Admin.UPDATE_USER_AUTHORIZATION)', formData);
if (result.success)
notificationService.show('@_localizer["UserAuthorizationUpdated"]', NotificationType.SUCCESS);
notificationService.show(@Json.Serialize(_localizer["UserAuthorizationUpdated"].Value), NotificationType.SUCCESS);
}
async function fetchUserRoleAsync(userId) {
@@ -178,7 +178,7 @@
// Users dropdown change.
if (e.target.closest('#authorization-users-combobox .enlightenment-option')) {
var selectedUserId = e.target.dataset.value;
document.querySelector('#authorization-roles-combobox .enlightenment-selected-text').textContent = '@_localizer["SelectARole"]';
document.querySelector('#authorization-roles-combobox .enlightenment-selected-text').textContent = @Json.Serialize(_localizer["SelectARole"].Value);
document.querySelectorAll("input[name='authorization-permissions-permissions']").forEach(input => input.checked = false);
roleIdInput.value = '';
userIdInput.value = '';
@@ -112,7 +112,7 @@
{ success: (await callApiPostAsync('@_urlService.GetAbsoluteUrl(WebRoutes.Admin.CREATE_ROLE)', formData)) !== undefined };
if (result.success) {
await fetchRolesAsync();
notificationService.show(isRoleSelected ? '@_localizer["RoleUpdated"]' : '@_localizer["RoleCreated"]', NotificationType.SUCCESS);
notificationService.show(isRoleSelected ? @Json.Serialize(_localizer["RoleUpdated"].Value) : @Json.Serialize(_localizer["RoleCreated"].Value), NotificationType.SUCCESS);
}
}
@@ -136,7 +136,7 @@
});
// Update the text of the toggle button of the combobox.
document.querySelector('.enlightenment-selected-text').textContent = '@_localizer["SelectARole"]';
document.querySelector('.enlightenment-selected-text').textContent = @Json.Serialize(_localizer["SelectARole"].Value);
// All permissions should be "unchecked".
document.querySelectorAll("input[name='authorization-role-permissions']")
@@ -147,7 +147,7 @@
btnDeleteRole.classList.add('hidden');
// The "update" button should be "create".
btnConfirmRole.textContent = '@_localizer["CreateRole"]';
btnConfirmRole.textContent = @Json.Serialize(_localizer["CreateRole"].Value);
// The input for the role name should also have its text emptied.
txtRoleName.value = '';
@@ -195,12 +195,12 @@
// On delete role button click.
const handleBtnDeleteRoleClick = async function(e) {
// Ask the user for confirmation before deleting the role.
if (await dialogService.show('@_localizer["DeleteRoleConfirm"]', jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
if (await dialogService.show(@Json.Serialize(_localizer["DeleteRoleConfirm"].Value), jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.Admin.DELETE_ROLE, new { roleId = default(Guid) })';
const success = await callApiDeleteAsync(url.replace('/@(default(Guid))', `/${roleIdInput.value}`)); // roleId needs to be replaced here, because GetAbsoluteUrl is server side, roleId is client side.
if (success) {
await fetchRolesAsync();
notificationService.show('@_localizer["RoleDeleted"]', NotificationType.SUCCESS);
notificationService.show(@Json.Serialize(_localizer["RoleDeleted"].Value), NotificationType.SUCCESS);
}
}
};
@@ -218,13 +218,13 @@
if (roleId) {
btnDeleteRole.classList.remove('hidden');
btnDeleteRole.classList.add('inline');
btnConfirmRole.textContent = '@_localizer["UpdateRole"]';
btnConfirmRole.textContent = @Json.Serialize(_localizer["UpdateRole"].Value);
roleIdInput.value = roleId;
} else {
roleIdInput.value = '';
btnDeleteRole.classList.remove('inline');
btnDeleteRole.classList.add('hidden');
btnConfirmRole.textContent = '@_localizer["CreateRole"]';
btnConfirmRole.textContent = @Json.Serialize(_localizer["CreateRole"].Value);
}
}
};
@@ -181,7 +181,7 @@
const url = '@_urlService.GetAbsoluteUrl(WebRoutes.Plugins.UPDATE_PLUGIN_SETTINGS)';
const result = await callApiPutAsync(url, { pluginId: pluginId, settings: settings });
if (result.success) {
notificationService.show('@_localizer["SettingsSaved"]', NotificationType.SUCCESS);
notificationService.show(@Json.Serialize(_localizer["SettingsSaved"].Value), NotificationType.SUCCESS);
}
}
};
@@ -205,10 +205,10 @@
body: formData
});
if (response.ok) {
notificationService.show('@_localizer["PluginUploadedRestartRequired"]', NotificationType.SUCCESS);
notificationService.show(@Json.Serialize(_localizer["PluginUploadedRestartRequired"].Value), NotificationType.SUCCESS);
uploadInput.value = '';
} else {
notificationService.show('@_localizer["UploadFailed"]', NotificationType.ERROR);
notificationService.show(@Json.Serialize(_localizer["UploadFailed"].Value), NotificationType.ERROR);
}
}
@@ -166,29 +166,29 @@ It keeps the DOM contract the client script binds to, without any images or colo
// Localized strings.
const schedulerStrings = {
noJobs: '@_localizer["NoJobs"]',
daily: '@_localizer["DailySchedule"]',
interval: '@_localizer["IntervalSchedule"]',
startup: '@_localizer["StartupSchedule"]',
jobStarted: '@_localizer["JobStarted"]',
jobRemoved: '@_localizer["JobRemoved"]',
jobStopped: '@_localizer["JobStopped"]',
jobFired: '@_localizer["JobFired"]',
jobAdded: '@_localizer["JobAdded"]',
jobNotFound: '@_localizer["JobNotFound"]',
jobAlreadyRunning: '@_localizer["JobAlreadyRunning"]',
noJobs: @Json.Serialize(_localizer["NoJobs"].Value),
daily: @Json.Serialize(_localizer["DailySchedule"].Value),
interval: @Json.Serialize(_localizer["IntervalSchedule"].Value),
startup: @Json.Serialize(_localizer["StartupSchedule"].Value),
jobStarted: @Json.Serialize(_localizer["JobStarted"].Value),
jobRemoved: @Json.Serialize(_localizer["JobRemoved"].Value),
jobStopped: @Json.Serialize(_localizer["JobStopped"].Value),
jobFired: @Json.Serialize(_localizer["JobFired"].Value),
jobAdded: @Json.Serialize(_localizer["JobAdded"].Value),
jobNotFound: @Json.Serialize(_localizer["JobNotFound"].Value),
jobAlreadyRunning: @Json.Serialize(_localizer["JobAlreadyRunning"].Value),
taskTypeNames: {
ScanMediaLibraries: '@_localizer["TaskType.ScanMediaLibraries"]',
CleanTemporaryFiles: '@_localizer["TaskType.CleanTemporaryFiles"]',
RepairThemes: '@_localizer["TaskType.RepairThemes"]',
CleanScheduledJobExecutionHistory: '@_localizer["TaskType.CleanScheduledJobExecutionHistory"]',
TechnicalDataCleanup: '@_localizer["TaskType.TechnicalDataCleanup"]'
ScanMediaLibraries: @Json.Serialize(_localizer["TaskType.ScanMediaLibraries"].Value),
CleanTemporaryFiles: @Json.Serialize(_localizer["TaskType.CleanTemporaryFiles"].Value),
RepairThemes: @Json.Serialize(_localizer["TaskType.RepairThemes"].Value),
CleanScheduledJobExecutionHistory: @Json.Serialize(_localizer["TaskType.CleanScheduledJobExecutionHistory"].Value),
TechnicalDataCleanup: @Json.Serialize(_localizer["TaskType.TechnicalDataCleanup"].Value)
},
statusNames: {
Added: '@_localizer["Status.Added"]',
Active: '@_localizer["Status.Active"]',
Running: '@_localizer["Status.Running"]',
Completed: '@_localizer["Status.Completed"]'
Added: @Json.Serialize(_localizer["Status.Added"].Value),
Active: @Json.Serialize(_localizer["Status.Active"].Value),
Running: @Json.Serialize(_localizer["Status.Running"].Value),
Completed: @Json.Serialize(_localizer["Status.Completed"].Value)
}
};
@@ -365,7 +365,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
<td data-label="${escapeHtml(columnLabels[1])}">${escapeHtml(job.name)}</td>
<td data-label="${escapeHtml(columnLabels[2])}">${schedulerStrings.taskTypeNames[job.taskType] ?? job.taskType}</td>
<td data-label="${escapeHtml(columnLabels[3])}">${scheduleLabel}</td>
<td data-label="${escapeHtml(columnLabels[4])}">${isInterval ? job.intervalMinutes + ' ' + '@_localizer["MinutesShort"]' : '-'}</td>
<td data-label="${escapeHtml(columnLabels[4])}">${isInterval ? job.intervalMinutes + ' ' + @Json.Serialize(_localizer["MinutesShort"].Value) : '-'}</td>
<td data-label="${escapeHtml(columnLabels[5])}">${isDaily ? String(job.hour).padStart(2, '0') + ':' + String(job.minute).padStart(2, '0') : '-'}</td>
<td data-label="${escapeHtml(columnLabels[6])}">${schedulerStrings.statusNames[job.status] ?? job.status}</td>
<td data-label="${escapeHtml(columnLabels[7])}">${formatDateTime(job.lastStartedOnUtc)}</td>
@@ -381,11 +381,11 @@ It keeps the DOM contract the client script binds to, without any images or colo
const isRunning = job.status === 'Running';
const isActive = job.status === 'Active';
const canStop = isActive || isRunning;
actionsDiv.appendChild(createActionButton('@_localizer["Start"]', () => startJobAsync(job.id), canStop));
actionsDiv.appendChild(createActionButton('@_localizer["Stop"]', () => stopJobAsync(job.id), !canStop));
actionsDiv.appendChild(createActionButton('@_localizer["Fire"]', () => fireJobAsync(job.id), isRunning));
actionsDiv.appendChild(createActionButton(@Json.Serialize(_localizer["Start"].Value), () => startJobAsync(job.id), canStop));
actionsDiv.appendChild(createActionButton(@Json.Serialize(_localizer["Stop"].Value), () => stopJobAsync(job.id), !canStop));
actionsDiv.appendChild(createActionButton(@Json.Serialize(_localizer["Fire"].Value), () => fireJobAsync(job.id), isRunning));
// The cycle of a job that was started must be stopped before the job can be removed.
actionsDiv.appendChild(createActionButton('@_localizer["Remove"]', () => removeJobAsync(job.id), canStop));
actionsDiv.appendChild(createActionButton(@Json.Serialize(_localizer["Remove"].Value), () => removeJobAsync(job.id), canStop));
actionsCell.appendChild(actionsDiv);
row.appendChild(actionsCell);
@@ -679,7 +679,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
}
async function removeJobAsync(jobId) {
if (await dialogService.show('@_localizer["RemoveJobConfirm"]', jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
if (await dialogService.show(@Json.Serialize(_localizer["RemoveJobConfirm"].Value), jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
const removed = await callApiDeleteAsync(getJobActionUrl(removeJobUrlTemplate, jobId));
if (removed)
notificationService.show(schedulerStrings.jobRemoved, NotificationType.SUCCESS);
@@ -697,7 +697,7 @@ It keeps the DOM contract the client script binds to, without any images or colo
minute: scheduleType === 'DailyAtHourAndMinute' ? Number(jobMinuteInput.value) : null
};
if (!payload.name) {
notificationService.show('@_localizer["JobNameRequired"]', NotificationType.ERROR);
notificationService.show(@Json.Serialize(_localizer["JobNameRequired"].Value), NotificationType.ERROR);
return;
}
const response = await callApiPostAsync(addJobUrl, payload);
@@ -180,7 +180,7 @@
const button = event.target.closest('.delete-theme-button');
if (!button)
return;
if (await dialogService.show('@_localizer["DeleteThemeConfirm"]', jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
if (await dialogService.show(@Json.Serialize(_localizer["DeleteThemeConfirm"].Value), jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
await callApiDeleteAsync(button.dataset.url);
refreshPageContent();
}
@@ -238,7 +238,7 @@
if (response.ok)
refreshPageContent();
else
notificationService.show('@_localizer["UploadFailed"]', NotificationType.ERROR);
notificationService.show(@Json.Serialize(_localizer["UploadFailed"].Value), NotificationType.ERROR);
}
// Opens the file picker when the upload button is clicked.
@@ -103,20 +103,20 @@
};
const jsLocalizedStrings = {
all: '@_localizer["All"]',
items: '@_localizer["Items"]',
of: '@_localizer["Of"]',
page: '@_localizer["Page"]',
sortAscending: '@_localizer["SortAscending"]',
sortDescending: '@_localizer["SortDescending"]',
viewDetails: '@_localizer["ViewDetails"]',
actions: '@_localizer["Actions"]',
play: '@_localizer["Play"]',
shuffle: '@_localizer["Shuffle"]',
deleteItem: '@_localizer["Delete"]',
deleteConfirm: '@_localizer["DeleteConfirm"]',
deleteFailed: '@_localizer["DeleteFailed"]',
addToPlaylist: '@_localizer["AddToPlaylist"]'
all: @Json.Serialize(_localizer["All"].Value),
items: @Json.Serialize(_localizer["Items"].Value),
of: @Json.Serialize(_localizer["Of"].Value),
page: @Json.Serialize(_localizer["Page"].Value),
sortAscending: @Json.Serialize(_localizer["SortAscending"].Value),
sortDescending: @Json.Serialize(_localizer["SortDescending"].Value),
viewDetails: @Json.Serialize(_localizer["ViewDetails"].Value),
actions: @Json.Serialize(_localizer["Actions"].Value),
play: @Json.Serialize(_localizer["Play"].Value),
shuffle: @Json.Serialize(_localizer["Shuffle"].Value),
deleteItem: @Json.Serialize(_localizer["Delete"].Value),
deleteConfirm: @Json.Serialize(_localizer["DeleteConfirm"].Value),
deleteFailed: @Json.Serialize(_localizer["DeleteFailed"].Value),
addToPlaylist: @Json.Serialize(_localizer["AddToPlaylist"].Value)
};
function buildItemsUrl() {
@@ -975,23 +975,23 @@
// The localized labels of the release types, keyed by their canonical enum name.
const releaseTypeLabels = {
'Album': '@_localizer["Album"].Value',
'Broadcast': '@_localizer["Broadcast"].Value',
'Ep': '@_localizer["Ep"].Value',
'Other': '@_localizer["Other"].Value',
'Single': '@_localizer["Single"].Value',
'AudioDrama': '@_localizer["AudioDrama"].Value',
'AudioBook': '@_localizer["AudioBook"].Value',
'Compilation': '@_localizer["Compilation"].Value',
'DjMix': '@_localizer["DjMix"].Value',
'Demo': '@_localizer["Demo"].Value',
'FieldRecording': '@_localizer["FieldRecording"].Value',
'Interview': '@_localizer["Interview"].Value',
'Live': '@_localizer["Live"].Value',
'Mixtape': '@_localizer["Mixtape"].Value',
'Remix': '@_localizer["Remix"].Value',
'Soundtrack': '@_localizer["Soundtrack"].Value',
'SpokenWord': '@_localizer["SpokenWord"].Value'
'Album': @Json.Serialize(_localizer["Album"].Value),
'Broadcast': @Json.Serialize(_localizer["Broadcast"].Value),
'Ep': @Json.Serialize(_localizer["Ep"].Value),
'Other': @Json.Serialize(_localizer["Other"].Value),
'Single': @Json.Serialize(_localizer["Single"].Value),
'AudioDrama': @Json.Serialize(_localizer["AudioDrama"].Value),
'AudioBook': @Json.Serialize(_localizer["AudioBook"].Value),
'Compilation': @Json.Serialize(_localizer["Compilation"].Value),
'DjMix': @Json.Serialize(_localizer["DjMix"].Value),
'Demo': @Json.Serialize(_localizer["Demo"].Value),
'FieldRecording': @Json.Serialize(_localizer["FieldRecording"].Value),
'Interview': @Json.Serialize(_localizer["Interview"].Value),
'Live': @Json.Serialize(_localizer["Live"].Value),
'Mixtape': @Json.Serialize(_localizer["Mixtape"].Value),
'Remix': @Json.Serialize(_localizer["Remix"].Value),
'Soundtrack': @Json.Serialize(_localizer["Soundtrack"].Value),
'SpokenWord': @Json.Serialize(_localizer["SpokenWord"].Value)
};
// The order in which the release type groups are displayed, from the most common to the least common.
const releaseTypeOrder = ['Album', 'Compilation', 'Ep', 'Live', 'Remix', 'Single', 'Soundtrack', 'Broadcast', 'AudioDrama', 'AudioBook', 'Demo', 'DjMix', 'FieldRecording', 'Interview', 'Mixtape', 'SpokenWord', 'Other'];
@@ -0,0 +1,140 @@
@*
FALLBACK DELETED ITEMS VIEW - READ BEFORE EDITING
This view is the application fallback of the deleted items page of a book library, rendered only when the
active theme does not provide its own template for the page. It keeps the DOM contract and the client script
the theme template mirrors, so that restoring a deleted book keeps working even without the theme.
/library/written-content-library/books-library/books/deleted-items?libraryId=...
*@
@using Lumina.Presentation.Web.Common.DTO.WrittenContentLibrary.BookLibrary
@using Lumina.Presentation.Web.Common.Services
@using Microsoft.AspNetCore.Mvc.Localization
@{
// Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler.
var scriptId = ScriptIdentifierHelper.GenerateScriptId();
var libraryId = Model.Library.Id?.ToString() ?? string.Empty;
}
@inject IViewLocalizer _localizer
@inject IUrlService _urlService
@model DeletedBooksPageDto
@Html.AntiForgeryToken()
<div style="display: grid; grid-template-rows: auto 1fr;">
<div style="min-height: 1rem;"></div>
<div class="enlightenment-panel shadow-effect mx-auto panel w-60 mb-10 deleted-books-panel" style="min-width: 320px;">
<div class="shine-effect"></div>
<div class="form-row deleted-books-top-bar">
<button id="btn-back-to-library" type="button" class="abort-button">@_localizer["BackToLibrary"]</button>
</div>
<div class="form-row deleted-books-title-row">
<h1 class="text-light-two w-100 text-center pt-0 pb-0 engraved-title">@_localizer["Title"]</h1>
</div>
<p id="no-deleted-books" class="text-light-two text-center @(Model.DeletedBooks.Count == 0 ? string.Empty : "hidden")">@_localizer["NoDeletedItems"]</p>
<table id="deleted-books-table" class="w-100 form-table deleted-books-table @(Model.DeletedBooks.Count == 0 ? "hidden" : string.Empty)">
<thead>
<tr>
<th>@_localizer["BookTitle"]</th>
<th>@_localizer["DeletedOn"]</th>
<th class="w-100px"></th>
</tr>
</thead>
<tbody>
@foreach (DeletedBookDto book in Model.DeletedBooks)
{
<tr class="deleted-book-row" data-book-id="@book.Id">
<td>@book.Title</td>
<td>@book.DeletedOnUtc.ToString("g")</td>
<td>
<button type="button" class="confirm-button w-100px btn-restore-book" data-book-id="@book.Id">@_localizer["Restore"]</button>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
@section Scripts {
<!-- The "text/plain" type is a design choice, not a mistake: it keeps the browser from executing this view script during HTML parsing, before site.js defines the API helpers it calls. site.js (which loads deferred) executes these scripts once it is loaded, both on the initial page load and during AJAX navigation. -->
<script type="text/plain" data-form="@scriptId">
// Create cleanup registry for this view.
const cleanupFunctions = [];
let isInitialized = false;
const libraryId = '@libraryId';
const libraryIndexUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.INDEX)';
const restoreUrlTemplate = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.RESTORE_BOOK, new { bookId = default(Guid) })';
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const btnBackToLibrary = document.getElementById('btn-back-to-library');
const deletedBooksTable = document.getElementById('deleted-books-table');
const noDeletedBooks = document.getElementById('no-deleted-books');
const jsLocalizedStrings = {
restored: @Json.Serialize(_localizer["Restored"].Value),
restoreFailed: @Json.Serialize(_localizer["RestoreFailed"].Value)
};
// Restores the clicked deleted book, then removes its row from the page.
async function handleRestoreAsync(event) {
const button = event.target.closest('.btn-restore-book');
if (!button || button.disabled)
return;
button.disabled = true;
try {
const url = restoreUrlTemplate.replace('/@(default(Guid))', `/${button.dataset.bookId}`) + `?libraryId=${encodeURIComponent(libraryId)}`;
const result = await callApiPostAsync(url, {});
if (result?.isRestored !== true) {
notificationService.show(jsLocalizedStrings.restoreFailed, NotificationType.ERROR);
return;
}
notificationService.show(jsLocalizedStrings.restored, NotificationType.SUCCESS);
button.closest('.deleted-book-row')?.remove();
if (deletedBooksTable && deletedBooksTable.querySelectorAll('.deleted-book-row').length === 0) {
deletedBooksTable.classList.add('hidden');
noDeletedBooks?.classList.remove('hidden');
}
} finally {
if (button.isConnected)
button.disabled = false;
}
}
// Navigates back to the library page of the deleted books.
async function handleBackToLibraryAsync() {
await updateContentAsync(`${libraryIndexUrl}?libraryId=${encodeURIComponent(libraryId)}`, true);
}
// Add listeners.
btnBackToLibrary.addEventListener('click', handleBackToLibraryAsync);
deletedBooksTable.addEventListener('click', handleRestoreAsync);
document.addEventListener('DOMContentLoaded', InitializeAsync);
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
btnBackToLibrary.removeEventListener('click', handleBackToLibraryAsync);
deletedBooksTable.removeEventListener('click', handleRestoreAsync);
document.removeEventListener('DOMContentLoaded', InitializeAsync);
});
function InitializeAsync() {
if (isInitialized)
return;
isInitialized = true;
}
// Store all cleanups for this view on window object using the scriptId.
window.viewCleanups = window.viewCleanups || {};
window.viewCleanups['@scriptId'] = () => {
cleanupFunctions.forEach(cleanup => cleanup());
console.log(`Unloaded @scriptId`);
};
console.log(`Loaded @scriptId`);
</script>
}
@@ -39,6 +39,7 @@
<input id="search-input" type="text" class="enlightenment-input w-200px" placeholder="@_localizer["Search"]" />
<button id="search-button" type="button" class="confirm-button">@_localizer["Search"]</button>
<button id="sort-toggle" type="button" class="confirm-button">@_localizer["SortAscending"]</button>
<button id="btn-deleted-books" type="button" class="abort-button">@_localizer["DeletedItems"]</button>
<span id="count-label" class="text-light-two"></span>
</div>
<div style="display: flex; align-items: flex-start;">
@@ -63,10 +64,14 @@
const cleanupFunctions = [];
let isInitialized = false;
let requestSequence = 0;
// Book Ids whose deletion request is already in flight, so a second click cannot send a duplicate request.
const booksBeingDeleted = new Set();
const libraryId = '@(Model.Id ?? Guid.Empty)';
const readUrlTemplate = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.READ, new { bookId = default(Guid) })';
const detailsUrlTemplate = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.EDIT_BOOK, new { bookId = default(Guid) })';
const deleteUrlTemplate = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.DELETE_BOOK, new { bookId = default(Guid) })';
const deletedBooksUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.DELETED_BOOKS)';
const availabilityUrlTemplate = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.GET_READING_AVAILABILITY, new { bookId = default(Guid) })';
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
const booksContainer = document.getElementById('books-container');
@@ -75,6 +80,7 @@
const searchInput = document.getElementById('search-input');
const searchButton = document.getElementById('search-button');
const sortToggle = document.getElementById('sort-toggle');
const btnDeletedBooks = document.getElementById('btn-deleted-books');
const countLabel = document.getElementById('count-label');
const alphaPicker = document.getElementById('alpha-picker');
const pagination = document.getElementById('pagination');
@@ -95,16 +101,19 @@
};
const jsLocalizedStrings = {
all: '@_localizer["All"]',
items: '@_localizer["Items"]',
of: '@_localizer["Of"]',
page: '@_localizer["Page"]',
sortAscending: '@_localizer["SortAscending"]',
sortDescending: '@_localizer["SortDescending"]',
readerUnavailable: '@_localizer["ReaderUnavailable"]',
readerDisabled: '@_localizer["ReaderDisabled"]',
read: '@_localizer["Read"]',
viewDetails: '@_localizer["ViewDetails"]'
all: @Json.Serialize(_localizer["All"].Value),
items: @Json.Serialize(_localizer["Items"].Value),
of: @Json.Serialize(_localizer["Of"].Value),
page: @Json.Serialize(_localizer["Page"].Value),
sortAscending: @Json.Serialize(_localizer["SortAscending"].Value),
sortDescending: @Json.Serialize(_localizer["SortDescending"].Value),
readerUnavailable: @Json.Serialize(_localizer["ReaderUnavailable"].Value),
readerDisabled: @Json.Serialize(_localizer["ReaderDisabled"].Value),
read: @Json.Serialize(_localizer["Read"].Value),
viewDetails: @Json.Serialize(_localizer["ViewDetails"].Value),
deleteItem: @Json.Serialize(_localizer["Delete"].Value),
deleteConfirm: @Json.Serialize(_localizer["DeleteConfirm"].Value),
deleteFailed: @Json.Serialize(_localizer["DeleteFailed"].Value)
};
// Builds the URL of the retrieval endpoint, from the current state.
@@ -213,17 +222,23 @@
menu.setAttribute('role', 'menu');
menu.innerHTML = `
<a role="menuitem" href="${readUrlTemplate.replace('/@(default(Guid))', `/${book.id}`) + `?libraryId=${libraryId}`}">${jsLocalizedStrings.read}</a>
<a role="menuitem" href="${detailsUrl}">${jsLocalizedStrings.viewDetails}</a>`;
<a role="menuitem" href="${detailsUrl}">${jsLocalizedStrings.viewDetails}</a>
<a role="menuitem" href="#" class="card-action-delete">${jsLocalizedStrings.deleteItem}</a>`;
// Menu entries navigate through the same AJAX navigation used by the nav-links, so that the persistent chrome keeps running.
// The delete entry does not navigate, it deletes the book and reloads the list in place.
menu.addEventListener('click', async event => {
const deleteItem = event.target.closest('.card-action-delete');
const menuItem = event.target.closest('a[role="menuitem"]');
if (!menuItem)
return;
event.preventDefault();
event.stopImmediatePropagation();
closeCardMenus();
await updateContentAsync(menuItem.href, true);
if (deleteItem)
await deleteBookAsync(book.id, deleteItem);
else
await updateContentAsync(menuItem.href, true);
});
// The favorite heart is a plain button: the global favorites script finds it by its data attributes, hydrates its state and handles its click.
@@ -327,6 +342,33 @@
}
}
// Deletes the book after confirmation, then reloads the list.
async function deleteBookAsync(bookId, actionElement) {
if (booksBeingDeleted.has(bookId))
return;
booksBeingDeleted.add(bookId);
if (actionElement) {
actionElement.classList.add('disabled');
actionElement.setAttribute('aria-disabled', 'true');
}
try {
if (await dialogService.show(jsLocalizedStrings.deleteConfirm, jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) !== DialogButton.YES)
return;
const url = deleteUrlTemplate.replace('/@(default(Guid))', `/${bookId}`) + `?libraryId=${encodeURIComponent(libraryId)}`;
const success = await callApiDeleteAsync(url);
if (success)
await loadItemsAsync();
else
notificationService.show(jsLocalizedStrings.deleteFailed, NotificationType.ERROR);
} finally {
booksBeingDeleted.delete(bookId);
if (actionElement?.isConnected) {
actionElement.classList.remove('disabled');
actionElement.removeAttribute('aria-disabled');
}
}
}
// Updates the count label: total items when pagination is off, displayed range out of total when it is on.
function updateCountLabel(response) {
if (!countLabel)
@@ -440,6 +482,11 @@
}
}
// Navigates to the deleted items page of the library.
async function handleDeletedBooksAsync() {
await updateContentAsync(`${deletedBooksUrl}?libraryId=${encodeURIComponent(libraryId)}`, true);
}
// Navigates to the previous page.
function handlePrevPageClick() {
state.currentPage = Math.max(1, state.currentPage - 1);
@@ -468,6 +515,7 @@
bindEventHandler(searchButton, 'click', handleSearch);
bindEventHandler(searchInput, 'keydown', handleSearchKeydown);
bindEventHandler(sortToggle, 'click', handleSortToggle);
bindEventHandler(btnDeletedBooks, 'click', handleDeletedBooksAsync);
bindEventHandler(prevPageButton, 'click', handlePrevPageClick);
bindEventHandler(nextPageButton, 'click', handleNextPageClick);
document.addEventListener('keydown', handleAlphaKeydown);
@@ -480,6 +528,7 @@
unbindEventHandler(searchButton, 'click', handleSearch);
unbindEventHandler(searchInput, 'keydown', handleSearchKeydown);
unbindEventHandler(sortToggle, 'click', handleSortToggle);
unbindEventHandler(btnDeletedBooks, 'click', handleDeletedBooksAsync);
unbindEventHandler(prevPageButton, 'click', handlePrevPageClick);
unbindEventHandler(nextPageButton, 'click', handleNextPageClick);
document.removeEventListener('keydown', handleAlphaKeydown);
@@ -527,6 +527,7 @@
<div class="form-row mt-10">
<button id="btn-save-book" type="button" class="confirm-button w-100px">@_localizer["Save"]</button>
<button id="btn-delete-book" type="button" class="abort-button w-100px">@_localizer["DeleteBook"]</button>
</div>
</div>
</div>
@@ -545,6 +546,7 @@
const libraryId = '@libraryId';
const libraryIndexUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.INDEX)';
const saveUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.SAVE_BOOK, new { bookId = default(Guid) })'.replace('/@(default(Guid))', `/${bookId}`);
const deleteUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.DELETE_BOOK, new { bookId = default(Guid) })'.replace('/@(default(Guid))', `/${bookId}`);
const coverUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Books.UPDATE_BOOK_COVER, new { bookId = default(Guid) })'.replace('/@(default(Guid))', `/${bookId}`) + `?libraryId=${libraryId}`;
// The element references are captured once, so that the cleanup can unbind their listeners even after the AJAX navigator has swapped the content out of the document.
@@ -554,6 +556,7 @@
const btnChangeCover = document.getElementById('btn-change-cover');
const btnBackToLibrary = document.getElementById('btn-back-to-library');
const btnSaveBook = document.getElementById('btn-save-book');
const btnDeleteBook = document.getElementById('btn-delete-book');
const isbnsBody = document.getElementById('isbns-body');
const contributorsBody = document.getElementById('contributors-body');
const ratingsBody = document.getElementById('ratings-body');
@@ -570,6 +573,9 @@
coverSaved: @Json.Serialize(_localizer["CoverSaved"].Value),
saveFailed: @Json.Serialize(_localizer["SaveFailed"].Value),
coverUploadFailed: @Json.Serialize(_localizer["CoverUploadFailed"].Value),
bookDeleted: @Json.Serialize(_localizer["BookDeleted"].Value),
deleteConfirm: @Json.Serialize(_localizer["DeleteConfirm"].Value),
deleteFailed: @Json.Serialize(_localizer["DeleteFailed"].Value),
noCover: @Json.Serialize(_localizer["NoCover"].Value),
remove: @Json.Serialize(_localizer["Remove"].Value)
};
@@ -698,6 +704,18 @@
}
}
// Deletes the book after confirmation, then returns to the library page.
async function handleDeleteAsync() {
if (await dialogService.show(jsLocalizedStrings.deleteConfirm, jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) !== DialogButton.YES)
return;
const success = await callApiDeleteAsync(`${deleteUrl}?libraryId=${encodeURIComponent(libraryId)}`);
if (success) {
notificationService.show(jsLocalizedStrings.bookDeleted, NotificationType.SUCCESS);
await handleBackToLibraryAsync();
} else
notificationService.show(jsLocalizedStrings.deleteFailed, NotificationType.ERROR);
}
// Opens the file picker that chooses the new cover image.
function handleChangeCoverClick() {
coverInput.click();
@@ -880,6 +898,7 @@
// Add listeners.
btnSaveBook.addEventListener('click', handleSaveAsync);
btnDeleteBook.addEventListener('click', handleDeleteAsync);
btnBackToLibrary.addEventListener('click', handleBackToLibraryAsync);
btnChangeCover.addEventListener('click', handleChangeCoverClick);
coverInput.addEventListener('change', handleCoverChangeAsync);
@@ -898,6 +917,7 @@
// Register cleanup for these listeners.
cleanupFunctions.push(() => {
btnSaveBook.removeEventListener('click', handleSaveAsync);
btnDeleteBook.removeEventListener('click', handleDeleteAsync);
btnBackToLibrary.removeEventListener('click', handleBackToLibraryAsync);
btnChangeCover.removeEventListener('click', handleChangeCoverClick);
coverInput.removeEventListener('change', handleCoverChangeAsync);
@@ -409,7 +409,7 @@
};
const data = await callApiPostAsync('@_urlService.GetAbsoluteUrl(WebRoutes.Settings.UPDATE_USER_SETTINGS)', formData);
if (data && data.isUpdated === true) {
notificationService.show('@_localizer["SettingsSaved"]', NotificationType.SUCCESS);
notificationService.show(@Json.Serialize(_localizer["SettingsSaved"].Value), NotificationType.SUCCESS);
// The player lives in the layout and is not recreated by the navigation manager, so the saved playback and
// VU meter settings are handed to it directly instead of waiting for a full page reload.
if (window.LuminaAudioPlayer && window.LuminaAudioPlayer.instance && typeof window.LuminaAudioPlayer.instance.reloadPreferencesAsync === 'function')