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 alpine_data %}adminMarketplace(){% endblock %}
|
||||||
|
|
||||||
{% block extra_scripts %}
|
|
||||||
<script src="/static/admin/js/marketplace.js"></script>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<!-- Page Header -->
|
<!-- Page Header -->
|
||||||
<div class="flex items-center justify-between my-6">
|
<div class="flex items-center justify-between my-6">
|
||||||
@@ -180,7 +176,7 @@
|
|||||||
German CSV
|
German CSV
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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
|
This vendor has no Letzshop CSV URLs configured
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -511,3 +507,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block extra_scripts %}
|
||||||
|
<script src="{{ url_for('static', path='admin/js/marketplace.js') }}"></script>
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@@ -24,12 +24,8 @@
|
|||||||
<li class="flex">
|
<li class="flex">
|
||||||
<button class="rounded-md focus:outline-none focus:shadow-outline-purple"
|
<button class="rounded-md focus:outline-none focus:shadow-outline-purple"
|
||||||
@click="toggleTheme" aria-label="Toggle color mode">
|
@click="toggleTheme" aria-label="Toggle color mode">
|
||||||
<template x-if="!dark">
|
<span x-show="!dark" x-html="$icon('moon', 'w-5 h-5')"></span>
|
||||||
<span x-html="$icon('moon', 'w-5 h-5')"></span>
|
<span x-show="dark" x-html="$icon('sun', 'w-5 h-5')"></span>
|
||||||
</template>
|
|
||||||
<template x-if="dark">
|
|
||||||
<span x-html="$icon('sun', 'w-5 h-5')"></span>
|
|
||||||
</template>
|
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ def create_demo_companies(db: Session, auth_manager: AuthManager) -> list[Compan
|
|||||||
hashed_password=auth_manager.hash_password(
|
hashed_password=auth_manager.hash_password(
|
||||||
company_data["owner_password"]
|
company_data["owner_password"]
|
||||||
),
|
),
|
||||||
role="user",
|
role="vendor",
|
||||||
first_name=company_data["owner_first_name"],
|
first_name=company_data["owner_first_name"],
|
||||||
last_name=company_data["owner_last_name"],
|
last_name=company_data["owner_last_name"],
|
||||||
is_active=True,
|
is_active=True,
|
||||||
|
|||||||
@@ -58,23 +58,35 @@ function adminMarketplace() {
|
|||||||
autoRefreshInterval: null,
|
autoRefreshInterval: null,
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
|
adminMarketplaceLog.info('Marketplace init() called');
|
||||||
|
|
||||||
// Guard against multiple initialization
|
// Guard against multiple initialization
|
||||||
if (window._adminMarketplaceInitialized) {
|
if (window._adminMarketplaceInitialized) {
|
||||||
|
adminMarketplaceLog.warn('Already initialized, skipping');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window._adminMarketplaceInitialized = true;
|
window._adminMarketplaceInitialized = true;
|
||||||
|
|
||||||
// IMPORTANT: Call parent init first
|
// Ensure form defaults are set (in case spread didn't work)
|
||||||
const parentInit = data().init;
|
if (!this.importForm.marketplace) {
|
||||||
if (parentInit) {
|
this.importForm.marketplace = 'Letzshop';
|
||||||
await parentInit.call(this);
|
|
||||||
}
|
}
|
||||||
|
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.loadVendors();
|
||||||
await this.loadJobs();
|
await this.loadJobs();
|
||||||
|
|
||||||
// Auto-refresh active jobs every 10 seconds
|
// Auto-refresh active jobs every 10 seconds
|
||||||
this.startAutoRefresh();
|
this.startAutoRefresh();
|
||||||
|
|
||||||
|
adminMarketplaceLog.info('Marketplace initialization complete');
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user