2017-04-17 12:45:29 -04:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Aviat\AnimeClient;
|
|
|
|
|
|
|
|
$whose = $config->get('whose_list') . "'s ";
|
|
|
|
$lastSegment = $urlGenerator->lastSegment();
|
|
|
|
$extraSegment = $lastSegment === 'list' ? '/list' : '';
|
|
|
|
|
|
|
|
?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<h1 class="flex flex-align-end flex-wrap">
|
|
|
|
<span class="flex-no-wrap grow-1">
|
|
|
|
<?php if(strpos($route_path, 'collection') === FALSE): ?>
|
2017-04-17 14:49:33 -04:00
|
|
|
<?= $helper->a(
|
|
|
|
$urlGenerator->defaultUrl($url_type),
|
|
|
|
$whose . ucfirst($url_type) . ' List'
|
|
|
|
) ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php if($config->get("show_{$url_type}_collection")): ?>
|
2017-04-17 12:45:29 -04:00
|
|
|
[<?= $helper->a(
|
2017-09-14 15:32:53 -04:00
|
|
|
$url->generate("{$url_type}.collection.view") . $extraSegment,
|
2017-04-17 12:45:29 -04:00
|
|
|
ucfirst($url_type) . ' Collection'
|
|
|
|
) ?>]
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php endif ?>
|
2017-09-14 15:32:53 -04:00
|
|
|
<?php if($config->get("show_{$other_type}_collection")): ?>
|
|
|
|
[<?= $helper->a(
|
|
|
|
$url->generate("{$other_type}.collection.view") . $extraSegment,
|
|
|
|
ucfirst($other_type) . ' Collection'
|
|
|
|
) ?>]
|
|
|
|
<?php endif ?>
|
2017-04-17 12:45:29 -04:00
|
|
|
[<?= $helper->a(
|
|
|
|
$urlGenerator->defaultUrl($other_type) . $extraSegment,
|
|
|
|
ucfirst($other_type) . ' List'
|
|
|
|
) ?>]
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php else: ?>
|
2017-04-17 12:45:29 -04:00
|
|
|
<?= $whose . ucfirst($url_type) . ' Collection' ?>
|
2017-04-17 14:49:33 -04:00
|
|
|
[<?= $helper->a($urlGenerator->defaultUrl('anime') . $extraSegment, 'Anime List') ?>]
|
|
|
|
[<?= $helper->a($urlGenerator->defaultUrl('manga') . $extraSegment, 'Manga List') ?>]
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php endif ?>
|
|
|
|
</span>
|
2017-04-17 12:45:29 -04:00
|
|
|
|
|
|
|
<span class="flex-no-wrap small-font">[<?= $helper->a(
|
|
|
|
$url->generate('user_info'),
|
|
|
|
'About '. $config->get('whose_list')
|
|
|
|
) ?>]</span>
|
|
|
|
|
2017-02-15 16:30:14 -05:00
|
|
|
<?php if ($auth->isAuthenticated()): ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<span class="flex-no-wrap"> </span>
|
|
|
|
<span class="flex-no-wrap small-font">
|
2017-04-17 12:45:29 -04:00
|
|
|
<button type="button" class="js-clear-cache user-btn">Clear API Cache</button>
|
|
|
|
</span>
|
2016-07-27 14:32:37 -04:00
|
|
|
<span class="flex-no-wrap"> </span>
|
2017-01-16 11:26:19 -05:00
|
|
|
<?php endif ?>
|
2017-04-17 12:45:29 -04:00
|
|
|
|
2016-07-27 14:32:37 -04:00
|
|
|
<span class="flex-no-wrap small-font">
|
2017-02-15 16:30:14 -05:00
|
|
|
<?php if ($auth->isAuthenticated()): ?>
|
2017-04-17 12:45:29 -04:00
|
|
|
<?= $helper->a(
|
|
|
|
$url->generate('logout'),
|
|
|
|
'Logout',
|
|
|
|
['class' => 'bracketed']
|
|
|
|
) ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<?php else: ?>
|
2017-04-17 12:45:29 -04:00
|
|
|
[<?= $helper->a($url->generate('login'), "{$whose} Login") ?>]
|
2017-01-05 13:41:32 -05:00
|
|
|
<?php endif ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
</span>
|
|
|
|
</h1>
|
|
|
|
<nav>
|
2017-02-16 14:30:39 -05:00
|
|
|
<?php if ($container->get('util')->isViewPage()): ?>
|
2016-07-27 14:32:37 -04:00
|
|
|
<?= $helper->menu($menu_name) ?>
|
|
|
|
<br />
|
|
|
|
<ul>
|
2017-04-17 12:45:29 -04:00
|
|
|
<li class="<?= Util::isNotSelected('list', $lastSegment) ?>"><a href="<?= $urlGenerator->url($route_path) ?>">Cover View</a></li>
|
|
|
|
<li class="<?= Util::isSelected('list', $lastSegment) ?>"><a href="<?= $urlGenerator->url("{$route_path}/list") ?>">List View</a></li>
|
2016-07-27 14:32:37 -04:00
|
|
|
</ul>
|
|
|
|
<?php endif ?>
|
2017-01-10 12:35:46 -05:00
|
|
|
</nav>
|