feat: redesign Letzshop products tab with product listing view

Products Tab Changes:
- Converted to product listing page similar to /admin/marketplace-products
- Added Import/Export buttons in header
- Added product stats cards (total, active, inactive, last sync)
- Added search and filter functionality
- Added product table with pagination
- Import modal for single URL or all languages

Settings Tab Changes:
- Moved batch size setting from products tab
- Moved include inactive checkbox from products tab
- Added export behavior info box

Export Changes:
- New POST endpoint exports all languages (FR, DE, EN)
- CSV files written to exports/letzshop/{vendor_code}/ for scheduler pickup
- Letzshop scheduler can fetch files from this location

API Changes:
- Added vendor_id filter to /admin/vendor-products/stats endpoint
- Added POST /admin/vendors/{id}/export/letzshop for folder export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-20 21:44:59 +01:00
parent 44c11181fd
commit d46b676e77
6 changed files with 692 additions and 258 deletions

View File

@@ -1,5 +1,6 @@
{# app/templates/admin/partials/letzshop-settings-tab.html #}
{# Settings tab for admin Letzshop management - API credentials and CSV URLs #}
{# Settings tab for admin Letzshop management - API credentials, CSV URLs, Import/Export settings #}
{% from 'shared/macros/inputs.html' import number_stepper %}
<div class="grid gap-6 lg:grid-cols-2">
<!-- API Configuration Card -->
@@ -236,6 +237,75 @@
</div>
</div>
<!-- Import/Export Settings Card -->
<div class="bg-white rounded-lg shadow-xs dark:bg-gray-800">
<div class="p-6">
<h3 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
Import / Export Settings
</h3>
<p class="text-sm text-gray-600 dark:text-gray-400 mb-6">
Configure settings for product import and export operations.
</p>
<!-- Import Settings -->
<div class="mb-6">
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3 flex items-center">
<span x-html="$icon('cloud-download', 'w-4 h-4 mr-2 text-purple-500')"></span>
Import Settings
</h4>
<div class="pl-6">
<label class="block text-sm font-medium text-gray-700 dark:text-gray-400 mb-2">
Batch Size
</label>
{{ number_stepper(model='importForm.batch_size', min=100, max=5000, step=100, label='Batch Size') }}
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">
Products processed per batch (100-5000). Higher = faster but more memory.
</p>
</div>
</div>
<!-- Export Settings -->
<div class="border-t border-gray-200 dark:border-gray-600 pt-6">
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3 flex items-center">
<span x-html="$icon('upload', 'w-4 h-4 mr-2 text-green-500')"></span>
Export Settings
</h4>
<div class="pl-6">
<label class="flex items-center cursor-pointer">
<input
type="checkbox"
x-model="exportIncludeInactive"
class="form-checkbox h-5 w-5 text-purple-600 rounded border-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:ring-purple-500"
/>
<span class="ml-3 text-sm font-medium text-gray-700 dark:text-gray-400">Include inactive products</span>
</label>
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400 ml-8">
Export products that are currently marked as inactive
</p>
</div>
</div>
<!-- Export Info Box -->
<div class="mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg">
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Export Behavior</h4>
<ul class="text-xs text-gray-500 dark:text-gray-400 space-y-1">
<li class="flex items-center">
<span x-html="$icon('check', 'w-3 h-3 mr-2 text-green-500')"></span>
Exports all languages (FR, DE, EN) automatically
</li>
<li class="flex items-center">
<span x-html="$icon('check', 'w-3 h-3 mr-2 text-green-500')"></span>
CSV files are placed in a folder for Letzshop pickup
</li>
<li class="flex items-center">
<span x-html="$icon('check', 'w-3 h-3 mr-2 text-green-500')"></span>
Letzshop scheduler fetches files periodically
</li>
</ul>
</div>
</div>
</div>
<!-- Carrier Settings Card -->
<div class="bg-white rounded-lg shadow-xs dark:bg-gray-800 lg:col-span-2">
<div class="p-6">