Files
orion/static/admin/js/platforms.js
Samir Boulahtit 968002630e feat: complete multi-platform CMS phases 2-5
Phase 2 - OMS Migration & Integration:
- Fix platform_pages.py to use get_platform_page for marketing pages
- Fix shop_pages.py to pass platform_id to content page service calls

Phase 3 - Admin Interface:
- Add platform management API (app/api/v1/admin/platforms.py)
- Add platforms admin page with stats cards
- Add Platforms menu item to admin sidebar
- Update content pages admin with platform filter and four-tab tier system

Phase 4 - Documentation:
- Add comprehensive architecture docs (docs/architecture/multi-platform-cms.md)
- Update implementation plan with completion status

Phase 5 - Vendor Dashboard:
- Add CMS usage API endpoint with tier limits
- Add usage progress bar to vendor content pages
- Add platform-default/{slug} API for preview
- Add View Default button and modal in page editor

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 16:30:31 +01:00

59 lines
1.3 KiB
JavaScript

/**
* Platforms Manager - Alpine.js Component
*
* Handles platform listing and management for multi-platform CMS.
*/
function platformsManager() {
return {
// State
platforms: [],
loading: true,
error: null,
// Lifecycle
async init() {
this.currentPage = "platforms";
await this.loadPlatforms();
},
// API Methods
async loadPlatforms() {
this.loading = true;
this.error = null;
try {
const response = await apiClient.get("/admin/platforms");
this.platforms = response.platforms || [];
console.log(`[PLATFORMS] Loaded ${this.platforms.length} platforms`);
} catch (err) {
console.error("[PLATFORMS] Error loading platforms:", err);
this.error = err.message || "Failed to load platforms";
} finally {
this.loading = false;
}
},
// Helper Methods
getPlatformIcon(code) {
const icons = {
oms: "clipboard-list",
loyalty: "star",
sitebuilder: "template",
default: "globe-alt",
};
return icons[code] || icons.default;
},
formatDate(dateString) {
if (!dateString) return "—";
const date = new Date(dateString);
return date.toLocaleDateString("fr-LU", {
year: "numeric",
month: "short",
day: "numeric",
});
},
};
}