-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use template inheritance when possible in views
- Loading branch information
Showing
17 changed files
with
991 additions
and
992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!DOCTYPE html> | ||
<html lang="<?= e(\Aurora\System\Container::get('language')->getCode()) ?>"> | ||
<head> | ||
<title> | ||
<?php $this->sectionStart('title') ?> | ||
<?php $this->sectionEnd() ?> | ||
</title> | ||
<?= $this->include('admin/partials/head.php') ?> | ||
</head> | ||
<body class="admin"> | ||
<nav> | ||
<header> | ||
<img src="/public/assets/logo.svg"/> | ||
<h1>Aurora</h1> | ||
</header> | ||
<div class="admin-options"> | ||
<a href="/admin/dashboard"> | ||
<?= $this->include('icons/home.svg') ?> <?= t('dashboard') ?> | ||
</a> | ||
<a href="<?= e($this->url()) ?>" target="_blank"> | ||
<?= $this->include('icons/window.svg') ?> <?= t('view_site') ?> | ||
</a> | ||
<a href="/admin/pages" separator> | ||
<?= $this->include('icons/book.svg') ?> <?= t('pages') ?> | ||
</a> | ||
<a href="/admin/posts"> | ||
<?= $this->include('icons/pencil.svg') ?> <?= t('posts') ?> | ||
</a> | ||
<a href="/admin/tags"> | ||
<?= $this->include('icons/tag.svg') ?> <?= t('tags') ?> | ||
</a> | ||
<a href="/admin/media"> | ||
<?= $this->include('icons/image.svg') ?> <?= t('media') ?> | ||
</a> | ||
<a href="/admin/users"> | ||
<?= $this->include('icons/user.svg') ?> <?= t('users') ?> | ||
</a> | ||
<a href="/admin/links"> | ||
<?= $this->include('icons/link.svg') ?> <?= t('links') ?> | ||
</a> | ||
<a href="/admin/settings"> | ||
<?= $this->include('icons/settings.svg') ?> <?= t('settings') ?> | ||
</a> | ||
</div> | ||
<div class="current-user"> | ||
<a href="/admin/users/edit?id=<?= e($_SESSION['user']['id']) ?>" title="<?= e($_SESSION['user']['name']) ?>"> | ||
<?php if (!empty($_SESSION['user']['image'])): ?> | ||
<img src="<?= e($this->getContentUrl($_SESSION['user']['image'])) ?>"/> | ||
<?php else: ?> | ||
<img src="/public/assets/no-image.svg" class="empty-img"/> | ||
<?php endif ?> | ||
</a> | ||
<div id="toggle-theme" class="pointer" title="<?= t('switch_theme') ?>" data-theme="<?php if (($_COOKIE['theme'] ?? '') !== 'dark'): ?>light<?php else: ?>dark<?php endif ?>"> | ||
<?= $this->include('icons/moon.svg') ?> | ||
<?= $this->include('icons/sun.svg') ?> | ||
</div> | ||
<a href="/admin/logout" class="pointer" title="<?= t('logout') ?>"> | ||
<?= $this->include('icons/logout.svg') ?> | ||
</a> | ||
</div> | ||
</nav> | ||
<noscript class="warning">Looks like JavaScript is disabled or your browser does not support it. JavaScript is required for the site to work properly.</noscript> | ||
<div class="nav-background" onclick="document.body.toggleAttribute('nav-open')"></div> | ||
<?= $this->include('admin/partials/snackbar.php') ?> | ||
<div class="content"> | ||
<?php $this->sectionStart('content') ?> | ||
<?php $this->sectionEnd() ?> | ||
</div> | ||
</body> | ||
</html> | ||
<script> | ||
window.addEventListener('load', () => { | ||
document.querySelectorAll('.admin-options > a').forEach(el => { | ||
if (location.pathname.startsWith(el.getAttribute('href'))) { | ||
el.dataset.checked = true; | ||
} | ||
}); | ||
|
||
Dropdown.init(); | ||
}); | ||
|
||
document.getElementById('toggle-theme').addEventListener('click', () => { | ||
let theme = get('#css-dark').toggleAttribute('disabled') ? 'light' : 'dark'; | ||
get('#toggle-theme').dataset.theme = theme; | ||
document.cookie = 'theme=' + theme + ';path=/'; | ||
}); | ||
</script> | ||
<?php $this->sectionStart('script') ?> | ||
<?php $this->sectionEnd() ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,93 @@ | ||
<!DOCTYPE html> | ||
<html lang="<?= e($this->lang()) ?>"> | ||
<head> | ||
<title><?= t('dashboard') . ' - ' . e(setting('title')) ?></title> | ||
<?= $this->include('admin/partials/head.php') ?> | ||
</head> | ||
<body class="admin"> | ||
<?= $this->include('admin/partials/nav.php') ?> | ||
<div class="content"> | ||
<div> | ||
<div class="page-title"> | ||
<?= $this->include('admin/partials/menu_btn.php') ?> | ||
<h2><?= t('dashboard') ?></h2> | ||
</div> | ||
<?php $this->extend('admin/base.php') ?> | ||
|
||
<?php $this->sectionStart('title') ?> | ||
<?= t('dashboard') . ' - ' . e(setting('title')) ?> | ||
<?php $this->sectionEnd() ?> | ||
|
||
<?php $this->sectionStart('content') ?> | ||
<div> | ||
<div class="page-title"> | ||
<?= $this->include('admin/partials/menu_btn.php') ?> | ||
<h2><?= t('dashboard') ?></h2> | ||
</div> | ||
<div class="grid"> | ||
<div class="grid grid-two-columns"> | ||
<div class="grid"> | ||
<?php if (!empty($links)): ?> | ||
<div class="card dashboard v-spacing"> | ||
<h3><?= t('links') ?></h3> | ||
<div class="dashboard-card-rows links"> | ||
<?php foreach ($links as $link): ?> | ||
<a href="<?= e($link['url']) ?>" target="_blank"> | ||
<?= e($link['title']) ?> | ||
</a> | ||
<?php endforeach ?> | ||
</div> | ||
</div> | ||
<?php endif ?> | ||
</div> | ||
<div class="grid"> | ||
<div class="grid grid-two-columns"> | ||
<div class="grid"> | ||
<?php if (!empty($links)): ?> | ||
<div class="card dashboard v-spacing"> | ||
<h3><?= t('latest_published_posts') ?></h3> | ||
<div class="dashboard-card-rows"> | ||
<?php foreach ($posts as $post): ?> | ||
<a href="<?= e('/' . setting('blog_url') . '/' . $post['slug']) ?>" target="_blank"> | ||
<img src="<?= e($this->getContentUrl($post['image'] ?? '')) ?>" alt="<?= e($post['title']) ?>" <?php if (empty($post['image'])): ?> style="visibility: hidden;" <?php endif ?>/> | ||
<div> | ||
<b><?= e($post['title']) ?></b> | ||
<span class="subtitle"> | ||
<?php if ($post['user_id']): ?> | ||
<?= t('by') . ' ' . e($post['user_name']) ?> | ||
<?php else: ?> | ||
| ||
<?php endif ?> | ||
</span> | ||
</div> | ||
<h3><?= t('links') ?></h3> | ||
<div class="dashboard-card-rows links"> | ||
<?php foreach ($links as $link): ?> | ||
<a href="<?= e($link['url']) ?>" target="_blank"> | ||
<?= e($link['title']) ?> | ||
</a> | ||
<?php endforeach ?> | ||
<?php if (empty($posts)): ?> | ||
<span class="empty"><?= t('no_results') ?></span> | ||
<?php endif ?> | ||
</div> | ||
</div> | ||
<?php endif ?> | ||
<div class="card dashboard v-spacing"> | ||
<h3><?= t('latest_published_posts') ?></h3> | ||
<div class="dashboard-card-rows"> | ||
<?php foreach ($posts as $post): ?> | ||
<a href="<?= e('/' . setting('blog_url') . '/' . $post['slug']) ?>" target="_blank"> | ||
<img src="<?= e($this->getContentUrl($post['image'] ?? '')) ?>" alt="<?= e($post['title']) ?>" <?php if (empty($post['image'])): ?> style="visibility: hidden;" <?php endif ?>/> | ||
<div> | ||
<b><?= e($post['title']) ?></b> | ||
<span class="subtitle"> | ||
<?php if ($post['user_id']): ?> | ||
<?= t('by') . ' ' . e($post['user_name']) ?> | ||
<?php else: ?> | ||
| ||
<?php endif ?> | ||
</span> | ||
</div> | ||
</a> | ||
<?php endforeach ?> | ||
<?php if (empty($posts)): ?> | ||
<span class="empty"><?= t('no_results') ?></span> | ||
<?php endif ?> | ||
</div> | ||
</div> | ||
<div class="grid"> | ||
<div class="card dashboard v-spacing"> | ||
<h3><?= t('start_creating') ?></h3> | ||
<div class="start-creating"> | ||
<a href="/admin/pages/edit"><?= $this->include('icons/book.svg') ?> <span><?= t('create_page') ?></span></a> | ||
<a href="/admin/posts/edit"><?= $this->include('icons/pencil.svg') ?> <span><?= t('write_post') ?></span></a> | ||
<a href="/admin/users/edit"><?= $this->include('icons/user.svg') ?> <span><?= t('add_user') ?></span></a> | ||
<a href="/admin/tags/edit"><?= $this->include('icons/tag.svg') ?> <span><?= t('add_tag') ?></span></a> | ||
</div> | ||
</div> | ||
<div class="grid"> | ||
<div class="card dashboard v-spacing"> | ||
<h3><?= t('start_creating') ?></h3> | ||
<div class="start-creating"> | ||
<a href="/admin/pages/edit"><?= $this->include('icons/book.svg') ?> <span><?= t('create_page') ?></span></a> | ||
<a href="/admin/posts/edit"><?= $this->include('icons/pencil.svg') ?> <span><?= t('write_post') ?></span></a> | ||
<a href="/admin/users/edit"><?= $this->include('icons/user.svg') ?> <span><?= t('add_user') ?></span></a> | ||
<a href="/admin/tags/edit"><?= $this->include('icons/tag.svg') ?> <span><?= t('add_tag') ?></span></a> | ||
</div> | ||
<div class="card dashboard v-spacing"> | ||
<h3><?= t('statistics') ?></h3> | ||
<div> | ||
<div class="input-group"> | ||
<b><?= t('posts') ?></b> | ||
<span> | ||
<?= e($total_posts) ?> <?= t('published') ?>, | ||
<?= e($total_scheduled_posts) ?> <?= t('scheduled') ?>, | ||
<?= e($total_draft_posts) ?> <?= t('draft') ?> | ||
</span> | ||
</div> | ||
<div class="input-group"> | ||
<b><?= t('pages') ?></b> | ||
<span> | ||
<?= e($total_pages) ?> <?= t('published') ?>, | ||
<?= e($total_draft_pages) ?> <?= t('draft') ?> | ||
</span> | ||
</div> | ||
<div class="input-group"> | ||
<b><?= t('users') ?></b> | ||
<span> | ||
<?= e($total_users) ?> <?= t('active') ?>, | ||
<?= e($total_inactive_users) ?> <?= t('inactive') ?> | ||
</span> | ||
</div> | ||
</div> | ||
<div class="card dashboard v-spacing"> | ||
<h3><?= t('statistics') ?></h3> | ||
<div> | ||
<div class="input-group"> | ||
<b><?= t('posts') ?></b> | ||
<span> | ||
<?= e($total_posts) ?> <?= t('published') ?>, | ||
<?= e($total_scheduled_posts) ?> <?= t('scheduled') ?>, | ||
<?= e($total_draft_posts) ?> <?= t('draft') ?> | ||
</span> | ||
</div> | ||
<div class="input-group"> | ||
<b><?= t('pages') ?></b> | ||
<span> | ||
<?= e($total_pages) ?> <?= t('published') ?>, | ||
<?= e($total_draft_pages) ?> <?= t('draft') ?> | ||
</span> | ||
</div> | ||
<div class="input-group"> | ||
<b><?= t('users') ?></b> | ||
<span> | ||
<?= e($total_users) ?> <?= t('active') ?>, | ||
<?= e($total_inactive_users) ?> <?= t('inactive') ?> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
<?php $this->sectionEnd() ?> |
Oops, something went wrong.