misuzu/views/mio/master.twig

138 lines
5.9 KiB
Twig
Raw Normal View History

2018-07-06 01:28:06 +00:00
{% from '@mio/macros.twig' import navigation %}
2018-03-22 02:56:41 +00:00
{% set mio_navigation = {
2018-04-14 02:58:53 +00:00
'Home': '/',
'News': '/news.php',
2018-05-18 01:20:27 +00:00
'Forum': '/forum/',
2018-04-14 02:58:53 +00:00
'Chat': 'https://chat.flashii.net',
2018-05-27 23:24:16 +00:00
'Members': '/members.php',
2018-03-22 02:56:41 +00:00
} %}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% include '@mio/_layout/meta.twig' %}
<link href="https://static.flash.moe/fonts/visitor/visitor1.css" rel="stylesheet">
2018-03-27 03:15:03 +00:00
<link href="/css/mio.css" rel="stylesheet">
2018-05-26 22:26:27 +00:00
<link href="/css/libraries.css" rel="stylesheet">
2018-03-22 02:56:41 +00:00
</head>
<body class="mio">
<div class="mio__wrapper">
2018-04-16 00:33:54 +00:00
<nav class="header">
<div class="header__logo">
<a href="/" class="header__logo__link">
<img class="header__logo__image" src="https://static.flash.moe/logos/logo-exo.png" alt="Flashii">
2018-03-22 02:56:41 +00:00
</a>
</div>
2018-03-27 03:15:03 +00:00
2018-04-16 00:33:54 +00:00
<div class="header__menu">
2018-05-16 02:58:21 +00:00
{% if app.hasActiveSession %}
2018-04-16 00:33:54 +00:00
<div class="container header__user">
2018-05-16 02:58:21 +00:00
<div class="container__title">Hey, {{ current_user.username }}!</div>
2018-04-16 00:33:54 +00:00
<div class="container__content header__user__content">
<a href="/settings.php?m=images" class="avatar header__user__avatar" style="background-image:url('/profile.php?u={{ current_user.user_id }}&amp;m=avatar');"></a>
2018-04-16 00:33:54 +00:00
<div class="header__user__links__container">
<ul class="header__user__links">
2018-05-16 02:58:21 +00:00
<li class="header__user__option"><a class="header__user__link" href="/profile.php?u={{ current_user.user_id }}">Profile</a></li>
2018-04-16 00:33:54 +00:00
<li class="header__user__option"><a class="header__user__link" href="/settings.php">Settings</a></li>
2018-07-07 23:24:34 +00:00
{% if has_manage_access %}
<li class="header__user__option"><a class="header__user__link" href="{{ manage_link|default('/manage/index.php') }}">Manage</a></li>
{% endif %}
2018-04-16 00:33:54 +00:00
<li class="header__user__option"><a class="header__user__link" href="/auth.php?m=logout&amp;s={{ csrf_token() }}">Logout</a></li>
2018-03-22 02:56:41 +00:00
</ul>
</div>
</div>
</div>
{% else %}
2018-04-16 00:33:54 +00:00
<a href="/auth.php" class="input__button">Login/Register</a>
2018-03-22 02:56:41 +00:00
{% endif %}
</div>
2018-03-27 03:15:03 +00:00
</nav>
2018-03-22 02:56:41 +00:00
{% block content %}
2018-04-16 00:33:54 +00:00
<div class="container">
<div class="container__title">Hello!</div>
<div class="container__content">
2018-03-22 02:56:41 +00:00
This page has no content!
</div>
</div>
{{ navigation(mio_navigation) }}
{% endblock %}
2018-04-16 00:33:54 +00:00
<footer class="footer">
<div class="footer__copyright">
2018-07-06 01:28:06 +00:00
{{ 'https://flash.moe'|html_link('Flashwave', 'footer__copyright__link')|raw }} 2013-{{
2018-03-22 02:56:41 +00:00
''|date('Y') }} /
<span title="{{ git_commit_hash(true) }}">
{{ git_branch() }} # {{ git_commit_hash() }}
2018-07-06 01:28:06 +00:00
</span>
{# link('https://github.com/flashwave/misuzu/tree/' ~ git_branch(), git_branch(), 'footer__copyright__link') }} # {{ link('https://github.com/flashwave/misuzu/commit/' ~ git_commit_hash(true), git_commit_hash(), 'footer__copyright__link') #}
2018-03-22 02:56:41 +00:00
</div>
2018-04-16 00:33:54 +00:00
<div class="footer__links">
2018-07-06 01:28:06 +00:00
{% autoescape false %}
{{ '#'|html_link('Rules', 'footer__links__link') }} |
{{ '#'|html_link('Contact', 'footer__links__link') }} |
{{ '#'|html_link('Status', 'footer__links__link') }} |
{{ '/changelog.php'|html_link('Changelog', 'footer__links__link') }} |
{{ 'https://twitter.com/flashiinet'|html_link('Twitter', 'footer__links__link') }}
{% endautoescape %}
2018-03-22 02:56:41 +00:00
</div>
2018-03-27 03:15:03 +00:00
</footer>
2018-03-22 02:56:41 +00:00
</div>
<script src="/js/libraries.js" charset="utf-8"></script>
<script>
window.addEventListener('load', () => {
timeago().render(document.querySelectorAll('time'));
2018-05-26 22:26:27 +00:00
hljs.initHighlighting();
});
// move this to an external JS/TS file eventually.
const containerClass = 'container',
containerHiddenClass = 'container--hidden';
function validateContainer(elem) {
return elem.classList.contains(containerClass);
}
function containerIsClosed(elem) {
return elem.classList.contains(containerHiddenClass);
}
function toggleContainer(id) {
const elem = document.getElementById(id);
if (!validateContainer(elem))
return;
if (containerIsClosed(elem))
2018-05-24 19:31:48 +00:00
openContainer(id);
else
2018-05-24 19:31:48 +00:00
closeContainer(id);
}
function openContainer(id) {
const elem = document.getElementById(id);
if (!validateContainer(elem) || !containerIsClosed(elem))
return;
elem.classList.remove(containerHiddenClass);
}
function closeContainer(id) {
const elem = document.getElementById(id);
if (!validateContainer(elem) || containerIsClosed(elem))
return;
elem.classList.add(containerHiddenClass);
}
</script>
2018-03-22 02:56:41 +00:00
</body>
</html>