HummingBirdAnimeClient/src/views/header.php

43 lines
1.6 KiB
PHP
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<title><?= $title ?></title>
<meta charset="utf-8" />
2015-09-14 15:49:20 -04:00
<link rel="stylesheet" href="<?= $urlGenerator->asset_url('css.php?g=base') ?>" />
<script>
2015-09-14 15:49:20 -04:00
var BASE_URL = "<?= $urlGenerator->base_url($url_type) ?>";
var CONTROLLER = "<?= $url_type ?>";
</script>
</head>
<body class="<?= $url_type ?> list">
<h1 class="flex flex-align-end flex-wrap">
<span class="flex-no-wrap grow-1">
2015-09-14 15:49:20 -04:00
<a href="<?= $urlGenerator->default_url($url_type) ?>">
<?= WHOSE ?> <?= ucfirst($url_type) ?> <?= (strpos($route_path, 'collection') !== FALSE) ? 'Collection' : 'List' ?>
2015-09-14 15:49:20 -04:00
</a> [<a href="<?= $urlGenerator->default_url($other_type) ?>"><?= ucfirst($other_type) ?> List</a>]
</span>
<span class="flex-no-wrap small-font">
<?php if (is_logged_in()): ?>
2015-09-14 15:49:20 -04:00
[<a href="<?= $urlGenerator->full_url("/logout", $url_type) ?>">Logout</a>]
<?php else: ?>
2015-09-14 15:49:20 -04:00
[<a href="<?= $urlGenerator->full_url("/login", $url_type) ?>"><?= WHOSE ?> Login</a>]
<?php endif ?>
</span>
</h1>
<?php if ( ! empty($nav_routes)): ?>
<nav>
<ul>
<?php foreach($nav_routes as $title => $nav_path): ?>
2015-09-14 15:49:20 -04:00
<li class="<?= is_selected($nav_path, $route_path) ?>"><a href="<?= $urlGenerator->url($nav_path) ?>"><?= $title ?></a></li>
<?php endforeach ?>
</ul>
<?php if (is_view_page()): ?>
<br />
<ul>
2015-09-14 15:49:20 -04:00
<li class="<?= is_not_selected('list', last_segment()) ?>"><a href="<?= $urlGenerator->url($route_path) ?>">Cover View</a></li>
<li class="<?= is_selected('list', last_segment()) ?>"><a href="<?= $urlGenerator->url("{$route_path}/list") ?>">List View</a></li>
</ul>
<?php endif ?>
</nav>
<br />
<?php endif ?>