Multitenant implementation with custom Domain, theme per vendor
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -12,22 +12,26 @@
|
||||
<h2 class="text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
||||
Icons Browser
|
||||
</h2>
|
||||
<a href="/admin/dashboard" class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-800 dark:border-gray-600 dark:hover:bg-gray-700">
|
||||
<a href="/admin/dashboard"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-800 dark:border-gray-600 dark:hover:bg-gray-700">
|
||||
<span x-html="$icon('arrow-left', 'w-4 h-4 mr-2')"></span>
|
||||
Back to Dashboard
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Introduction -->
|
||||
<div class="mb-8 p-6 bg-gradient-to-r from-indigo-600 to-purple-600 rounded-lg shadow-lg text-white">
|
||||
<!-- Introduction Card -->
|
||||
<div class="bg-gradient-to-r from-purple-600 to-indigo-600 rounded-lg shadow-lg p-6 mb-8">
|
||||
<div class="flex items-start">
|
||||
<span x-html="$icon('photograph', 'w-10 h-10 mr-4 flex-shrink-0')"></span>
|
||||
<div>
|
||||
<h3 class="text-xl font-bold mb-2">Icon Library</h3>
|
||||
<p class="text-indigo-100 mb-3">
|
||||
Browse all <span x-text="allIcons.length"></span> available icons. Click any icon to copy its name or usage code.
|
||||
<div class="flex-shrink-0 text-gray-700 dark:text-gray-200">
|
||||
<span x-html="$icon('photograph', 'w-12 h-12')"></span>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<h3 class="text-xl font-bold mb-2 text-gray-700 dark:text-gray-200">Icon Library</h3>
|
||||
<p class="text-gray-700 dark:text-gray-200 opacity-90">
|
||||
Browse all <span x-text="allIcons.length"></span> available icons. Click any icon to copy its name or
|
||||
usage code.
|
||||
</p>
|
||||
<div class="flex items-center gap-4 text-sm">
|
||||
<div class="flex items-center gap-4 text-sm text-gray-700 dark:text-gray-200 opacity-90">
|
||||
<div class="flex items-center">
|
||||
<span x-html="$icon('check-circle', 'w-4 h-4 mr-1')"></span>
|
||||
<span>Heroicons</span>
|
||||
@@ -46,270 +50,279 @@
|
||||
</div>
|
||||
|
||||
<!-- Search and Filter -->
|
||||
<div class="mb-6 bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
||||
<div class="flex flex-col md:flex-row gap-4">
|
||||
<!-- Search Box -->
|
||||
<div class="flex-1">
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
Search Icons
|
||||
</label>
|
||||
<div class="relative">
|
||||
<div class="mb-6 bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
||||
<div class="flex flex-col md:flex-row gap-4">
|
||||
<!-- Search Box -->
|
||||
<div class="flex-1">
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
Search Icons
|
||||
</label>
|
||||
<div class="relative">
|
||||
<span class="absolute inset-y-0 left-0 flex items-center pl-3">
|
||||
<span x-html="$icon('search', 'w-5 h-5 text-gray-400')"></span>
|
||||
</span>
|
||||
<input
|
||||
<input
|
||||
type="text"
|
||||
x-model="searchQuery"
|
||||
@input="filterIcons()"
|
||||
placeholder="Type to search... (e.g., 'user', 'arrow', 'check')"
|
||||
class="w-full pl-10 pr-4 py-2 text-sm border border-gray-300 rounded-lg focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:bg-gray-700 dark:border-gray-600 dark:text-gray-300"
|
||||
/>
|
||||
</div>
|
||||
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">
|
||||
Found <span x-text="filteredIcons.length"></span> icon(s)
|
||||
</p>
|
||||
/>
|
||||
</div>
|
||||
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">
|
||||
Found <span x-text="filteredIcons.length"></span> icon(s)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Category Pills -->
|
||||
<div class="flex-1">
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
Filter by Category
|
||||
</label>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<template x-for="category in categories.slice(0, 6)" :key="category.id">
|
||||
<button
|
||||
<!-- Category Pills -->
|
||||
<div class="flex-1">
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
Filter by Category
|
||||
</label>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<template x-for="category in categories.slice(0, 6)" :key="category.id">
|
||||
<button
|
||||
@click="setCategory(category.id)"
|
||||
class="inline-flex items-center px-3 py-1 text-xs font-medium rounded-full transition-colors"
|
||||
:class="activeCategory === category.id
|
||||
? 'bg-purple-600 text-white'
|
||||
: 'bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600'"
|
||||
>
|
||||
<span x-html="$icon(category.icon, 'w-3 h-3 mr-1')"></span>
|
||||
<span x-text="category.name"></span>
|
||||
<span class="ml-1 opacity-75" x-text="'(' + getCategoryCount(category.id) + ')'"></span>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
>
|
||||
<span x-html="$icon(category.icon, 'w-3 h-3 mr-1')"></span>
|
||||
<span x-text="category.name"></span>
|
||||
<span class="ml-1 opacity-75" x-text="'(' + getCategoryCount(category.id) + ')'"></span>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- All Categories (Expandable) -->
|
||||
<div class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-700">
|
||||
<details class="group">
|
||||
<summary class="cursor-pointer text-sm font-medium text-purple-600 dark:text-purple-400 hover:text-purple-700 flex items-center">
|
||||
<span x-html="$icon('chevron-right', 'w-4 h-4 mr-1 group-open:rotate-90 transition-transform')"></span>
|
||||
Show All Categories
|
||||
</summary>
|
||||
<div class="mt-3 flex flex-wrap gap-2">
|
||||
<template x-for="category in categories" :key="category.id">
|
||||
<button
|
||||
<!-- All Categories (Expandable) -->
|
||||
<div class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-700">
|
||||
<details class="group">
|
||||
<summary
|
||||
class="cursor-pointer text-sm font-medium text-purple-600 dark:text-purple-400 hover:text-purple-700 flex items-center">
|
||||
<span x-html="$icon('chevron-right', 'w-4 h-4 mr-1 group-open:rotate-90 transition-transform')"></span>
|
||||
Show All Categories
|
||||
</summary>
|
||||
<div class="mt-3 flex flex-wrap gap-2">
|
||||
<template x-for="category in categories" :key="category.id">
|
||||
<button
|
||||
@click="setCategory(category.id)"
|
||||
class="inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-lg transition-colors"
|
||||
:class="activeCategory === category.id
|
||||
? 'bg-purple-600 text-white'
|
||||
: 'bg-gray-100 text-gray-700 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600'"
|
||||
>
|
||||
<span x-html="$icon(category.icon, 'w-4 h-4 mr-2')"></span>
|
||||
<span x-text="category.name"></span>
|
||||
<span class="ml-2 px-2 py-0.5 bg-black bg-opacity-10 rounded-full" x-text="getCategoryCount(category.id)"></span>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
>
|
||||
<span x-html="$icon(category.icon, 'w-4 h-4 mr-2')"></span>
|
||||
<span x-text="category.name"></span>
|
||||
<span class="ml-2 px-2 py-0.5 bg-black bg-opacity-10 rounded-full"
|
||||
x-text="getCategoryCount(category.id)"></span>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Active Category Info -->
|
||||
<div x-show="activeCategory !== 'all'" class="mb-4 flex items-center justify-between bg-purple-50 dark:bg-purple-900 dark:bg-opacity-20 border border-purple-200 dark:border-purple-700 rounded-lg px-4 py-3">
|
||||
<div class="flex items-center">
|
||||
<span x-html="$icon(getCategoryInfo(activeCategory).icon, 'w-5 h-5 text-purple-600 dark:text-purple-400 mr-2')"></span>
|
||||
<span class="text-sm font-medium text-purple-900 dark:text-purple-200">
|
||||
<!-- Active Category Info -->
|
||||
<div x-show="activeCategory !== 'all'"
|
||||
class="mb-4 flex items-center justify-between bg-purple-50 dark:bg-purple-900 dark:bg-opacity-20 border border-purple-200 dark:border-purple-700 rounded-lg px-4 py-3">
|
||||
<div class="flex items-center">
|
||||
<span x-html="$icon(getCategoryInfo(activeCategory).icon, 'w-5 h-5 text-purple-600 dark:text-purple-400 mr-2')"></span>
|
||||
<span class="text-sm font-medium text-purple-900 dark:text-purple-200">
|
||||
Showing <span x-text="getCategoryInfo(activeCategory).name"></span>
|
||||
(<span x-text="filteredIcons.length"></span> icons)
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
</div>
|
||||
<button
|
||||
@click="setCategory('all')"
|
||||
class="text-sm text-purple-600 dark:text-purple-400 hover:text-purple-700 dark:hover:text-purple-300 flex items-center"
|
||||
>
|
||||
<span x-html="$icon('close', 'w-4 h-4 mr-1')"></span>
|
||||
Clear Filter
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Icons Grid -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
||||
<!-- Empty State -->
|
||||
<div x-show="filteredIcons.length === 0" class="text-center py-12">
|
||||
<span x-html="$icon('exclamation', 'w-16 h-16 mx-auto text-gray-400 mb-4')"></span>
|
||||
<h3 class="text-lg font-semibold text-gray-700 dark:text-gray-300 mb-2">No icons found</h3>
|
||||
<p class="text-gray-500 dark:text-gray-400 mb-4">Try adjusting your search or filter</p>
|
||||
<button
|
||||
@click="searchQuery = ''; setCategory('all')"
|
||||
class="px-4 py-2 text-sm font-medium text-white bg-purple-600 rounded-lg hover:bg-purple-700"
|
||||
>
|
||||
<span x-html="$icon('close', 'w-4 h-4 mr-1')"></span>
|
||||
Clear Filter
|
||||
Clear Filters
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Icons Grid -->
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
||||
<!-- Empty State -->
|
||||
<div x-show="filteredIcons.length === 0" class="text-center py-12">
|
||||
<span x-html="$icon('exclamation', 'w-16 h-16 mx-auto text-gray-400 mb-4')"></span>
|
||||
<h3 class="text-lg font-semibold text-gray-700 dark:text-gray-300 mb-2">No icons found</h3>
|
||||
<p class="text-gray-500 dark:text-gray-400 mb-4">Try adjusting your search or filter</p>
|
||||
<button
|
||||
@click="searchQuery = ''; setCategory('all')"
|
||||
class="px-4 py-2 text-sm font-medium text-white bg-purple-600 rounded-lg hover:bg-purple-700"
|
||||
>
|
||||
Clear Filters
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Icons Grid -->
|
||||
<div x-show="filteredIcons.length > 0" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-3">
|
||||
<template x-for="icon in filteredIcons" :key="icon.name">
|
||||
<div
|
||||
<div x-show="filteredIcons.length > 0"
|
||||
class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-3">
|
||||
<template x-for="icon in filteredIcons" :key="icon.name">
|
||||
<div
|
||||
@click="selectIcon(icon.name)"
|
||||
class="group relative flex flex-col items-center justify-center p-4 bg-gray-50 dark:bg-gray-900 rounded-lg hover:bg-purple-50 dark:hover:bg-purple-900 dark:hover:bg-opacity-20 cursor-pointer transition-all hover:shadow-md border-2 border-transparent hover:border-purple-300 dark:hover:border-purple-700"
|
||||
:class="{ 'border-purple-500 bg-purple-50 dark:bg-purple-900 dark:bg-opacity-30': selectedIcon === icon.name }"
|
||||
>
|
||||
<!-- Icon -->
|
||||
<div class="text-gray-600 dark:text-gray-400 group-hover:text-purple-600 dark:group-hover:text-purple-400 transition-colors">
|
||||
<span x-html="$icon(icon.name, 'w-8 h-8')"></span>
|
||||
</div>
|
||||
|
||||
<!-- Icon Name -->
|
||||
<p class="mt-2 text-xs text-center text-gray-600 dark:text-gray-400 font-mono truncate w-full px-1" :title="icon.name" x-text="icon.name"></p>
|
||||
|
||||
<!-- Hover Actions -->
|
||||
<div class="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-white dark:bg-gray-800 bg-opacity-90 dark:bg-opacity-90 rounded-lg">
|
||||
<div class="flex gap-1">
|
||||
<button
|
||||
@click.stop="copyIconName(icon.name)"
|
||||
class="p-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors"
|
||||
title="Copy name"
|
||||
>
|
||||
<span x-html="$icon('duplicate', 'w-4 h-4')"></span>
|
||||
</button>
|
||||
<button
|
||||
@click.stop="copyIconUsage(icon.name)"
|
||||
class="p-2 bg-indigo-600 text-white rounded hover:bg-indigo-700 transition-colors"
|
||||
title="Copy usage"
|
||||
>
|
||||
<span x-html="$icon('code', 'w-4 h-4')"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Selected Icon Details -->
|
||||
<div x-show="selectedIcon" class="mt-6 bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-4">
|
||||
Selected Icon: <span class="font-mono text-purple-600 dark:text-purple-400" x-text="selectedIcon"></span>
|
||||
</h3>
|
||||
|
||||
<div class="grid md:grid-cols-2 gap-6">
|
||||
<!-- Preview -->
|
||||
<div>
|
||||
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">Preview</h4>
|
||||
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-8 flex items-center justify-center gap-6">
|
||||
<div class="text-gray-800 dark:text-gray-200">
|
||||
<span x-html="$icon(selectedIcon, 'w-12 h-12')"></span>
|
||||
</div>
|
||||
<div class="text-gray-800 dark:text-gray-200">
|
||||
<span x-html="$icon(selectedIcon, 'w-16 h-16')"></span>
|
||||
</div>
|
||||
<div class="text-gray-800 dark:text-gray-200">
|
||||
<span x-html="$icon(selectedIcon, 'w-24 h-24')"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Usage Code -->
|
||||
<div>
|
||||
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">Usage Code</h4>
|
||||
|
||||
<!-- Alpine.js Usage -->
|
||||
<div class="mb-4">
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Alpine.js (Recommended)</label>
|
||||
<div class="relative">
|
||||
<pre class="bg-gray-900 text-gray-100 rounded-lg p-3 text-xs overflow-x-auto"><code x-text="'x-html="$icon(\'' + selectedIcon + '\', \'w-5 h-5\')"'"></code></pre>
|
||||
<button
|
||||
@click="copyIconUsage(selectedIcon)"
|
||||
class="absolute top-2 right-2 p-1.5 bg-gray-800 text-gray-300 rounded hover:bg-gray-700 transition-colors"
|
||||
title="Copy"
|
||||
>
|
||||
<span x-html="$icon('duplicate', 'w-4 h-4')"></span>
|
||||
</button>
|
||||
</div>
|
||||
>
|
||||
<!-- Icon -->
|
||||
<div class="text-gray-600 dark:text-gray-400 group-hover:text-purple-600 dark:group-hover:text-purple-400 transition-colors">
|
||||
<span x-html="$icon(icon.name, 'w-8 h-8')"></span>
|
||||
</div>
|
||||
|
||||
<!-- Icon Name -->
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Icon Name</label>
|
||||
<div class="relative">
|
||||
<pre class="bg-gray-900 text-gray-100 rounded-lg p-3 text-xs overflow-x-auto"><code x-text="selectedIcon"></code></pre>
|
||||
<p class="mt-2 text-xs text-center text-gray-600 dark:text-gray-400 font-mono truncate w-full px-1"
|
||||
:title="icon.name" x-text="icon.name"></p>
|
||||
|
||||
<!-- Hover Actions -->
|
||||
<div class="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-white dark:bg-gray-800 bg-opacity-90 dark:bg-opacity-90 rounded-lg">
|
||||
<div class="flex gap-1">
|
||||
<button
|
||||
@click="copyIconName(selectedIcon)"
|
||||
class="absolute top-2 right-2 p-1.5 bg-gray-800 text-gray-300 rounded hover:bg-gray-700 transition-colors"
|
||||
title="Copy"
|
||||
@click.stop="copyIconName(icon.name)"
|
||||
class="p-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors"
|
||||
title="Copy name"
|
||||
>
|
||||
<span x-html="$icon('duplicate', 'w-4 h-4')"></span>
|
||||
</button>
|
||||
<button
|
||||
@click.stop="copyIconUsage(icon.name)"
|
||||
class="p-2 bg-indigo-600 text-white rounded hover:bg-indigo-700 transition-colors"
|
||||
title="Copy usage"
|
||||
>
|
||||
<span x-html="$icon('code', 'w-4 h-4')"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Selected Icon Details -->
|
||||
<div x-show="selectedIcon" class="mt-6 bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-4">
|
||||
Selected Icon: <span class="font-mono text-purple-600 dark:text-purple-400" x-text="selectedIcon"></span>
|
||||
</h3>
|
||||
|
||||
<div class="grid md:grid-cols-2 gap-6">
|
||||
<!-- Preview -->
|
||||
<div>
|
||||
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">Preview</h4>
|
||||
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-8 flex items-center justify-center gap-6">
|
||||
<div class="text-gray-800 dark:text-gray-200">
|
||||
<span x-html="$icon(selectedIcon, 'w-12 h-12')"></span>
|
||||
</div>
|
||||
<div class="text-gray-800 dark:text-gray-200">
|
||||
<span x-html="$icon(selectedIcon, 'w-16 h-16')"></span>
|
||||
</div>
|
||||
<div class="text-gray-800 dark:text-gray-200">
|
||||
<span x-html="$icon(selectedIcon, 'w-24 h-24')"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Size Examples -->
|
||||
<div class="mt-6">
|
||||
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">Common Sizes</h4>
|
||||
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4">
|
||||
<div class="flex items-center gap-8">
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-4 h-4')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-4 h-4</code>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-5 h-5</code>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-6 h-6')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-6 h-6</code>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-8 h-8')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-8 h-8</code>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-12 h-12')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-12 h-12</code>
|
||||
</div>
|
||||
<!-- Usage Code -->
|
||||
<div>
|
||||
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">Usage Code</h4>
|
||||
|
||||
<!-- Alpine.js Usage -->
|
||||
<div class="mb-4">
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Alpine.js
|
||||
(Recommended)</label>
|
||||
<div class="relative">
|
||||
<pre class="bg-gray-900 text-gray-100 rounded-lg p-3 text-xs overflow-x-auto"><code
|
||||
x-text="'x-html="$icon(\'' + selectedIcon + '\', \'w-5 h-5\')"'"></code></pre>
|
||||
<button
|
||||
@click="copyIconUsage(selectedIcon)"
|
||||
class="absolute top-2 right-2 p-1.5 bg-gray-800 text-gray-300 rounded hover:bg-gray-700 transition-colors"
|
||||
title="Copy"
|
||||
>
|
||||
<span x-html="$icon('duplicate', 'w-4 h-4')"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Icon Name -->
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">Icon Name</label>
|
||||
<div class="relative">
|
||||
<pre class="bg-gray-900 text-gray-100 rounded-lg p-3 text-xs overflow-x-auto"><code
|
||||
x-text="selectedIcon"></code></pre>
|
||||
<button
|
||||
@click="copyIconName(selectedIcon)"
|
||||
class="absolute top-2 right-2 p-1.5 bg-gray-800 text-gray-300 rounded hover:bg-gray-700 transition-colors"
|
||||
title="Copy"
|
||||
>
|
||||
<span x-html="$icon('duplicate', 'w-4 h-4')"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Usage Guide -->
|
||||
<div class="mt-6 bg-blue-50 dark:bg-gray-800 border border-blue-200 dark:border-gray-700 rounded-lg p-6">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-3 flex items-center">
|
||||
<span x-html="$icon('book-open', 'w-5 h-5 mr-2 text-blue-600')"></span>
|
||||
How to Use Icons
|
||||
</h3>
|
||||
<div class="grid md:grid-cols-2 gap-6 text-sm">
|
||||
<div>
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">In Alpine.js Templates</h4>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">Use the <code class="px-1 py-0.5 bg-gray-200 dark:bg-gray-700 rounded">x-html</code> directive:</p>
|
||||
<pre class="bg-gray-900 text-gray-100 rounded p-2 text-xs overflow-x-auto"><code><span x-html="$icon('home', 'w-5 h-5')"></span></code></pre>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">Customizing Size & Color</h4>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">Use Tailwind classes:</p>
|
||||
<pre class="bg-gray-900 text-gray-100 rounded p-2 text-xs overflow-x-auto"><code><span x-html="$icon('check', 'w-6 h-6 text-green-500')"></span></code></pre>
|
||||
<!-- Size Examples -->
|
||||
<div class="mt-6">
|
||||
<h4 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-3">Common Sizes</h4>
|
||||
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4">
|
||||
<div class="flex items-center gap-8">
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-4 h-4')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-4 h-4</code>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-5 h-5</code>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-6 h-6')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-6 h-6</code>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-8 h-8')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-8 h-8</code>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="text-gray-800 dark:text-gray-200 mb-1">
|
||||
<span x-html="$icon(selectedIcon, 'w-12 h-12')"></span>
|
||||
</div>
|
||||
<code class="text-xs text-gray-600 dark:text-gray-400">w-12 h-12</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Usage Guide -->
|
||||
<div class="mt-6 bg-blue-50 dark:bg-gray-800 border border-blue-200 dark:border-gray-700 rounded-lg p-6">
|
||||
<h3 class="text-lg font-semibold text-gray-800 dark:text-gray-200 mb-3 flex items-center">
|
||||
<span x-html="$icon('book-open', 'w-5 h-5 mr-2 text-blue-600')"></span>
|
||||
How to Use Icons
|
||||
</h3>
|
||||
<div class="grid md:grid-cols-2 gap-6 text-sm">
|
||||
<div>
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">In Alpine.js Templates</h4>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">Use the <code
|
||||
class="px-1 py-0.5 bg-gray-200 dark:bg-gray-700 rounded">x-html</code> directive:</p>
|
||||
<pre class="bg-gray-900 text-gray-100 rounded p-2 text-xs overflow-x-auto"><code><span x-html="$icon('home', 'w-5 h-5')"></span></code></pre>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">Customizing Size & Color</h4>
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-2">Use Tailwind classes:</p>
|
||||
<pre class="bg-gray-900 text-gray-100 rounded p-2 text-xs overflow-x-auto"><code><span x-html="$icon('check', 'w-6 h-6 text-green-500')"></span></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
|
||||
11
app/templates/admin/marketplace.html
Normal file
11
app/templates/admin/marketplace.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>System-wide marketplace monitoring</title>
|
||||
</head>
|
||||
<body>
|
||||
<-- System-wide marketplace monitoring -->
|
||||
</body>
|
||||
</html>
|
||||
11
app/templates/admin/monitoring.html
Normal file
11
app/templates/admin/monitoring.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>System monitoring</title>
|
||||
</head>
|
||||
<body>
|
||||
<-- System monitoring -->
|
||||
</body>
|
||||
</html>
|
||||
161
app/templates/admin/partials/header.html
Normal file
161
app/templates/admin/partials/header.html
Normal file
@@ -0,0 +1,161 @@
|
||||
<!-- app/templates/partials/header.html -->
|
||||
<!-- Top header bar with search, theme toggle, notifications, profile -->
|
||||
<header class="z-10 py-4 bg-white shadow-md dark:bg-gray-800">
|
||||
<div class="container flex items-center justify-between h-full px-6 mx-auto text-purple-600 dark:text-purple-300">
|
||||
<!-- Mobile hamburger -->
|
||||
<button class="p-1 mr-5 -ml-1 rounded-md md:hidden focus:outline-none focus:shadow-outline-purple"
|
||||
@click="toggleSideMenu" aria-label="Menu">
|
||||
<span x-html="$icon('menu', 'w-6 h-6')"></span>
|
||||
</button>
|
||||
|
||||
<!-- Search input -->
|
||||
<div class="flex justify-center flex-1 lg:mr-32">
|
||||
<div class="relative w-full max-w-xl mr-6 focus-within:text-purple-500">
|
||||
<div class="absolute inset-y-0 flex items-center pl-2">
|
||||
<span x-html="$icon('search', 'w-4 h-4')"></span>
|
||||
</div>
|
||||
<input class="w-full pl-8 pr-2 text-sm text-gray-700 placeholder-gray-600 bg-gray-100 border-0 rounded-md dark:placeholder-gray-500 dark:focus:shadow-outline-gray dark:focus:placeholder-gray-600 dark:bg-gray-700 dark:text-gray-200 focus:placeholder-gray-500 focus:bg-white focus:border-purple-300 focus:outline-none focus:shadow-outline-purple form-input"
|
||||
type="text" placeholder="Search for projects" aria-label="Search"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="flex items-center flex-shrink-0 space-x-6">
|
||||
<!-- Theme toggler -->
|
||||
<li class="flex">
|
||||
<button class="rounded-md focus:outline-none focus:shadow-outline-purple"
|
||||
@click="toggleTheme" aria-label="Toggle color mode">
|
||||
<template x-if="!dark">
|
||||
<span x-html="$icon('moon', 'w-5 h-5')"></span>
|
||||
</template>
|
||||
<template x-if="dark">
|
||||
<span x-html="$icon('sun', 'w-5 h-5')"></span>
|
||||
</template>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<!-- Notifications menu -->
|
||||
<li class="relative" x-data="{ notifOpen: false }">
|
||||
<button class="relative align-middle rounded-md focus:outline-none focus:shadow-outline-purple"
|
||||
@click="notifOpen = !notifOpen"
|
||||
@keydown.escape="notifOpen = false"
|
||||
aria-label="Notifications" aria-haspopup="true">
|
||||
<span x-html="$icon('bell', 'w-5 h-5')"></span>
|
||||
<span aria-hidden="true" class="absolute top-0 right-0 inline-block w-3 h-3 transform translate-x-1 -translate-y-1 bg-red-600 border-2 border-white rounded-full dark:border-gray-800"></span>
|
||||
</button>
|
||||
|
||||
<ul x-show="notifOpen"
|
||||
x-cloak
|
||||
x-transition:leave="transition ease-in duration-150"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
@click.away="notifOpen = false"
|
||||
@keydown.escape="notifOpen = false"
|
||||
class="absolute right-0 w-56 p-2 mt-2 space-y-2 text-gray-600 bg-white border border-gray-100 rounded-md shadow-md dark:text-gray-300 dark:border-gray-700 dark:bg-gray-700">
|
||||
<li class="flex">
|
||||
<a class="inline-flex items-center justify-between w-full px-2 py-1 text-sm font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200" href="#">
|
||||
<span>Messages</span>
|
||||
<span class="inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-red-600 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-600">13</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="flex">
|
||||
<a class="inline-flex items-center justify-between w-full px-2 py-1 text-sm font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200" href="#">
|
||||
<span>Sales</span>
|
||||
<span class="inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-red-600 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-600">2</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="flex">
|
||||
<a class="inline-flex items-center justify-between w-full px-2 py-1 text-sm font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200" href="#">
|
||||
<span>Alerts</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- Profile menu - ✅ FIXED with self-contained Alpine data -->
|
||||
<li class="relative" x-data="{ profileOpen: false }">
|
||||
<button class="align-middle rounded-full focus:shadow-outline-purple focus:outline-none"
|
||||
@click="profileOpen = !profileOpen"
|
||||
@keydown.escape="profileOpen = false"
|
||||
aria-label="Account"
|
||||
aria-haspopup="true">
|
||||
<img class="object-cover w-8 h-8 rounded-full"
|
||||
src="https://images.unsplash.com/photo-1502378735452-bc7d86632805?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&s=aa3a807e1bbdfd4364d1f449eaa96d82"
|
||||
alt="" aria-hidden="true"/>
|
||||
</button>
|
||||
|
||||
<!-- Use x-show instead of x-if for reliability -->
|
||||
<ul x-show="profileOpen"
|
||||
x-cloak
|
||||
x-transition:leave="transition ease-in duration-150"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
@click.away="profileOpen = false"
|
||||
@keydown.escape="profileOpen = false"
|
||||
class="absolute right-0 w-56 p-2 mt-2 space-y-2 text-gray-600 bg-white border border-gray-100 rounded-md shadow-md dark:border-gray-700 dark:text-gray-300 dark:bg-gray-700 z-50"
|
||||
style="display: none;"
|
||||
aria-label="submenu">
|
||||
<li class="flex">
|
||||
<a class="inline-flex items-center w-full px-2 py-1 text-sm font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200" href="#">
|
||||
<span x-html="$icon('user', 'w-4 h-4 mr-3')"></span>
|
||||
<span>Profile</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="flex">
|
||||
<a class="inline-flex items-center w-full px-2 py-1 text-sm font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200" href="#">
|
||||
<span x-html="$icon('cog', 'w-4 h-4 mr-3')"></span>
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="flex">
|
||||
<button
|
||||
@click="handleLogout()"
|
||||
class="inline-flex items-center w-full px-2 py-1 text-sm font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200 text-left">
|
||||
<span x-html="$icon('logout', 'w-4 h-4 mr-3')"></span>
|
||||
<span>Log out</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Logout handler script -->
|
||||
<script>
|
||||
// Add handleLogout function to Alpine data
|
||||
document.addEventListener('alpine:init', () => {
|
||||
// Extend the data() function to include logout
|
||||
const originalData = window.data;
|
||||
window.data = function() {
|
||||
const baseData = originalData();
|
||||
return {
|
||||
...baseData,
|
||||
handleLogout() {
|
||||
console.log('🚪 Logging out...');
|
||||
|
||||
// Call logout API
|
||||
fetch('/api/v1/admin/auth/logout', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('admin_token')}`
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
console.log('✅ Logout API called successfully');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('âš ï¸ Logout API error (continuing anyway):', error);
|
||||
})
|
||||
.finally(() => {
|
||||
// Clear all tokens
|
||||
console.log('🧹 Clearing tokens...');
|
||||
localStorage.clear();
|
||||
|
||||
console.log('🔄 Redirecting to login...');
|
||||
window.location.href = '/admin/login';
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
});
|
||||
</script>
|
||||
250
app/templates/admin/partials/sidebar.html
Normal file
250
app/templates/admin/partials/sidebar.html
Normal file
@@ -0,0 +1,250 @@
|
||||
{# app/templates/partials/sidebar.html #}
|
||||
<!-- Desktop sidebar -->
|
||||
<aside class="z-20 hidden w-64 overflow-y-auto bg-white dark:bg-gray-800 md:block flex-shrink-0">
|
||||
<div class="py-4 text-gray-500 dark:text-gray-400">
|
||||
<a class="ml-6 text-lg font-bold text-gray-800 dark:text-gray-200" href="/admin/dashboard">
|
||||
Admin Portal
|
||||
</a>
|
||||
<ul class="mt-6">
|
||||
<!-- Dashboard -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'dashboard'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'dashboard' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/dashboard">
|
||||
<span x-html="$icon('home')"></span>
|
||||
<span class="ml-4">Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Main Navigation -->
|
||||
<ul>
|
||||
<!-- Vendors -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'vendors'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'vendors' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/vendors">
|
||||
<span x-html="$icon('shopping-bag')"></span>
|
||||
<span class="ml-4">Vendors</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Users -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'users'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'users' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/users">
|
||||
<span x-html="$icon('users')"></span>
|
||||
<span class="ml-4">Users</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Import Jobs -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'imports'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'imports' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/imports">
|
||||
<span x-html="$icon('cube')"></span>
|
||||
<span class="ml-4">Import Jobs</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Developer Tools Section -->
|
||||
<div class="px-6 my-6">
|
||||
<hr class="border-gray-200 dark:border-gray-700" />
|
||||
</div>
|
||||
<p class="px-6 text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
|
||||
Developer Tools
|
||||
</p>
|
||||
<ul class="mt-3">
|
||||
<!-- Components -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'components'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'components' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/components">
|
||||
<span x-html="$icon('view-grid')"></span>
|
||||
<span class="ml-4">Components</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Icons -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'icons'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'icons' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/icons">
|
||||
<span x-html="$icon('photograph')"></span>
|
||||
<span class="ml-4">Icons</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Testing Hub -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'testing'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'testing' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/testing">
|
||||
<span x-html="$icon('beaker')"></span>
|
||||
<span class="ml-4">Testing Hub</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Settings Section -->
|
||||
<div class="px-6 my-6">
|
||||
<hr class="border-gray-200 dark:border-gray-700" />
|
||||
</div>
|
||||
<ul>
|
||||
<!-- Settings -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'settings'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'settings' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/settings">
|
||||
<span x-html="$icon('cog')"></span>
|
||||
<span class="ml-4">Settings</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Mobile sidebar -->
|
||||
<div x-show="isSideMenuOpen"
|
||||
x-transition:enter="transition ease-in-out duration-150"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="transition ease-in-out duration-150"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
class="fixed inset-0 z-10 flex items-end bg-black bg-opacity-50 sm:items-center sm:justify-center"></div>
|
||||
|
||||
<aside class="fixed inset-y-0 z-20 flex-shrink-0 w-64 mt-16 overflow-y-auto bg-white dark:bg-gray-800 md:hidden"
|
||||
x-show="isSideMenuOpen"
|
||||
x-transition:enter="transition ease-in-out duration-150"
|
||||
x-transition:enter-start="opacity-0 transform -translate-x-20"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="transition ease-in-out duration-150"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0 transform -translate-x-20"
|
||||
@click.away="closeSideMenu"
|
||||
@keydown.escape="closeSideMenu">
|
||||
<div class="py-4 text-gray-500 dark:text-gray-400">
|
||||
<a class="ml-6 text-lg font-bold text-gray-800 dark:text-gray-200" href="/admin/dashboard">
|
||||
Admin Portal
|
||||
</a>
|
||||
<ul class="mt-6">
|
||||
<!-- Dashboard -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'dashboard'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'dashboard' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/dashboard">
|
||||
<span x-html="$icon('home')"></span>
|
||||
<span class="ml-4">Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Main Navigation -->
|
||||
<ul>
|
||||
<!-- Vendors -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'vendors'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'vendors' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/vendors">
|
||||
<span x-html="$icon('shopping-bag')"></span>
|
||||
<span class="ml-4">Vendors</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Users -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'users'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'users' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/users">
|
||||
<span x-html="$icon('users')"></span>
|
||||
<span class="ml-4">Users</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Import Jobs -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'imports'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'imports' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/imports">
|
||||
<span x-html="$icon('cube')"></span>
|
||||
<span class="ml-4">Import Jobs</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Developer Tools Section -->
|
||||
<div class="px-6 my-6">
|
||||
<hr class="border-gray-200 dark:border-gray-700" />
|
||||
</div>
|
||||
<p class="px-6 text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
|
||||
Developer Tools
|
||||
</p>
|
||||
<ul class="mt-3">
|
||||
<!-- Components -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'components'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'components' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/components">
|
||||
<span x-html="$icon('view-grid')"></span>
|
||||
<span class="ml-4">Components</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Icons -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'icons'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'icons' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/icons">
|
||||
<span x-html="$icon('photograph')"></span>
|
||||
<span class="ml-4">Icons</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Testing Hub -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'testing'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'testing' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/testing">
|
||||
<span x-html="$icon('beaker')"></span>
|
||||
<span class="ml-4">Testing Hub</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Settings Section -->
|
||||
<div class="px-6 my-6">
|
||||
<hr class="border-gray-200 dark:border-gray-700" />
|
||||
</div>
|
||||
<ul>
|
||||
<!-- Settings -->
|
||||
<li class="relative px-6 py-3">
|
||||
<span x-show="currentPage === 'settings'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||
:class="currentPage === 'settings' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||
href="/admin/settings">
|
||||
<span x-html="$icon('cog')"></span>
|
||||
<span class="ml-4">Settings</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</aside>
|
||||
@@ -12,17 +12,22 @@
|
||||
<h2 class="text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
||||
Testing Hub
|
||||
</h2>
|
||||
<a href="/admin/dashboard"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-800 dark:border-gray-600 dark:hover:bg-gray-700">
|
||||
<span x-html="$icon('arrow-left', 'w-4 h-4 mr-2')"></span>
|
||||
Back to Dashboard
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Introduction Card -->
|
||||
<div class="bg-gradient-to-r from-purple-600 to-indigo-600 rounded-lg shadow-lg p-6 mb-8">
|
||||
<div class="flex items-start">
|
||||
<div class="flex-shrink-0 text-white">
|
||||
<div class="flex-shrink-0 text-gray-700 dark:text-gray-200">
|
||||
<span x-html="$icon('beaker', 'w-12 h-12')"></span>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<h3 class="text-xl font-bold mb-2 text-white">Testing & QA Tools</h3>
|
||||
<p class="text-white opacity-90">
|
||||
<h3 class="text-xl font-bold mb-2 text-gray-700 dark:text-gray-200">Testing & QA Tools</h3>
|
||||
<p class="text-gray-700 dark:text-gray-200 opacity-90">
|
||||
Comprehensive testing tools for manual QA, feature verification, and bug reproduction.
|
||||
These pages help you test specific flows without writing code.
|
||||
</p>
|
||||
@@ -32,171 +37,192 @@
|
||||
|
||||
<!-- Quick Stats -->
|
||||
<div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 text-blue-500 bg-blue-100 rounded-full dark:text-blue-100 dark:bg-blue-500">
|
||||
<span x-html="$icon('clipboard-list', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Test Suites</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.totalSuites"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 text-blue-500 bg-blue-100 rounded-full dark:text-blue-100 dark:bg-blue-500">
|
||||
<span x-html="$icon('clipboard-list', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Test Suites</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.totalSuites"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 text-green-500 bg-green-100 rounded-full dark:text-green-100 dark:bg-green-500">
|
||||
<span x-html="$icon('check-circle', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Test Cases</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.totalTests + '+'"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 text-green-500 bg-green-100 rounded-full dark:text-green-100 dark:bg-green-500">
|
||||
<span x-html="$icon('check-circle', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Test Cases</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.totalTests + '+'"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500">
|
||||
<span x-html="$icon('lightning-bolt', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Features Covered</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.coverage"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500">
|
||||
<span x-html="$icon('lightning-bolt', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Features Covered</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.coverage"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 text-purple-500 bg-purple-100 rounded-full dark:text-purple-100 dark:bg-purple-500">
|
||||
<span x-html="$icon('clock', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Quick Tests</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.avgDuration"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
|
||||
<div class="p-3 mr-4 text-teal-500 bg-teal-100 rounded-full dark:text-teal-100 dark:bg-teal-500">
|
||||
<span x-html="$icon('clock', 'w-5 h-5')"></span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">Quick Tests</p>
|
||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200" x-text="stats.avgDuration"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Test Suites Grid -->
|
||||
<div class="grid gap-6 mb-8 md:grid-cols-2">
|
||||
<template x-for="suite in testSuites" :key="suite.id">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden hover:shadow-xl transition-shadow duration-300">
|
||||
<div class="p-4 bg-gradient-to-r" :class="getColorClasses(suite.color).gradient">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-xl font-semibold text-white flex items-center">
|
||||
<span x-html="$icon(suite.icon, 'w-6 h-6 mr-2 text-white')"></span>
|
||||
<span x-text="suite.name"></span>
|
||||
</h3>
|
||||
<span class="inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-red-600 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-600">
|
||||
<span x-text="suite.testCount"></span> Tests
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Test Suites Grid -->
|
||||
<div class="grid gap-6 mb-8 md:grid-cols-2">
|
||||
<template x-for="suite in testSuites" :key="suite.id">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md overflow-hidden hover:shadow-xl transition-shadow duration-300">
|
||||
<div class="p-4 bg-gradient-to-r" :class="getColorClasses(suite.color).gradient">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-xl font-semibold text-white flex items-center">
|
||||
<span x-html="$icon(suite.icon, 'w-6 h-6 mr-2 text-white')"></span>
|
||||
<span x-text="suite.name"></span>
|
||||
</h3>
|
||||
<span class="px-3 py-1 bg-white bg-opacity-25 rounded-full text-xs text-white font-semibold">
|
||||
<span x-text="suite.testCount"></span> Tests
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-4" x-text="suite.description"></p>
|
||||
|
||||
<div class="p-6">
|
||||
<p class="text-gray-600 dark:text-gray-400 mb-4" x-text="suite.description"></p>
|
||||
|
||||
<div class="space-y-2 mb-6">
|
||||
<template x-for="feature in suite.features" :key="feature">
|
||||
<div class="flex items-start text-sm">
|
||||
<span x-html="$icon('check-circle', 'w-4 h-4 text-green-500 mr-2 mt-0.5 flex-shrink-0')"></span>
|
||||
<span class="text-gray-600 dark:text-gray-400" x-text="feature"></span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
@click="goToTest(suite.url)"
|
||||
class="flex-1 flex items-center justify-center px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors"
|
||||
:class="getColorClasses(suite.color).button">
|
||||
<span x-html="$icon('play', 'w-4 h-4 mr-2 text-white')"></span>
|
||||
Run Tests
|
||||
</button>
|
||||
<button class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors">
|
||||
<span x-html="$icon('information-circle', 'w-5 h-5')"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-y-2 mb-6">
|
||||
<template x-for="feature in suite.features" :key="feature">
|
||||
<div class="flex items-start text-sm">
|
||||
<span x-html="$icon('check-circle', 'w-4 h-4 text-green-500 mr-2 mt-0.5 flex-shrink-0')"></span>
|
||||
<span class="text-gray-600 dark:text-gray-400" x-text="feature"></span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- Best Practices -->
|
||||
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
<h2 class="mb-4 text-xl font-semibold text-gray-800 dark:text-gray-200 flex items-center">
|
||||
<span x-html="$icon('light-bulb', 'w-6 h-6 mr-2 text-yellow-500')"></span>
|
||||
Testing Best Practices
|
||||
</h2>
|
||||
|
||||
<div class="grid md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">Before Testing</h3>
|
||||
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Ensure FastAPI server is running on localhost:8000</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Open browser DevTools (F12) to see console logs</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Check Network tab for API requests</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Clear localStorage before starting fresh tests</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">During Testing</h3>
|
||||
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Follow test steps in order</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Check expected results against actual behavior</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Look for errors in console and network tabs</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Take screenshots if you find bugs</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
@click="goToTest(suite.url)"
|
||||
class="flex-1 flex items-center justify-center px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors"
|
||||
:class="getColorClasses(suite.color).button">
|
||||
<span x-html="$icon('play', 'w-4 h-4 mr-2 text-white')"></span>
|
||||
Run Tests
|
||||
</button>
|
||||
<button class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors">
|
||||
<span x-html="$icon('information-circle', 'w-5 h-5')"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Additional Resources -->
|
||||
<div class="bg-blue-50 dark:bg-gray-800 border border-blue-200 dark:border-gray-700 rounded-lg p-6 mb-8">
|
||||
<h3 class="mb-3 text-lg font-semibold text-gray-800 dark:text-gray-200 flex items-center">
|
||||
<span x-html="$icon('book-open', 'w-5 h-5 mr-2 text-blue-600')"></span>
|
||||
Additional Resources
|
||||
</h3>
|
||||
<div class="grid md:grid-cols-3 gap-4">
|
||||
<a href="/admin/components" class="block p-4 bg-white dark:bg-gray-700 rounded-lg hover:shadow-md transition-shadow">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-200 mb-1">Component Library</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">View all available UI components</p>
|
||||
</a>
|
||||
<a href="/admin/icons" class="block p-4 bg-white dark:bg-gray-700 rounded-lg hover:shadow-md transition-shadow">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-200 mb-1">Icons Browser</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">Browse all available icons</p>
|
||||
</a>
|
||||
<a href="#" class="block p-4 bg-white dark:bg-gray-700 rounded-lg hover:shadow-md transition-shadow">
|
||||
<h4 class="font-semibold text-gray-700 dark:text-gray-200 mb-1">API Documentation</h4>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400">FastAPI endpoint reference</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- Best Practices -->
|
||||
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
<h2 class="mb-4 text-xl font-semibold text-gray-800 dark:text-gray-200 flex items-center">
|
||||
<span x-html="$icon('light-bulb', 'w-6 h-6 mr-2 text-yellow-500')"></span>
|
||||
Testing Best Practices
|
||||
</h2>
|
||||
|
||||
<div class="grid md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">Before Testing</h3>
|
||||
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Ensure FastAPI server is running on localhost:8000</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Open browser DevTools (F12) to see console logs</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Check Network tab for API requests</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Clear localStorage before starting fresh tests</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">During Testing</h3>
|
||||
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Follow test steps in order</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Check expected results against actual behavior</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Look for errors in console and network tabs</span>
|
||||
</li>
|
||||
<li class="flex items-start">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Take screenshots if you find bugs</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Additional Resources -->
|
||||
<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||
<h2 class="mb-4 text-xl font-semibold text-gray-800 dark:text-gray-200 flex items-center">
|
||||
<span x-html="$icon('book-open', 'w-5 h-5 mr-2 text-blue-600')"></span>
|
||||
Additional Resources
|
||||
</h2>
|
||||
<div class="grid md:grid-cols-3 gap-4">
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">Component Library</h3>
|
||||
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li class="flex items-start">
|
||||
<a href="/admin/components">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>View all available UI components</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">Icons Browser</h3>
|
||||
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li class="flex items-start">
|
||||
<a href="/admin/icons">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>Browse all available icons</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="font-semibold text-gray-700 dark:text-gray-300 mb-2">API Documentation</h3>
|
||||
<ul class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<li class="flex items-start">
|
||||
<a href="/docs">
|
||||
<span class="text-purple-600 mr-2">•</span>
|
||||
<span>FastAPI endpoint reference</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
Vendor Details
|
||||
</h2>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 mt-1" x-show="vendor">
|
||||
<span x-text="vendor?.vendor_code"></span>
|
||||
<span x-text="vendorCode"></span>
|
||||
<span class="text-gray-400 mx-2">•</span>
|
||||
<span x-text="vendor?.subdomain"></span>
|
||||
</p>
|
||||
@@ -25,6 +25,10 @@
|
||||
<span x-html="$icon('edit', 'w-4 h-4 mr-2')"></span>
|
||||
Edit Vendor
|
||||
</a>
|
||||
<a :href="`/admin/vendors/${vendorCode}/theme`"
|
||||
class="px-4 py-2 text-sm font-medium text-purple-700 bg-white border border-purple-600 rounded-lg hover:bg-purple-50">
|
||||
Customize Theme
|
||||
</a>
|
||||
<a href="/admin/vendors"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-gray-700 transition-colors duration-150 bg-white border border-gray-300 rounded-lg dark:text-gray-400 dark:border-gray-600 dark:bg-gray-800 hover:border-gray-400 focus:outline-none">
|
||||
<span x-html="$icon('arrow-left', 'w-4 h-4 mr-2')"></span>
|
||||
|
||||
297
app/templates/admin/vendor-theme.html
Normal file
297
app/templates/admin/vendor-theme.html
Normal file
@@ -0,0 +1,297 @@
|
||||
{# app/templates/admin/vendor-theme.html #}
|
||||
{% extends "admin/base.html" %}
|
||||
|
||||
{% block title %}Vendor Theme - {{ vendor_code }}{% endblock %}
|
||||
|
||||
{% block alpine_data %}vendorThemeData(){% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container px-6 mx-auto grid">
|
||||
<!-- Page Header -->
|
||||
<div class="flex items-center justify-between my-6">
|
||||
<div>
|
||||
<h2 class="text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
||||
Vendor Theme
|
||||
</h2>
|
||||
<p class="text-sm text-gray-600 dark:text-gray-400 mt-1">
|
||||
Customize appearance for <span x-text="vendor?.name"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex space-x-2">
|
||||
<a :href="`/admin/vendors/${vendorCode}`"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-gray-700 transition-colors duration-150 bg-white border border-gray-300 rounded-lg hover:border-gray-400 dark:text-gray-400 dark:border-gray-600 dark:bg-gray-800">
|
||||
<span x-html="$icon('arrow-left', 'w-4 h-4 mr-2')"></span>
|
||||
Back to Vendor
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Loading State -->
|
||||
<div x-show="loading" class="text-center py-12">
|
||||
<span x-html="$icon('spinner', 'inline w-8 h-8 text-purple-600 animate-spin')"></span>
|
||||
<p class="mt-2 text-gray-600 dark:text-gray-400">Loading theme...</p>
|
||||
</div>
|
||||
|
||||
<!-- Main Content -->
|
||||
<div x-show="!loading" class="grid gap-6 mb-8 md:grid-cols-3">
|
||||
|
||||
<!-- Theme Configuration Form (2 columns) -->
|
||||
<div class="md:col-span-2">
|
||||
<div class="px-4 py-3 mb-8 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">
|
||||
Theme Configuration
|
||||
</h3>
|
||||
|
||||
<!-- Theme Preset Selector -->
|
||||
<div class="mb-6 p-4 bg-purple-50 dark:bg-purple-900 dark:bg-opacity-20 rounded-lg border border-purple-200 dark:border-purple-800">
|
||||
<h4 class="text-sm font-semibold text-purple-800 dark:text-purple-200 mb-2">
|
||||
Quick Start: Choose a Preset
|
||||
</h4>
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-2">
|
||||
<button @click="applyPreset('modern')"
|
||||
class="px-3 py-2 text-sm font-medium text-purple-700 bg-white border border-purple-300 rounded-lg hover:bg-purple-50 dark:bg-gray-800 dark:text-purple-300 dark:border-purple-700">
|
||||
Modern
|
||||
</button>
|
||||
<button @click="applyPreset('classic')"
|
||||
class="px-3 py-2 text-sm font-medium text-blue-700 bg-white border border-blue-300 rounded-lg hover:bg-blue-50 dark:bg-gray-800 dark:text-blue-300 dark:border-blue-700">
|
||||
Classic
|
||||
</button>
|
||||
<button @click="applyPreset('minimal')"
|
||||
class="px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700">
|
||||
Minimal
|
||||
</button>
|
||||
<button @click="applyPreset('vibrant')"
|
||||
class="px-3 py-2 text-sm font-medium text-orange-700 bg-white border border-orange-300 rounded-lg hover:bg-orange-50 dark:bg-gray-800 dark:text-orange-300 dark:border-orange-700">
|
||||
Vibrant
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Colors Section -->
|
||||
<div class="mb-6">
|
||||
<h4 class="mb-4 text-md font-semibold text-gray-700 dark:text-gray-200">Colors</h4>
|
||||
<div class="grid gap-4 md:grid-cols-2">
|
||||
<!-- Primary Color -->
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Primary Color</span>
|
||||
<div class="flex items-center mt-1 space-x-2">
|
||||
<input type="color"
|
||||
x-model="themeData.colors.primary"
|
||||
class="h-10 w-20 border border-gray-300 rounded dark:border-gray-600 cursor-pointer">
|
||||
<input type="text"
|
||||
x-model="themeData.colors.primary"
|
||||
class="block w-full text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple form-input">
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<!-- Secondary Color -->
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Secondary Color</span>
|
||||
<div class="flex items-center mt-1 space-x-2">
|
||||
<input type="color"
|
||||
x-model="themeData.colors.secondary"
|
||||
class="h-10 w-20 border border-gray-300 rounded dark:border-gray-600 cursor-pointer">
|
||||
<input type="text"
|
||||
x-model="themeData.colors.secondary"
|
||||
class="block w-full text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple form-input">
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<!-- Accent Color -->
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Accent Color</span>
|
||||
<div class="flex items-center mt-1 space-x-2">
|
||||
<input type="color"
|
||||
x-model="themeData.colors.accent"
|
||||
class="h-10 w-20 border border-gray-300 rounded dark:border-gray-600 cursor-pointer">
|
||||
<input type="text"
|
||||
x-model="themeData.colors.accent"
|
||||
class="block w-full text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple form-input">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Typography Section -->
|
||||
<div class="mb-6">
|
||||
<h4 class="mb-4 text-md font-semibold text-gray-700 dark:text-gray-200">Typography</h4>
|
||||
<div class="grid gap-4 md:grid-cols-2">
|
||||
<!-- Heading Font -->
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Heading Font</span>
|
||||
<select x-model="themeData.fonts.heading"
|
||||
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple form-select">
|
||||
<option value="Inter, sans-serif">Inter</option>
|
||||
<option value="Roboto, sans-serif">Roboto</option>
|
||||
<option value="Poppins, sans-serif">Poppins</option>
|
||||
<option value="Playfair Display, serif">Playfair Display</option>
|
||||
<option value="Merriweather, serif">Merriweather</option>
|
||||
<option value="Georgia, serif">Georgia</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<!-- Body Font -->
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Body Font</span>
|
||||
<select x-model="themeData.fonts.body"
|
||||
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple form-select">
|
||||
<option value="Inter, sans-serif">Inter</option>
|
||||
<option value="Open Sans, sans-serif">Open Sans</option>
|
||||
<option value="Lato, sans-serif">Lato</option>
|
||||
<option value="Source Sans Pro, sans-serif">Source Sans Pro</option>
|
||||
<option value="Arial, sans-serif">Arial</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Layout Section -->
|
||||
<div class="mb-6">
|
||||
<h4 class="mb-4 text-md font-semibold text-gray-700 dark:text-gray-200">Layout</h4>
|
||||
<div class="grid gap-4 md:grid-cols-2">
|
||||
<!-- Product Layout Style -->
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Product Layout</span>
|
||||
<select x-model="themeData.layout.style"
|
||||
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple form-select">
|
||||
<option value="grid">Grid</option>
|
||||
<option value="list">List</option>
|
||||
<option value="masonry">Masonry</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<!-- Header Style -->
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Header Style</span>
|
||||
<select x-model="themeData.layout.header"
|
||||
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple form-select">
|
||||
<option value="fixed">Fixed</option>
|
||||
<option value="static">Static</option>
|
||||
<option value="transparent">Transparent</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Custom CSS Section -->
|
||||
<div class="mb-6">
|
||||
<h4 class="mb-4 text-md font-semibold text-gray-700 dark:text-gray-200">Advanced</h4>
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">Custom CSS</span>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400 mb-2">
|
||||
Advanced: Add custom CSS rules (use with caution)
|
||||
</p>
|
||||
<textarea x-model="themeData.custom_css"
|
||||
rows="6"
|
||||
placeholder=".my-custom-class { color: red; }"
|
||||
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple form-textarea"></textarea>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div class="flex justify-between items-center">
|
||||
<button @click="resetToDefault()"
|
||||
:disabled="saving"
|
||||
class="px-4 py-2 text-sm font-medium leading-5 text-red-700 transition-colors duration-150 bg-white border border-red-300 rounded-lg hover:bg-red-50 focus:outline-none disabled:opacity-50 dark:bg-gray-800 dark:text-red-400 dark:border-red-600">
|
||||
Reset to Default
|
||||
</button>
|
||||
<button @click="saveTheme()"
|
||||
:disabled="saving"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg hover:bg-purple-700 focus:outline-none disabled:opacity-50">
|
||||
<span x-show="!saving">Save Theme</span>
|
||||
<span x-show="saving" class="flex items-center">
|
||||
<span x-html="$icon('spinner', 'w-4 h-4 mr-2 animate-spin')"></span>
|
||||
Saving...
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preview Panel (1 column) -->
|
||||
<div class="md:col-span-1">
|
||||
<div class="px-4 py-3 bg-white rounded-lg shadow-md dark:bg-gray-800 sticky top-6">
|
||||
<h3 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-200">
|
||||
Preview
|
||||
</h3>
|
||||
|
||||
<!-- Theme Preview -->
|
||||
<div class="space-y-4">
|
||||
<!-- Colors Preview -->
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2">COLORS</p>
|
||||
<div class="grid grid-cols-3 gap-2">
|
||||
<div class="text-center">
|
||||
<div class="h-12 rounded-lg border border-gray-200 dark:border-gray-700"
|
||||
:style="`background-color: ${themeData.colors.primary}`"></div>
|
||||
<p class="text-xs text-gray-600 dark:text-gray-400 mt-1">Primary</p>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="h-12 rounded-lg border border-gray-200 dark:border-gray-700"
|
||||
:style="`background-color: ${themeData.colors.secondary}`"></div>
|
||||
<p class="text-xs text-gray-600 dark:text-gray-400 mt-1">Secondary</p>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<div class="h-12 rounded-lg border border-gray-200 dark:border-gray-700"
|
||||
:style="`background-color: ${themeData.colors.accent}`"></div>
|
||||
<p class="text-xs text-gray-600 dark:text-gray-400 mt-1">Accent</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Typography Preview -->
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2">TYPOGRAPHY</p>
|
||||
<div class="space-y-2">
|
||||
<p class="text-lg" :style="`font-family: ${themeData.fonts.heading}`">
|
||||
Heading Font
|
||||
</p>
|
||||
<p class="text-sm" :style="`font-family: ${themeData.fonts.body}`">
|
||||
Body text font example
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Button Preview -->
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2">BUTTONS</p>
|
||||
<button class="px-4 py-2 text-sm font-medium text-white rounded-lg w-full"
|
||||
:style="`background-color: ${themeData.colors.primary}`">
|
||||
Primary Button
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Layout Preview -->
|
||||
<div>
|
||||
<p class="text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2">LAYOUT</p>
|
||||
<div class="text-xs space-y-1">
|
||||
<p class="text-gray-700 dark:text-gray-300">
|
||||
<span class="font-semibold">Product Layout:</span>
|
||||
<span class="capitalize" x-text="themeData.layout.style"></span>
|
||||
</p>
|
||||
<p class="text-gray-700 dark:text-gray-300">
|
||||
<span class="font-semibold">Header:</span>
|
||||
<span class="capitalize" x-text="themeData.layout.header"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preview Link -->
|
||||
<div class="pt-4 border-t border-gray-200 dark:border-gray-700">
|
||||
<a :href="`http://${vendor?.subdomain}.localhost:8000`"
|
||||
target="_blank"
|
||||
class="flex items-center justify-center px-4 py-2 text-sm font-medium text-purple-700 bg-purple-50 border border-purple-300 rounded-lg hover:bg-purple-100 dark:bg-purple-900 dark:bg-opacity-20 dark:text-purple-300 dark:border-purple-700">
|
||||
<span x-html="$icon('eye', 'w-4 h-4 mr-2')"></span>
|
||||
View Live Shop
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
<script src="{{ url_for('static', path='admin/js/vendor-theme.js') }}"></script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user