This commit is contained in:
2026-01-17 01:12:40 +07:00
parent 85afe2badc
commit db9f958243
6 changed files with 485 additions and 403 deletions

View File

@@ -1,26 +1,24 @@
<?php
/** @var Din9xtrCloud\ViewModels\Dashboard\DashboardViewModel $page */
?>
<header class="dashboard-header">
<div class="welcome-section">
<h1 class="welcome-title">Welcome to your cloud storage
<?= htmlspecialchars($page->username) ?> 👋</h1>
<p class="welcome-subtitle">Manage your cloud storage efficiently</p>
</div>
<div class="header-actions">
<form action="/" method="GET" style="display: inline;">
<div class="welcome-section">
<h1 class="welcome-title">Welcome to your cloud storage
<?= htmlspecialchars($page->username) ?> 👋</h1>
<p class="welcome-subtitle">Manage your cloud storage efficiently</p>
</div>
<div class="header-actions">
<form action="/" method="GET" style="display: inline;">
<button class="btn btn-primary" id="refresh-dashboard">
<span class="btn-icon">💨</span>Refresh
</button>
</form>
<button class="btn btn-primary" id="refresh-dashboard">
<span class="btn-icon">💨</span>Refresh
</button>
</form>
<form action="/logout" method="POST" style="display: inline;">
<button type="submit" class="btn btn-secondary" id="logout-btn">
<span class="btn-icon">🚪</span> Logout
</button>
<input type="hidden" name="_csrf"
value="<?= htmlspecialchars($page->csrf) ?>">
</form>
</div>
</header>
<form action="/logout" method="POST" style="display: inline;">
<button type="submit" class="btn btn-secondary" id="logout-btn">
<span class="btn-icon">🚪</span> Logout
</button>
<input type="hidden" name="_csrf"
value="<?= htmlspecialchars($page->csrf) ?>">
</form>
</div>

View File

@@ -1,32 +1,30 @@
<?php /** @var Din9xtrCloud\ViewModels\Folder\FolderViewModel $page */
?>
<header class="folder-header">
<div class="folder-info">
<h1 class="folder-title">
<span class="folder-icon">📁</span>
<?= htmlspecialchars($page->title) ?>
</h1>
<div class="folder-stats">
<span class="stat-item"><?= count($page->files) ?> files</span>
<span class="stat-separator">•</span>
<span class="stat-item"><?= $page->totalSize ?></span>
<span class="stat-separator">•</span>
<span class="stat-item">Last updated: <?= $page->lastModified ?></span>
</div>
<div class="folder-info">
<h1 class="folder-title">
<span class="folder-icon">📁</span>
<?= htmlspecialchars($page->title) ?>
</h1>
<div class="folder-stats">
<span class="stat-item"><?= count($page->files) ?> files</span>
<span class="stat-separator">•</span>
<span class="stat-item"><?= $page->totalSize ?></span>
<span class="stat-separator">•</span>
<span class="stat-item">Last updated: <?= $page->lastModified ?></span>
</div>
<div class="folder-actions">
<?php if ($page->title !== 'documents' && $page->title !== 'media'): ?>
<form method="POST" action="/storage/folders/<?= urlencode($page->title) ?>/delete" style="display:inline;">
<input type="hidden" name="_csrf" value="<?= htmlspecialchars($page->csrf) ?>">
<button type="submit" class="btn btn-danger"
onclick="return confirm('Delete folder <?= htmlspecialchars($page->title) ?>?');">
<span class="btn-icon">🗑️</span>Delete Folder
</button>
</form>
<?php endif; ?>
</div>
<div class="folder-actions">
<?php if ($page->title !== 'documents' && $page->title !== 'media'): ?>
<form method="POST" action="/storage/folders/<?= urlencode($page->title) ?>/delete" style="display:inline;">
<input type="hidden" name="_csrf" value="<?= htmlspecialchars($page->csrf) ?>">
<button type="submit" class="btn btn-danger"
onclick="return confirm('Delete folder <?= htmlspecialchars($page->title) ?>?');">
<span class="btn-icon">🗑️</span>Delete Folder
</button>
</form>
<?php endif; ?>
<a href="/" class="btn btn-secondary">
<span class="btn-icon">👈</span>Back to Dashboard
</a>
</div>
</header>
<a href="/" class="btn btn-secondary">
<span class="btn-icon">👈</span>Back to Dashboard
</a>
</div>

View File

@@ -21,22 +21,23 @@ $page = $viewModel->page;
</head>
<body>
<?php if ($page->layoutConfig->header === 'default'): ?>
<header>
<header class="main-header">
<nav class="navbar">
<span class="navbar-brand">Cloud Control Panel</span>
<a href="/" class="back-link">👈 Back</a>
</nav>
</header>
<?php else: ?>
<?php
$headerFile = __DIR__ . '/../headers/' . $page->layoutConfig->header . '.php';
if (file_exists($headerFile)):
include $headerFile;
?>
<?php endif; ?>
<?php elseif ($page->layoutConfig->header !== null): ?>
<header class="main-header ">
<?php
$headerFile = __DIR__ . '/../headers/' . $page->layoutConfig->header . '.php';
if (file_exists($headerFile)):
include $headerFile;
?>
<?php endif; ?>
</header>
<?php endif; ?>
<main class="container">
@@ -55,5 +56,6 @@ $page = $viewModel->page;
</p>
</footer>
<?php endif; ?>
<script src="/js/burger.js"></script>
</body>
</html>