diff --git a/.dockerignore b/.dockerignore index bee8a64..2c80c9c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ __pycache__ +static/globals.css diff --git a/Dockerfile b/Dockerfile index f3c9b99..c2b2877 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,10 +25,10 @@ COPY --from=0 /app/node_modules/ node_modules/ COPY alembic/ alembic/ COPY alembic.ini alembic.ini COPY styles/ styles/ +COPY static/ static/ COPY templates/ templates/ COPY app/ app/ -RUN mkdir static RUN /bin/tailwindcss -i styles/globals.css -o static/globals.css -m ENV SERVER_PORT=8000 diff --git a/app/routers/search.py b/app/routers/search.py index a9808d9..ba1bf48 100644 --- a/app/routers/search.py +++ b/app/routers/search.py @@ -155,19 +155,22 @@ async def delete_request( DetailedUser, Depends(get_authenticated_user(GroupEnum.admin)) ], session: Annotated[Session, Depends(get_session)], + downloaded: Optional[bool] = None, ): books = session.exec(select(BookRequest).where(BookRequest.asin == asin)).all() if books: [session.delete(b) for b in books] session.commit() - books = get_wishlist_books(session, None) + books = get_wishlist_books( + session, None, "downloaded" if downloaded else "not_downloaded" + ) return template_response( - "wishlist.html", + "wishlist_page/wishlist.html", request, admin_user, - {"books": books}, + {"books": books, "page": "downloaded" if downloaded else "wishlist"}, block_name="book_wishlist", ) diff --git a/templates/wishlist_page/manual.html b/templates/wishlist_page/manual.html index c8ce63a..0186468 100644 --- a/templates/wishlist_page/manual.html +++ b/templates/wishlist_page/manual.html @@ -16,8 +16,8 @@ - {% block book_wishlist %} + {% block book_wishlist %} {% for book in books %} diff --git a/templates/wishlist_page/wishlist.html b/templates/wishlist_page/wishlist.html index 5a0361c..3ae2399 100644 --- a/templates/wishlist_page/wishlist.html +++ b/templates/wishlist_page/wishlist.html @@ -3,7 +3,8 @@ {% endblock %} {% block content %}
- + {% block book_wishlist %} +
@@ -17,7 +18,7 @@ - {% block book_wishlist %} {% if not books %} + {% if not books and page.__eq__("wishlist") %} {% endif %} - + {% for book in books %} @@ -118,7 +119,7 @@ title="Remove" class="btn btn-square" {% if not user.is_admin() %}disabled{% endif %} - hx-delete="/search/request/{{ book.asin }}" + hx-delete="/search/request/{{ book.asin }}{% if page.__eq__('downloaded') %}?downloaded=true{% endif %}" hx-swap="outerHTML" hx-target="#book-table-body" hx-disabled-elt="this"
{{ loop.index }}