feat: add /admin/letzshop/products/{id} route for product details
- Add new route that mirrors the letzshop orders pattern - Update product links in letzshop-products-tab.html to use new route 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -710,6 +710,31 @@ async def admin_letzshop_order_detail_page(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get(
|
||||||
|
"/letzshop/products/{product_id}",
|
||||||
|
response_class=HTMLResponse,
|
||||||
|
include_in_schema=False,
|
||||||
|
)
|
||||||
|
async def admin_letzshop_product_detail_page(
|
||||||
|
request: Request,
|
||||||
|
product_id: int = Path(..., description="Marketplace Product ID"),
|
||||||
|
current_user: User = Depends(get_current_admin_from_cookie_or_header),
|
||||||
|
db: Session = Depends(get_db),
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
Render Letzshop product detail page.
|
||||||
|
Shows full product information from the marketplace.
|
||||||
|
"""
|
||||||
|
return templates.TemplateResponse(
|
||||||
|
"admin/marketplace-product-detail.html",
|
||||||
|
{
|
||||||
|
"request": request,
|
||||||
|
"user": current_user,
|
||||||
|
"product_id": product_id,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# PRODUCT CATALOG ROUTES
|
# PRODUCT CATALOG ROUTES
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|||||||
@@ -181,7 +181,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Product Details -->
|
<!-- Product Details -->
|
||||||
<div class="min-w-0">
|
<div class="min-w-0">
|
||||||
<a :href="'/admin/marketplace-products/' + product.id" class="font-semibold text-sm truncate max-w-xs hover:text-purple-600 dark:hover:text-purple-400" x-text="product.title || 'Untitled'"></a>
|
<a :href="'/admin/letzshop/products/' + product.id" class="font-semibold text-sm truncate max-w-xs hover:text-purple-600 dark:hover:text-purple-400" x-text="product.title || 'Untitled'"></a>
|
||||||
<p class="text-xs text-gray-500 dark:text-gray-400" x-text="product.brand || 'No brand'"></p>
|
<p class="text-xs text-gray-500 dark:text-gray-400" x-text="product.brand || 'No brand'"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -229,7 +229,7 @@
|
|||||||
<td class="px-4 py-3 text-sm">
|
<td class="px-4 py-3 text-sm">
|
||||||
<div class="flex items-center space-x-2">
|
<div class="flex items-center space-x-2">
|
||||||
<a
|
<a
|
||||||
:href="'/admin/marketplace-products/' + product.id"
|
:href="'/admin/letzshop/products/' + product.id"
|
||||||
class="flex items-center justify-center px-2 py-1 text-xs font-medium leading-5 text-purple-600 rounded-lg dark:text-purple-400 focus:outline-none hover:bg-gray-100 dark:hover:bg-gray-700"
|
class="flex items-center justify-center px-2 py-1 text-xs font-medium leading-5 text-purple-600 rounded-lg dark:text-purple-400 focus:outline-none hover:bg-gray-100 dark:hover:bg-gray-700"
|
||||||
title="View Details"
|
title="View Details"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user