Files
orion/app/templates/admin/vendor-themes.html
Samir Boulahtit bb2e5fd260 refactor: standardize admin templates with shared macros
Migrate all admin templates to use standardized components:
- Use tabs macros (tabs_nav, tab_button) for tab navigation
- Use number_stepper for quantity/numeric inputs
- Use headers macros for consistent page layouts
- Use modals macros for dialog components

Affected pages: dashboard, settings, logs, content-pages, companies,
vendors, users, imports, marketplace, code-quality, and more.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:43 +01:00

81 lines
3.4 KiB
HTML

{# app/templates/admin/vendor-themes.html #}
{% extends "admin/base.html" %}
{% from 'shared/macros/headers.html' import page_header %}
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
{% block title %}Vendor Themes{% endblock %}
{% block alpine_data %}adminVendorThemes(){% endblock %}
{% block content %}
{{ page_header('Vendor Themes', subtitle='Customize vendor theme colors and branding') }}
<!-- Vendor Selection -->
<div class="px-4 py-6 mb-6 bg-white rounded-lg shadow-md dark:bg-gray-800">
<h3 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
Select Vendor
</h3>
<p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
Choose a vendor to customize their theme
</p>
<div class="max-w-md">
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
Vendor
</label>
<select
x-model="selectedVendorCode"
@change="navigateToTheme()"
class="block w-full px-3 py-2 text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-600"
>
<option value="">Select a vendor...</option>
<template x-for="vendor in vendors" :key="vendor.vendor_code">
<option :value="vendor.vendor_code" x-text="`${vendor.name} (${vendor.vendor_code})`"></option>
</template>
</select>
</div>
</div>
{{ loading_state('Loading vendors...') }}
{{ error_state('Error loading vendors') }}
<!-- Vendors List -->
<div x-show="!loading && vendors.length > 0">
<div class="px-4 py-3 bg-white rounded-lg shadow-md dark:bg-gray-800">
<h3 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
All Vendors
</h3>
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
<template x-for="vendor in vendors" :key="vendor.vendor_code">
<a
:href="`/admin/vendors/${vendor.vendor_code}/theme`"
class="block p-4 border border-gray-200 dark:border-gray-700 rounded-lg hover:border-purple-500 dark:hover:border-purple-500 hover:shadow-md transition-all"
>
<div class="flex items-center justify-between mb-2">
<h4 class="font-semibold text-gray-700 dark:text-gray-200" x-text="vendor.name"></h4>
<span x-html="$icon('color-swatch', 'w-5 h-5 text-purple-600')"></span>
</div>
<p class="text-sm text-gray-600 dark:text-gray-400" x-text="vendor.vendor_code"></p>
<div class="mt-3 flex items-center text-xs text-purple-600 dark:text-purple-400">
<span>Customize theme</span>
<span x-html="$icon('chevron-right', 'w-4 h-4 ml-1')"></span>
</div>
</a>
</template>
</div>
</div>
</div>
<!-- Empty State -->
<div x-show="!loading && vendors.length === 0" class="text-center py-12">
<span x-html="$icon('shopping-bag', 'inline w-12 h-12 text-gray-400 mb-4')"></span>
<p class="text-gray-600 dark:text-gray-400">No vendors found</p>
</div>
{% endblock %}
{% block extra_scripts %}
<script src="{{ url_for('static', path='admin/js/vendor-themes.js') }}"></script>
{% endblock %}