2013-10-05 12:55:03 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2013-10-07 00:44:17 +02:00
|
|
|
<meta charset="utf-8"/>
|
2013-10-05 21:22:28 +02:00
|
|
|
<?php if (isset($this->context->subTitle)): ?>
|
|
|
|
<title><?php printf('%s – %s', $this->context->title, $this->context->subTitle) ?></title>
|
|
|
|
<?php else: ?>
|
|
|
|
<title><?php echo $this->context->title ?></title>
|
|
|
|
<?php endif ?>
|
2013-10-09 19:40:38 +02:00
|
|
|
<?php foreach (array_unique($this->context->stylesheets) as $name): ?>
|
2013-10-07 00:44:17 +02:00
|
|
|
<link rel="stylesheet" type="text/css" href="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/css/' . $name) ?>"/>
|
|
|
|
<?php endforeach ?>
|
2013-10-09 19:40:38 +02:00
|
|
|
<?php foreach (array_unique($this->context->scripts) as $name): ?>
|
2013-10-07 00:44:17 +02:00
|
|
|
<script type="text/javascript" src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/js/' . $name) ?>"></script>
|
2013-10-05 22:52:55 +02:00
|
|
|
<?php endforeach ?>
|
2013-10-19 22:56:56 +02:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
|
2013-10-05 12:55:03 +02:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2013-10-09 11:45:18 +02:00
|
|
|
<nav id="top-nav">
|
2013-10-05 22:52:55 +02:00
|
|
|
<div class="main-wrapper">
|
2013-10-14 00:25:40 +02:00
|
|
|
<ul class="main-nav">
|
2013-10-05 22:52:55 +02:00
|
|
|
<?php
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav = [];
|
|
|
|
|
|
|
|
$nav []= ['Home', \Chibi\UrlHelper::route('index', 'index')];
|
2013-10-18 00:09:50 +02:00
|
|
|
if (PrivilegesHelper::confirm(Privilege::ListPosts))
|
2013-10-07 23:17:33 +02:00
|
|
|
$nav []= ['Browse', \Chibi\UrlHelper::route('post', 'list')];
|
|
|
|
|
2013-10-21 13:13:10 +02:00
|
|
|
if (PrivilegesHelper::confirm(Privilege::ListPosts))
|
|
|
|
$nav []= ['Random', \Chibi\UrlHelper::route('post', 'random')];
|
|
|
|
|
2013-10-18 00:09:50 +02:00
|
|
|
if (PrivilegesHelper::confirm(Privilege::ListPosts))
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Favorites', \Chibi\UrlHelper::route('post', 'favorites')];
|
2013-10-05 22:52:55 +02:00
|
|
|
|
2013-10-18 00:09:50 +02:00
|
|
|
if (PrivilegesHelper::confirm(Privilege::UploadPost))
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Upload', \Chibi\UrlHelper::route('post', 'upload')];
|
|
|
|
|
2013-10-18 00:09:50 +02:00
|
|
|
if (PrivilegesHelper::confirm(Privilege::ListComments))
|
2013-10-12 12:38:49 +02:00
|
|
|
$nav []= ['Comments', \Chibi\UrlHelper::route('comment', 'list')];
|
|
|
|
|
2013-10-18 00:09:50 +02:00
|
|
|
if (PrivilegesHelper::confirm(Privilege::ListTags))
|
2013-10-12 12:38:49 +02:00
|
|
|
$nav []= ['Tags', \Chibi\UrlHelper::route('tag', 'list')];
|
|
|
|
|
2013-11-01 12:05:06 +01:00
|
|
|
if (PrivilegesHelper::confirm(Privilege::MassTag))
|
|
|
|
$nav []= ['Mass tag', \Chibi\UrlHelper::route('post', 'list', ['query' => isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '', 'source' => 'mass-tag'])];
|
|
|
|
|
2013-10-18 00:09:50 +02:00
|
|
|
if (PrivilegesHelper::confirm(Privilege::ListUsers))
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Users', \Chibi\UrlHelper::route('user', 'list')];
|
2013-10-06 13:21:16 +02:00
|
|
|
|
2013-10-05 22:52:55 +02:00
|
|
|
if (!$this->context->loggedIn)
|
|
|
|
{
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Log in', \Chibi\UrlHelper::route('auth', 'login')];
|
2013-10-16 18:07:23 +02:00
|
|
|
$nav []= ['Register', \Chibi\UrlHelper::route('user', 'registration')];
|
2013-10-05 22:52:55 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-10-12 10:46:15 +02:00
|
|
|
$nav []= ['My account', \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->user->name])];
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Log out', \Chibi\UrlHelper::route('auth', 'logout')];
|
2013-10-05 22:52:55 +02:00
|
|
|
}
|
|
|
|
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Help', \Chibi\UrlHelper::route('index', 'help')];
|
|
|
|
|
|
|
|
foreach ($nav as $navItem)
|
2013-10-05 22:52:55 +02:00
|
|
|
{
|
2013-10-07 20:44:14 +02:00
|
|
|
list ($text, $link) = $navItem;
|
2013-10-14 00:25:40 +02:00
|
|
|
echo '<li class="main-nav-item">';
|
2013-10-07 20:44:14 +02:00
|
|
|
echo '<a href="' . $link . '">' . $text . '</a>';
|
|
|
|
echo '</li>';
|
2013-10-05 22:52:55 +02:00
|
|
|
}
|
|
|
|
?>
|
2013-10-14 00:25:40 +02:00
|
|
|
|
2013-10-27 20:39:32 +01:00
|
|
|
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserSettings, PrivilegesHelper::getIdentitySubPrivilege($this->context->user))): ?>
|
2013-10-14 00:25:40 +02:00
|
|
|
<li class="safety">
|
|
|
|
<ul>
|
|
|
|
<?php foreach (PostSafety::getAll() as $safety): ?>
|
2013-10-18 00:09:50 +02:00
|
|
|
<?php if (PrivilegesHelper::confirm(Privilege::ListPosts, PostSafety::toString($safety))): ?>
|
2013-10-16 08:33:45 +02:00
|
|
|
<li class="safety-<?php echo TextHelper::camelCaseToHumanCase(PostSafety::toString($safety)) ?>">
|
|
|
|
<a href="<?php echo \Chibi\UrlHelper::route('user', 'toggle-safety', ['safety' => $safety]) ?>" class="<?php echo $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>" title="Searching <?php echo TextHelper::camelCaseToHumanCase(PostSafety::ToString($safety)) ?> posts: <?php echo $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>">
|
|
|
|
<span><?php echo TextHelper::camelCaseToHumanCase(PostSafety::toString($safety), true) ?></span>
|
2013-10-14 00:25:40 +02:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<li class="search">
|
2013-10-12 10:46:15 +02:00
|
|
|
<form name="search" action="<?php echo \Chibi\UrlHelper::route('post', 'list') ?>" method="get">
|
2013-10-21 14:24:34 +02:00
|
|
|
<input type="search" name="query" placeholder="Search…" value="<?php echo isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '' ?>" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/>
|
2013-10-12 10:46:15 +02:00
|
|
|
</form>
|
2013-10-13 12:28:16 +02:00
|
|
|
</li>
|
2013-10-05 22:52:55 +02:00
|
|
|
</ul>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
2013-10-05 19:24:08 +02:00
|
|
|
</nav>
|
2013-10-05 12:55:03 +02:00
|
|
|
|
2013-10-05 22:52:55 +02:00
|
|
|
<section id="content">
|
|
|
|
<div class="main-wrapper">
|
|
|
|
<?php echo $this->renderView() ?>
|
2013-10-12 22:54:25 +02:00
|
|
|
<div class="clear"></div>
|
2013-10-05 22:52:55 +02:00
|
|
|
</div>
|
2013-10-05 19:24:08 +02:00
|
|
|
</section>
|
2013-10-12 22:54:25 +02:00
|
|
|
|
|
|
|
<footer>
|
|
|
|
<div class="main-wrapper">
|
2013-10-19 12:53:49 +02:00
|
|
|
<span>Load: <?php echo sprintf('%.05f', microtime(true) - trueStartTime()) ?>s</span>
|
|
|
|
<span>Queries: <?php echo count(queryLogger()->getLogs()) ?></span>
|
|
|
|
<?php if ($this->config->main->debugQueries): ?>
|
|
|
|
<pre class="debug"><?php echo join('<br>', array_map(function($x) { return preg_replace('/\s+/', ' ', $x); }, queryLogger()->getLogs())) ?></pre>
|
|
|
|
<?php endif ?>
|
2013-10-20 11:12:56 +02:00
|
|
|
<span><a href="<?php echo SZURU_LINK ?>">szurubooru v<?php echo SZURU_VERSION ?></a></span>
|
2013-10-12 22:54:25 +02:00
|
|
|
</div>
|
|
|
|
</footer>
|
2013-10-05 12:55:03 +02:00
|
|
|
</body>
|
|
|
|
</html>
|