Files
AudioCore/plugins/store/index.php

53 lines
2.4 KiB
PHP
Raw Normal View History

<?php
$pageTitle = $title ?? 'Store';
$tablesReady = (bool)($tables_ready ?? false);
$privateRoot = (string)($private_root ?? '');
$privateRootReady = (bool)($private_root_ready ?? false);
ob_start();
?>
<section class="admin-card">
<div class="badge">Store</div>
<div style="display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:16px;">
<div>
<h1 style="font-size:28px; margin:0;">Store</h1>
<p style="color: var(--muted); margin-top:6px;">Commerce layer for releases/tracks.</p>
</div>
<div style="display:flex; gap:10px; align-items:center;">
<a href="/admin/store/settings" class="btn outline">Settings</a>
<a href="/admin/store/orders" class="btn outline">Orders</a>
<a href="/admin/store/customers" class="btn outline">Customers</a>
</div>
</div>
<div style="display:flex; flex-wrap:wrap; gap:8px; margin-top:12px;">
<a href="/admin/store" class="btn outline small">Overview</a>
<a href="/admin/store/settings" class="btn outline small">Settings</a>
<a href="/admin/store/orders" class="btn outline small">Orders</a>
<a href="/admin/store/customers" class="btn outline small">Customers</a>
</div>
<?php if (!$tablesReady): ?>
<div class="admin-card" style="margin-top:16px; padding:16px; display:flex; align-items:center; justify-content:space-between; gap:16px;">
<div>
<div style="font-weight:600;">Store tables not initialized</div>
<div style="color: var(--muted); font-size:13px; margin-top:4px;">Create store tables before configuring products and checkout.</div>
</div>
<form method="post" action="/admin/store/install">
<button type="submit" class="btn small">Create Tables</button>
</form>
</div>
<?php endif; ?>
<div class="admin-card" style="margin-top:16px; padding:16px;">
<div style="font-weight:600;">Private download root</div>
<div style="color: var(--muted); font-size:13px; margin-top:4px; font-family:'IBM Plex Mono', monospace;">
<?= htmlspecialchars($privateRoot, ENT_QUOTES, 'UTF-8') ?>
</div>
<div style="margin-top:8px; font-size:12px; color: <?= $privateRootReady ? '#9be7c6' : '#f3b0b0' ?>;">
<?= $privateRootReady ? 'Ready' : 'Missing or not writable' ?>
</div>
</div>
</section>
<?php
$content = ob_get_clean();
require __DIR__ . '/../../../../modules/admin/views/layout.php';