mirror of
https://github.com/markbeep/AudioBookRequest.git
synced 2026-01-07 14:10:08 -06:00
fix missing template
This commit is contained in:
@@ -1 +1,2 @@
|
||||
__pycache__
|
||||
static/globals.css
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
)
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% block book_wishlist %}
|
||||
|
||||
{% block book_wishlist %}
|
||||
<tbody id="book-table-body">
|
||||
{% for book in books %}
|
||||
<tr class="text-xs lg:text-sm" id="{{ book.asin }}">
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
{% endblock %} {% block content %}
|
||||
|
||||
<div class="overflow-x-auto h-[75vh] border-b pb-2 border-b-base-200">
|
||||
<table class="table table-pin-rows min-w-[60rem]">
|
||||
{% block book_wishlist %}
|
||||
<table id="book-table-body" class="table table-pin-rows min-w-[60rem]">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
@@ -17,7 +18,7 @@
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% block book_wishlist %} {% if not books %}
|
||||
{% if not books and page.__eq__("wishlist") %}
|
||||
<div role="alert" class="alert my-2">
|
||||
<span class="stroke-info h-6 w-6 shrink-0"
|
||||
>{% include 'icons/info-circle.html' %}</span
|
||||
@@ -28,7 +29,7 @@
|
||||
>
|
||||
</div>
|
||||
{% endif %}
|
||||
<tbody id="book-table-body">
|
||||
<tbody>
|
||||
{% for book in books %}
|
||||
<tr class="text-xs lg:text-sm" id="{{ book.asin }}">
|
||||
<th>{{ loop.index }}</th>
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user