diff --git a/src/Lumina.DataAccess/Core/Repositories/Books/BookRepository.cs b/src/Lumina.DataAccess/Core/Repositories/Books/BookRepository.cs index 9d1e95b1..e2927044 100644 --- a/src/Lumina.DataAccess/Core/Repositories/Books/BookRepository.cs +++ b/src/Lumina.DataAccess/Core/Repositories/Books/BookRepository.cs @@ -15,6 +15,8 @@ using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Expressions; +using System.Reflection; using System.Threading; using System.Threading.Tasks; #endregion @@ -26,6 +28,10 @@ namespace Lumina.DataAccess.Core.Repositories.Books; /// internal sealed class BookRepository : IBookRepository { + private static readonly MethodInfo s_toLowerMethod = typeof(string).GetMethod(nameof(string.ToLower), Type.EmptyTypes)!; + private static readonly MethodInfo s_startsWithMethod = typeof(string).GetMethod(nameof(string.StartsWith), [typeof(string)])!; + private static readonly MethodInfo s_substringMethod = typeof(string).GetMethod(nameof(string.Substring), [typeof(int)])!; + private readonly LuminaDbContext _luminaDbContext; /// @@ -126,7 +132,7 @@ internal sealed class BookRepository : IBookRepository booksQuery = booksQuery.Where(filterSpecification.ToExpression()); // apply sorting based on the specified sortBy and sortOrder parameters - booksQuery = ApplySorting(booksQuery, sortBy, sortOrder ?? SortOrder.Ascending); + booksQuery = ApplySorting(booksQuery, sortBy, sortOrder ?? SortOrder.Ascending, libraryFilter.IgnoreThePrefixForAlphaPicker); // if no pagination was requested, return all the books of the library if (paginationData is null) @@ -255,7 +261,8 @@ internal sealed class BookRepository : IBookRepository /// The query to sort. /// The field to sort by (case-insensitive). /// The direction of the sorting. - private static IOrderedQueryable ApplySorting(IQueryable booksQuery, string? sortBy, SortOrder sortOrder) + /// Whether a leading "the " prefix of a title is ignored when deriving the title sort key, or not. + private static IOrderedQueryable ApplySorting(IQueryable booksQuery, string? sortBy, SortOrder sortOrder, bool ignoreThePrefixForAlphaPicker) { return sortBy?.ToLower() switch { @@ -269,11 +276,46 @@ internal sealed class BookRepository : IBookRepository ? booksQuery.OrderByDescending(book => book.MetadataProvider) : booksQuery.OrderBy(book => book.MetadataProvider), _ => sortOrder == SortOrder.Descending - ? booksQuery.OrderByDescending(book => book.Title) - : booksQuery.OrderBy(book => book.Title), + ? booksQuery.OrderByDescending(BuildTitleSortKey(ignoreThePrefixForAlphaPicker)) + : booksQuery.OrderBy(BuildTitleSortKey(ignoreThePrefixForAlphaPicker)), }; } + /// + /// Builds the expression that derives the title sort key of a book, matching the effective title used by the alpha filter: + /// the title lowercased, falling back to the original title when the title is or empty, and optionally + /// stripped of a leading "the " prefix. + /// + /// Whether a leading "the " prefix of a title is ignored when deriving the title sort key, or not. + /// An expression that evaluates to the title sort key of a book. + private static Expression> BuildTitleSortKey(bool ignoreThePrefixForAlphaPicker) + { + ParameterExpression book = Expression.Parameter(typeof(BookEntity), "book"); + + Expression titleProperty = Expression.Property(book, nameof(BookEntity.Title)); + + // the raw title: the title, unless it is null or empty, in which case the original title (or an empty string) is used + BinaryExpression isTitleMissing = Expression.OrElse( + Expression.Equal(titleProperty, Expression.Constant(null, typeof(string))), + Expression.Equal(titleProperty, Expression.Constant(string.Empty))); + Expression rawTitle = Expression.Condition(isTitleMissing, + Expression.Coalesce(Expression.Property(book, nameof(BookEntity.OriginalTitle)), Expression.Constant(string.Empty)), + titleProperty); + + MethodCallExpression lowerTitle = Expression.Call(rawTitle, s_toLowerMethod); + + // when ignoring the "The " prefix, strip a leading "the " from the lowercased title + Expression effectiveTitle = lowerTitle; + if (ignoreThePrefixForAlphaPicker) + { + MethodCallExpression startsWithThe = Expression.Call(lowerTitle, s_startsWithMethod, Expression.Constant("the ")); + MethodCallExpression strippedTitle = Expression.Call(lowerTitle, s_substringMethod, Expression.Constant(4)); + effectiveTitle = Expression.Condition(startsWithThe, strippedTitle, lowerTitle); + } + + return Expression.Lambda>(effectiveTitle, book); + } + /// /// Builds a filter specification for querying books. /// diff --git a/src/Lumina.Presentation.Web/Common/Enums/Common/SortOrder.cs b/src/Lumina.Presentation.Web/Common/Enums/Common/SortOrder.cs new file mode 100644 index 00000000..91482437 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Enums/Common/SortOrder.cs @@ -0,0 +1,17 @@ +namespace Lumina.Presentation.Web.Common.Enums.Common; + +/// +/// Enumeration for the sort order. +/// +public enum SortOrder +{ + /// + /// Ascending order. + /// + Ascending, + + /// + /// Descending order. + /// + Descending +} diff --git a/src/Lumina.Presentation.Web/Common/Models/Libraries/BookLibraryItemsQueryModel.cs b/src/Lumina.Presentation.Web/Common/Models/Libraries/BookLibraryItemsQueryModel.cs new file mode 100644 index 00000000..3cfe6f3e --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Models/Libraries/BookLibraryItemsQueryModel.cs @@ -0,0 +1,56 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Enums.Common; +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Models.Libraries; + +/// +/// Represents the query parameters used to retrieve the lightweight details of the books of a media library. +/// +[DebuggerDisplay("LibraryId: {LibraryId}")] +public class BookLibraryItemsQueryModel +{ + /// + /// Gets or sets the Id of the media library whose books are retrieved. + /// + public Guid LibraryId { get; set; } + + /// + /// Gets or sets the page of results to retrieve. + /// + public int? CurrentPage { get; set; } + + /// + /// Gets or sets the maximum number of books to retrieve per page. + /// + public int? PerPage { get; set; } + + /// + /// Gets or sets the search term used to filter results. + /// + public string? SearchTerm { get; set; } + + /// + /// Gets or sets the alpha key used to filter the results by the first character of their title, for the alpha picker. + /// Can be to disable alpha filtering, a single ASCII letter (case-insensitive) to filter by that letter, + /// "#" to filter by titles whose first character is a digit, or "*" to filter by titles whose first character is neither a letter nor a digit. + /// + public string? FilterAlphaKey { get; set; } + + /// + /// Gets or sets whether the leading "The " prefix of a title is ignored when computing the alpha key, or not. + /// + public bool IgnoreThePrefixForAlphaPicker { get; set; } + + /// + /// Gets or sets the name of the field by which to sort the results. + /// + public string? SortBy { get; set; } + + /// + /// Gets or sets the direction in which to sort the results. + /// + public SortOrder? SortOrder { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/Models/Libraries/BookLiteModel.cs b/src/Lumina.Presentation.Web/Common/Models/Libraries/BookLiteModel.cs new file mode 100644 index 00000000..ee124a74 --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Models/Libraries/BookLiteModel.cs @@ -0,0 +1,33 @@ +#region ========================================================================= USING ===================================================================================== +using System; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Models.Libraries; + +/// +/// Represents a lightweight book element, containing only the properties needed by the client for card-style navigation. +/// +[DebuggerDisplay("Title: {Title}")] +public class BookLiteModel +{ + /// + /// Gets or sets the Id of the book. + /// + public Guid Id { get; set; } + + /// + /// Gets or sets the title of the book. + /// + public string Title { get; set; } = string.Empty; + + /// + /// Gets or sets the release year of the book (re-release year, if available, or original release year), if known. + /// + public int? ReleaseYear { get; set; } + + /// + /// Gets or sets the path of the image representing the cover of the book, if available. + /// + public string? CoverPath { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Common/Models/Libraries/PaginatedBookLiteModel.cs b/src/Lumina.Presentation.Web/Common/Models/Libraries/PaginatedBookLiteModel.cs new file mode 100644 index 00000000..daed24fd --- /dev/null +++ b/src/Lumina.Presentation.Web/Common/Models/Libraries/PaginatedBookLiteModel.cs @@ -0,0 +1,38 @@ +#region ========================================================================= USING ===================================================================================== +using System.Collections.Generic; +using System.Diagnostics; +#endregion + +namespace Lumina.Presentation.Web.Common.Models.Libraries; + +/// +/// Represents a paginated collection of lightweight book elements, together with pagination metadata. +/// +[DebuggerDisplay("CurrentPage: {CurrentPage}; Count: {Count}")] +public class PaginatedBookLiteModel +{ + /// + /// Gets or sets the collection of lightweight book elements associated with this instance. + /// + public IReadOnlyList Data { get; set; } = []; + + /// + /// Gets or sets the current page number in a paginated collection. + /// + public int CurrentPage { get; set; } + + /// + /// Gets or sets the number of items to include per page in paginated results. + /// + public int PerPage { get; set; } + + /// + /// Gets or sets the total number of elements available in the paginated result set. + /// + public int Count { get; set; } + + /// + /// Gets or sets the total number of pages based on elements available in the result set and per page. + /// + public int NumberOfPages { get; set; } +} diff --git a/src/Lumina.Presentation.Web/Controllers/Library/WrittenContentLibrary/BookLibrary/BooksController.cs b/src/Lumina.Presentation.Web/Controllers/Library/WrittenContentLibrary/BookLibrary/BooksController.cs index aab488d4..fa138956 100644 --- a/src/Lumina.Presentation.Web/Controllers/Library/WrittenContentLibrary/BookLibrary/BooksController.cs +++ b/src/Lumina.Presentation.Web/Controllers/Library/WrittenContentLibrary/BookLibrary/BooksController.cs @@ -1,22 +1,92 @@ +#region ========================================================================= USING ===================================================================================== +using Lumina.Presentation.Web.Common.Api; +using Lumina.Presentation.Web.Common.Models.Libraries; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +#endregion namespace Lumina.Presentation.Web.Controllers.Library.WrittenContentLibrary.BookLibrary; +/// +/// Controller for books related operations. +/// [Authorize] -[Route("{culture}library/written-content-library/books-library/books")] +[Route("{culture}/library/written-content-library/books-library/books")] public class BooksController : Controller { - [HttpGet("")] - public IActionResult Index() + private readonly IApiHttpClient _apiHttpClient; + + /// + /// Initializes a new instance of the class. + /// + /// Injected service for interactions with the API. + public BooksController(IApiHttpClient apiHttpClient) { - return View("/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.cshtml"); + _apiHttpClient = apiHttpClient; } + /// + /// Displays the view for browsing the books of a media library. + /// + /// The Id of the media library whose books are browsed. + /// Cancellation token that can be used to stop the execution. + [HttpGet("")] + public async Task Index(Guid? libraryId, CancellationToken cancellationToken = default) + { + if (libraryId is null) + return RedirectToAction("Index", "Home"); + + LibraryModel library = await _apiHttpClient.GetAsync($"libraries/{libraryId}", cancellationToken).ConfigureAwait(false); + return View("/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.cshtml", library); + } + + /// + /// Gets the lightweight details of the books of a media library. + /// + /// The model containing the parameters used to retrieve the books. + /// Cancellation token that can be used to stop the execution. + [HttpGet("api-get-library-items")] + public async Task GetLibraryItems([FromQuery] BookLibraryItemsQueryModel query, CancellationToken cancellationToken = default) + { + PaginatedBookLiteModel response = await _apiHttpClient.GetAsync(BuildItemsEndpoint(query), cancellationToken).ConfigureAwait(false); + return Json(new { success = true, data = response }); + } + + /// + /// Displays the view for a single book. + /// + /// The Id of the book to display. [HttpGet("{id}")] public IActionResult EditBook(Guid id) { return View("/Views/Library/WrittenContentLibrary/BookLibrary/Books/Item.cshtml"); } + + /// + /// Builds the API endpoint used to retrieve the lightweight details of the books of a media library, from the provided . + /// + /// The model containing the parameters used to retrieve the books. + /// The API endpoint to which the retrieval request is sent. + private static string BuildItemsEndpoint(BookLibraryItemsQueryModel query) + { + StringBuilder endpoint = new($"books/lite?libraryId={query.LibraryId}"); + if (query.CurrentPage is not null) + endpoint.Append($"¤tPage={query.CurrentPage}"); + if (query.PerPage is not null) + endpoint.Append($"&perPage={query.PerPage}"); + if (!string.IsNullOrWhiteSpace(query.SearchTerm)) + endpoint.Append($"&searchTerm={Uri.EscapeDataString(query.SearchTerm)}"); + if (!string.IsNullOrWhiteSpace(query.FilterAlphaKey)) + endpoint.Append($"&filterAlphaKey={Uri.EscapeDataString(query.FilterAlphaKey)}"); + endpoint.Append($"&ignoreThePrefixForAlphaPicker={query.IgnoreThePrefixForAlphaPicker}"); + if (!string.IsNullOrWhiteSpace(query.SortBy)) + endpoint.Append($"&sortBy={Uri.EscapeDataString(query.SortBy)}"); + if (query.SortOrder is not null) + endpoint.Append($"&sortOrder={query.SortOrder}"); + return endpoint.ToString(); + } } diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.de-DE.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.de-DE.resx new file mode 100644 index 00000000..e2208b8a --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.de-DE.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Suchen + + + Sortieren: A-Z + + + Sortieren: Z-A + + + Einträge + + + von + + + Seite + + + Zurück + + + Weiter + + + Alle + + + Diese Bibliothek hat keine Einträge + + + Keine Einträge entsprechen den aktuellen Filtern + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.en-US.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.en-US.resx new file mode 100644 index 00000000..f44c8d5a --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.en-US.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Search + + + Sort: A-Z + + + Sort: Z-A + + + items + + + of + + + Page + + + Previous + + + Next + + + All + + + This library has no items + + + No items match the current filters + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.es-ES.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.es-ES.resx new file mode 100644 index 00000000..ae88931b --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.es-ES.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Buscar + + + Ordenar: A-Z + + + Ordenar: Z-A + + + elementos + + + de + + + Página + + + Anterior + + + Siguiente + + + Todos + + + Esta biblioteca no tiene elementos + + + Ningún elemento coincide con los filtros actuales + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.fr-FR.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.fr-FR.resx new file mode 100644 index 00000000..5797b42e --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.fr-FR.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Rechercher + + + Trier : A-Z + + + Trier : Z-A + + + éléments + + + sur + + + Page + + + Précédent + + + Suivant + + + Tous + + + Cette bibliothèque ne contient aucun élément + + + Aucun élément ne correspond aux filtres actuels + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.it-IT.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.it-IT.resx new file mode 100644 index 00000000..78cd6fbe --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.it-IT.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cerca + + + Ordina: A-Z + + + Ordina: Z-A + + + elementi + + + di + + + Pagina + + + Precedente + + + Successivo + + + Tutti + + + Questa biblioteca non contiene elementi + + + Nessun elemento corrisponde ai filtri correnti + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ja-JP.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ja-JP.resx new file mode 100644 index 00000000..2855a774 --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ja-JP.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 検索 + + + 並べ替え: A-Z + + + 並べ替え: Z-A + + + 件 + + + / + + + ページ + + + 前へ + + + 次へ + + + すべて + + + このライブラリには項目がありません + + + 現在のフィルターに一致する項目はありません + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.resx new file mode 100644 index 00000000..f44c8d5a --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Search + + + Sort: A-Z + + + Sort: Z-A + + + items + + + of + + + Page + + + Previous + + + Next + + + All + + + This library has no items + + + No items match the current filters + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ro-RO.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ro-RO.resx new file mode 100644 index 00000000..cec2e1d0 --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ro-RO.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Caută + + + Sortare: A-Z + + + Sortare: Z-A + + + elemente + + + din + + + Pagina + + + Înapoi + + + Înainte + + + Toate + + + Această bibliotecă nu are elemente + + + Niciun element nu corespunde filtrelor curente + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ru-RU.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ru-RU.resx new file mode 100644 index 00000000..a3c04101 --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.ru-RU.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Поиск + + + Сортировка: А-Я + + + Сортировка: Я-А + + + элементов + + + из + + + Страница + + + Назад + + + Вперёд + + + Все + + + В этой библиотеке нет элементов + + + Ни один элемент не соответствует текущим фильтрам + + diff --git a/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.zh-CN.resx b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.zh-CN.resx new file mode 100644 index 00000000..d8e628ba --- /dev/null +++ b/src/Lumina.Presentation.Web/Resources/Views/Library/WrittenContentLibrary/BookLibrary/Books/Index.zh-CN.resx @@ -0,0 +1,48 @@ + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 搜索 + + + 排序: A-Z + + + 排序: Z-A + + + 项 + + + / + + + 页 + + + 上一页 + + + 下一页 + + + 全部 + + + 此库中没有项目 + + + 没有项目符合当前筛选条件 + + diff --git a/src/Lumina.Presentation.Web/Views/Home/Index.cshtml b/src/Lumina.Presentation.Web/Views/Home/Index.cshtml index d2b384d7..09a2baa7 100644 --- a/src/Lumina.Presentation.Web/Views/Home/Index.cshtml +++ b/src/Lumina.Presentation.Web/Views/Home/Index.cshtml @@ -27,11 +27,15 @@ +} diff --git a/src/Lumina.Presentation.Web/wwwroot/css/site.css b/src/Lumina.Presentation.Web/wwwroot/css/site.css index c1d39e58..a3df496f 100644 --- a/src/Lumina.Presentation.Web/wwwroot/css/site.css +++ b/src/Lumina.Presentation.Web/wwwroot/css/site.css @@ -1488,6 +1488,25 @@ th, td { margin-left: auto !important; } +.alpha-picker { + display: flex; + flex-direction: column; + gap: 0.1rem; + overflow-y: auto; +} + +.alpha-key { + padding: 0 0.6rem; + cursor: pointer; + text-align: center; + user-select: none; +} + + .alpha-key:hover, + .alpha-key.alpha-key-active { + background-color: #00000066; + } + /* For phones */ @media only screen and (max-width: 768px) { main { diff --git a/src/Lumina.Presentation.Web/wwwroot/images/ui/book-placeholder.svg b/src/Lumina.Presentation.Web/wwwroot/images/ui/book-placeholder.svg new file mode 100644 index 00000000..4d3b03d1 --- /dev/null +++ b/src/Lumina.Presentation.Web/wwwroot/images/ui/book-placeholder.svg @@ -0,0 +1,8 @@ + + + + + + + +