This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/_sakura/templates/yuuno/global/header.tpl

239 lines
14 KiB
Smarty
Raw Normal View History

2015-04-06 21:23:54 +00:00
<!DOCTYPE html>
<html>
<head>
<!-- META -->
<meta charset="{{ sakura.charset }}" />
<title>{{ page.title }}</title>
2015-08-20 23:17:27 +00:00
<meta name="description" content="{{ sakura.siteDesc }}" />
<meta name="keywords" content="{{ sakura.siteTags }}" />
2015-04-06 21:23:54 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="msapplication-TileColor" content="#fbeeff" />
<meta name="msapplication-TileImage" content="/content/images/icons/ms-icon-144x144.png" />
2015-08-23 22:08:36 +00:00
<meta name="theme-color" content="#9475B2" />
2015-04-08 17:18:19 +00:00
{% if page.redirect %}
2015-04-08 19:27:51 +00:00
<meta http-equiv="refresh" content="3; URL={{ page.redirect }}" />
2015-04-08 17:18:19 +00:00
{% endif %}
<link rel="apple-touch-icon" sizes="57x57" href="/content/images/icons/apple-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="60x60" href="/content/images/icons/apple-icon-60x60.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/content/images/icons/apple-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76" href="/content/images/icons/apple-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/content/images/icons/apple-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120" href="/content/images/icons/apple-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/content/images/icons/apple-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152" href="/content/images/icons/apple-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/content/images/icons/apple-icon-180x180.png" />
<link rel="icon" type="image/png" sizes="192x192" href="/content/images/icons/android-icon-192x192.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/content/images/icons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="96x96" href="/content/images/icons/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/content/images/icons/favicon-16x16.png" />
<link rel="manifest" href="/manifest.json" />
2015-04-06 21:23:54 +00:00
<!-- CSS -->
2015-04-27 00:41:59 +00:00
<link rel="stylesheet" type="text/css" href="{{ sakura.resources }}/css/yuuno.css" />
2015-05-03 21:43:25 +00:00
{% if page.style %}
<style type="text/css">
{% for element,properties in page.style %}
{{ element|raw }} {
{% for property,value in properties %}
{{ property|raw }}: {{ value|raw }};
{% endfor %}
}
{% endfor %}
</style>
{% endif %}
2015-04-06 21:23:54 +00:00
<!-- JS -->
2015-04-27 00:41:59 +00:00
<script type="text/javascript" src="{{ sakura.resources }}/js/yuuno.js"></script>
2015-04-06 21:23:54 +00:00
<script type="text/javascript">
2015-05-09 00:56:55 +00:00
// Create an object so we can access certain settings from remote JavaScript files
var sakuraVars = {
"cookie": {
2015-08-20 23:17:27 +00:00
"prefix": "{{ sakura.cookie.prefix }}",
"domain": "{{ sakura.cookie.domain }}",
"path": "{{ sakura.cookie.path }}"
2015-05-09 00:56:55 +00:00
},
2015-08-20 23:17:27 +00:00
"urlMain": "{{ sakura.urlMain }}",
"content": "{{ sakura.contentPath }}",
"resources": "{{ sakura.resources }}",
"recaptchaEnabled": "{{ sakura.recaptchaEnabled }}",
2015-05-09 00:56:55 +00:00
2015-08-20 23:17:27 +00:00
"minUserLen": {{ sakura.minUsernameLength }},
"maxUserLen": {{ sakura.maxUsernameLength }},
"minPwdEntropy": {{ sakura.minPwdEntropy }},
"checkLogin": {% if session.checkLogin %}true{% else %}false{% endif %}
2015-05-09 00:56:55 +00:00
};
// Space for things that need to happen onload
2015-08-10 15:52:15 +00:00
window.addEventListener("load", function() {
2015-05-25 18:18:56 +00:00
// Alter the go to top button
var gotop = document.getElementById('gotop');
gotop.setAttribute('href', 'javascript:void(0);');
gotop.setAttribute('onclick', 'scrollToTop();');
2015-08-19 19:44:01 +00:00
{% if session.checkLogin %}
2015-08-10 15:52:15 +00:00
// Convert href to object in logout link
prepareAjaxLink('headerLogoutLink', 'submitPost', ', true, "Logging out..."');
2015-08-20 23:17:27 +00:00
{% elseif not sakura.lockAuth and php.self != '/authenticate.php' %}
2015-08-10 15:52:15 +00:00
// Make the header login form dynamic
var headerLoginForm = document.getElementById('headerLoginForm');
var createInput = document.createElement('input');
var submit = headerLoginForm.querySelector('[type="submit"]');
createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden');
headerLoginForm.appendChild(createInput);
2015-08-19 19:44:01 +00:00
2015-08-10 15:52:15 +00:00
submit.setAttribute('type', 'button');
submit.setAttribute('onclick', 'submitPost(\''+ headerLoginForm.action +'\', formToObject(\'headerLoginForm\'), true, \'Logging in...\');');
{% endif %}
2015-08-19 19:44:01 +00:00
{% if session.checkLogin %}
2015-05-09 00:56:55 +00:00
// Make notification requests (there's a seperate one to make it happen before the first 60 seconds)
notifyRequest('{{ php.sessionid }}');
2015-08-10 15:52:15 +00:00
// Create interval
setInterval(function() {
notifyRequest('{{ php.sessionid }}');
}, 60000);
2015-05-09 00:56:55 +00:00
{% endif %}
2015-08-19 19:44:01 +00:00
{% if php.self == '/profile.php' and session.checkLogin and user.data.id != profile.user.id %}
2015-08-10 15:52:15 +00:00
// Make friend button dynamic
prepareAjaxLink('profileFriendToggle', 'submitPost', ', true, "{% if profile.friend == 0 %}Adding{% else %}Removing{% endif %} friend..."');
{% endif %}
2015-08-19 19:44:01 +00:00
{% if php.self == '/viewtopic.php' and session.checkLogin %}
2015-08-10 15:52:15 +00:00
var forumFriendToggles = document.querySelectorAll('.forum-friend-toggle');
for(var i in forumFriendToggles) {
prepareAjaxLink(forumFriendToggles[i], 'submitPost', ', true, "Please wait..."');
}
2015-06-20 16:06:07 +00:00
{% endif %}
2015-08-20 23:17:27 +00:00
{% if php.self == '/authenticate.php' and not sakura.lockAuth %}
2015-08-10 15:52:15 +00:00
// AJAX Form Submission
var forms = {
2015-04-21 14:23:28 +00:00
{% if not auth.changingPass %}
"loginForm": 'Logging in...',
2015-08-20 23:17:27 +00:00
{% if not sakura.disableRegistration %}"registerForm": 'Processing registration...',{% endif %}
{% if not sakura.requireActivation %}"resendForm": 'Attempting to resend activation...',{% endif %}
"passwordForm": 'Sending password recovery mail...'
2015-04-21 14:23:28 +00:00
{% else %}
"passwordForm": 'Changing password...'
{% endif %}
};
for(var i in forms) {
var form = document.getElementById(i);
var submit = form.querySelector('[type="submit"]');
2015-04-27 15:13:52 +00:00
form.setAttribute('onkeydown', 'formEnterCatch(event, \''+ submit.id +'\');');
submit.setAttribute('href', 'javascript:void(0);');
2015-08-10 15:52:15 +00:00
submit.setAttribute('onclick', 'submitPost(\''+ form.action +'\', formToObject(\''+ i+ '\'), true, \''+ forms[i] +'\', '+ (i == 'registerForm' ? 'true' : 'false') +');');
submit.setAttribute('type', 'button');
var createInput = document.createElement('input');
createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden');
form.appendChild(createInput);
}
{% endif %}
2015-08-23 22:08:36 +00:00
{% if php.self == '/profile.php' ? profile.data.userData.profileBackground : (user.checkPermission('SITE', 'CREATE_BACKGROUND') and user.data.userData.userOptions.profileBackgroundSiteWide and user.data.userData.profileBackground) %}
2015-08-19 19:44:01 +00:00
initialiseParallax('userBackground');
{% endif %}
2015-08-10 15:52:15 +00:00
});
2015-04-06 21:23:54 +00:00
</script>
</head>
2015-05-04 20:08:53 +00:00
<body>
2015-04-06 21:23:54 +00:00
<div id="container">
<span id="top"></span>
<div class="header" id="header">
2015-08-20 23:17:27 +00:00
<a class="logo" href="//{{ sakura.urlMain }}/">{{ sakura.siteName }}</a>
2015-04-06 21:23:54 +00:00
<div class="menu">
<div class="menu-nav fa" id="navMenuSite">
2015-04-06 21:23:54 +00:00
<!-- Navigation menu, displayed on left side of the bar. -->
<a class="menu-item fa-home" href="/" title="Home"></a>
<a class="menu-item fa-newspaper-o" href="/news" title="News"></a>
<a class="menu-item fa-commenting" href="//chat.{{ sakura.urlMain }}/" title="Chat"></a>
2015-08-23 22:08:36 +00:00
{% if user.checkPermission('FORUM', 'USE_FORUM') %}
<a class="menu-item fa-list" href="/forum" title="Forums"></a>
2015-08-23 22:08:36 +00:00
{% endif %}
<a class="menu-item fa-search" href="/search" title="Search"></a>
2015-08-19 19:44:01 +00:00
{% if session.checkLogin %}
<a class="menu-item fa-users" href="/members" title="Members"></a>
<a class="menu-item menu-donate fa-heart" href="/support" title="Support us"></a>
2015-04-18 18:26:52 +00:00
{% endif %}
2015-04-06 21:23:54 +00:00
</div>
<div class="menu-ucp fa" id="navMenuUser">
2015-04-06 21:23:54 +00:00
<!-- User menu, displayed on right side of the bar. -->
2015-08-19 19:44:01 +00:00
{% if session.checkLogin %}
<a class="menu-item avatar" href="/u/{{ user.data.id }}" title="Logged in as {{ user.data.username }}" style="background-image: url('/a/{{ user.data.id }}'); width: auto; color: {{ user.colour }}; font-weight: 700;"></a>
<a class="menu-item fa-envelope" href="/messages" title="Messages"></a>
<a class="menu-item fa-gavel" href="/manage" title="Manage"></a>
<a class="menu-item fa-cogs" href="/settings" title="Settings"></a>
<a class="menu-item fa-sign-out" href="/logout?mode=logout&amp;time={{ php.time }}&amp;session={{ php.sessionid }}&amp;redirect={{ sakura.currentPage }}" title="Logout" id="headerLogoutLink"></a>
2015-04-17 22:51:53 +00:00
{% else %}
2015-08-20 23:17:27 +00:00
{% if sakura.lockAuth %}
<div class="menu-item fa-lock" style="padding-left: 10px; padding-right: 10px;" title="Authentication is locked"></div>
2015-04-24 19:31:09 +00:00
{% else %}
<a class="menu-item fa-sign-in" href="/authenticate" title="Login"></a>
2015-04-24 19:31:09 +00:00
{% endif %}
2015-04-17 22:51:53 +00:00
{% endif %}
2015-04-06 21:23:54 +00:00
</div>
<div class="menu-mob">
<a class="menu-item" id="mobileNavToggle" href="javascript:;" onclick="mobileMenu(true);">Open Menu</a>
</div>
<div class="clear"></div>
</div>
</div>
<div id="contentwrapper">
2015-05-09 00:56:55 +00:00
<div id="notifications"></div>
2015-08-23 22:08:36 +00:00
{% if php.self == '/profile.php' ? profile.data.userData.profileBackground : (user.checkPermission('SITE', 'CREATE_BACKGROUND') and user.data.userData.userOptions.profileBackgroundSiteWide and user.data.userData.profileBackground) %}
2015-08-19 19:44:01 +00:00
<div id="userBackground" style="background-image: url('/bg/{{ (php.self == '/profile.php' ? profile : user).data.id }}');"></div>
{% endif %}
{% if not session.checkLogin and php.self != '/authenticate.php' %}
2015-06-19 16:12:44 +00:00
<form method="post" action="/authenticate" id="headerLoginForm" onkeydown="formEnterCatch(event, 'headerLoginButton');">
2015-08-20 23:17:27 +00:00
<input type="hidden" name="redirect" value="{{ sakura.currentPage }}" />
<input type="hidden" name="session" value="{{ php.sessionid }}" />
<input type="hidden" name="time" value="{{ php.time }}" />
<input type="hidden" name="mode" value="login" />
2015-04-24 17:48:56 +00:00
<div>
<label for="headerLoginUserName">Username:</label>
<input type="text" id="headerLoginUserName" name="username" class="inputStyling" placeholder="Username" />
</div>
<div>
<label for="headerLoginPassword">Password:</label>
<input type="password" id="headerLoginPassword" name="password" class="inputStyling" placeholder="Password" />
</div>
<div>
<input type="checkbox" name="remember" id="headerLoginRemember" />
<label for="headerLoginRemember">Remember me</label>
</div>
<div>
2015-06-19 16:12:44 +00:00
<input type="submit" id="headerLoginButton" name="submit" class="inputStyling small" value="Login" />
2015-04-24 17:48:56 +00:00
</div>
</form>
2015-04-06 21:23:54 +00:00
{% endif %}
2015-08-21 22:07:45 +00:00
{% if user.checkPermission('SITE', 'RESTRICTED') %}
<div class="headerNotify" style="padding-top: 10px; padding-bottom: 10px; background: repeating-linear-gradient(-45deg, #B33, #B33 10px, #B00 10px, #B00 20px); text-align: center; color: #FFF; border: 1px solid #C00; box-shadow: 0px 0px 3px #C00;">
<h1>Your account is current in <span style="font-width: 700 !important;">restricted mode</span>!</h1>
2015-08-23 22:08:36 +00:00
<div>A staff member has set your account to restricted mode most likely due to violation of the rules. While restricted you won't be able to use most public features of the site. If you think this is a mistake please <a href="/contact" style="color: inherit;">get in touch with one of our staff members</a>.</div>
2015-08-21 22:07:45 +00:00
</div>
{% endif %}
2015-04-25 20:08:44 +00:00
<noscript>
2015-08-23 22:08:36 +00:00
<div class="headerNotify" style="padding-top: 10px; padding-bottom: 10px; background: repeating-linear-gradient(-45deg, #C2AFFE, #C2AFFE 10px, #D3BFFF 10px, #D3BFFF 20px);">
2015-04-25 20:08:44 +00:00
<h1>You have JavaScript disabled!</h1>
2015-08-20 23:17:27 +00:00
<p style="padding: 0 10px;">A lot of things on this site require JavaScript to be enabled (e.g. the chat), we try to keep both sides happy but it is highly recommended that you enable it (you'll also have to deal with this message being here if you don't enable it).</p>
2015-04-25 20:08:44 +00:00
</div>
</noscript>