fix: minor fixes and template updates
- seed_demo.py: Change company owner role from "user" to "vendor" - header.html: Update header partial styling/content - marketplace.js: Minor JS updates - marketplace.html: Template updates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,10 +5,6 @@
|
||||
|
||||
{% block alpine_data %}adminMarketplace(){% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
<script src="/static/admin/js/marketplace.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<!-- Page Header -->
|
||||
<div class="flex items-center justify-between my-6">
|
||||
@@ -180,7 +176,7 @@
|
||||
German CSV
|
||||
</button>
|
||||
</div>
|
||||
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400" x-show="!selectedVendor?.letzshop_csv_url_fr && !selectedVendor?.letzshop_csv_url_en && !selectedVendor?.letzshop_csv_url_de">
|
||||
<p class="mt-1 text-xs text-red-600 dark:text-red-400" x-show="!selectedVendor?.letzshop_csv_url_fr && !selectedVendor?.letzshop_csv_url_en && !selectedVendor?.letzshop_csv_url_de">
|
||||
This vendor has no Letzshop CSV URLs configured
|
||||
</p>
|
||||
</div>
|
||||
@@ -511,3 +507,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
<script src="{{ url_for('static', path='admin/js/marketplace.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -24,12 +24,8 @@
|
||||
<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>
|
||||
<span x-show="!dark" x-html="$icon('moon', 'w-5 h-5')"></span>
|
||||
<span x-show="dark" x-html="$icon('sun', 'w-5 h-5')"></span>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ def create_demo_companies(db: Session, auth_manager: AuthManager) -> list[Compan
|
||||
hashed_password=auth_manager.hash_password(
|
||||
company_data["owner_password"]
|
||||
),
|
||||
role="user",
|
||||
role="vendor",
|
||||
first_name=company_data["owner_first_name"],
|
||||
last_name=company_data["owner_last_name"],
|
||||
is_active=True,
|
||||
|
||||
@@ -58,23 +58,35 @@ function adminMarketplace() {
|
||||
autoRefreshInterval: null,
|
||||
|
||||
async init() {
|
||||
adminMarketplaceLog.info('Marketplace init() called');
|
||||
|
||||
// Guard against multiple initialization
|
||||
if (window._adminMarketplaceInitialized) {
|
||||
adminMarketplaceLog.warn('Already initialized, skipping');
|
||||
return;
|
||||
}
|
||||
window._adminMarketplaceInitialized = true;
|
||||
|
||||
// IMPORTANT: Call parent init first
|
||||
const parentInit = data().init;
|
||||
if (parentInit) {
|
||||
await parentInit.call(this);
|
||||
// Ensure form defaults are set (in case spread didn't work)
|
||||
if (!this.importForm.marketplace) {
|
||||
this.importForm.marketplace = 'Letzshop';
|
||||
}
|
||||
if (!this.importForm.batch_size) {
|
||||
this.importForm.batch_size = 1000;
|
||||
}
|
||||
if (!this.importForm.language) {
|
||||
this.importForm.language = 'fr';
|
||||
}
|
||||
|
||||
adminMarketplaceLog.info('Form defaults:', this.importForm);
|
||||
|
||||
await this.loadVendors();
|
||||
await this.loadJobs();
|
||||
|
||||
// Auto-refresh active jobs every 10 seconds
|
||||
this.startAutoRefresh();
|
||||
|
||||
adminMarketplaceLog.info('Marketplace initialization complete');
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user