finna test this shit
This commit is contained in:
parent
92835df662
commit
ac07d0a641
3 changed files with 32 additions and 4 deletions
|
@ -7,6 +7,12 @@ namespace Sakura;
|
||||||
|
|
||||||
class Users {
|
class Users {
|
||||||
|
|
||||||
|
// Check if a user is logged in
|
||||||
|
public static function loggedIn() {
|
||||||
|
|
||||||
|
// Just return false for now since we don't have a user system yet
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,5 +51,8 @@ $renderData = array(
|
||||||
'version' => SAKURA_VERSION,
|
'version' => SAKURA_VERSION,
|
||||||
'urls' => Configuration::getLocalConfig('urls'),
|
'urls' => Configuration::getLocalConfig('urls'),
|
||||||
'charset' => Configuration::getConfig('charset')
|
'charset' => Configuration::getConfig('charset')
|
||||||
|
],
|
||||||
|
'user' => [
|
||||||
|
'loggedin' => Users::loggedIn()
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,7 +12,21 @@
|
||||||
<link rel="stylesheet" type="text/css" href="//{{ sakura.urls.content }}/css/yuuno/yuuno.css" />
|
<link rel="stylesheet" type="text/css" href="//{{ sakura.urls.content }}/css/yuuno/yuuno.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" />
|
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" />
|
||||||
<!-- JS -->
|
<!-- JS -->
|
||||||
<script type="text/javascript" src="//{{ sakura.urls.content }}/js/yuuno.min.js"></script>
|
<script type="text/javascript" src="//{{ sakura.urls.content }}/js/yuuno.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
{% if user.loggedin %}
|
||||||
|
var headerLoginBtn = document.getElementById('headerLoginBtn');
|
||||||
|
|
||||||
|
headerLoginBtn.setAtrribute('href', 'javascript:;');
|
||||||
|
headerLoginBtn.setAtrribute('onclick', 'toggleLoginForm();');
|
||||||
|
|
||||||
|
function toggleLoginForm() {
|
||||||
|
var headerLoginForm = document.getElementById('headerLoginForm');
|
||||||
|
|
||||||
|
headerLoginForm.className = (headerLoginForm.className == 'hidden' ? '' : 'hidden');
|
||||||
|
}
|
||||||
|
{% endif %}
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="container">
|
<div id="container">
|
||||||
|
@ -27,7 +41,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-ucp" id="navMenuUser">
|
<div class="menu-ucp" id="navMenuUser">
|
||||||
<!-- "UCP" menu, displayed on right side of the bar. -->
|
<!-- "UCP" menu, displayed on right side of the bar. -->
|
||||||
<a class="menu-item" href="http://{{ sakura.urls.main }}/login" title="Login to Flashii">Login</a>
|
<a class="menu-item" id="headerLoginBtn" href="http://{{ sakura.urls.main }}/login" title="Login to Flashii">Login</a>
|
||||||
<a class="menu-item" href="http://{{ sakura.urls.main }}/register" title="Create an account">Register</a>
|
<a class="menu-item" href="http://{{ sakura.urls.main }}/register" title="Create an account">Register</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-mob">
|
<div class="menu-mob">
|
||||||
|
@ -36,4 +50,9 @@
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="contentwrapper"> <!-- I DIDN'T WANT TO DO THIS -->
|
<div id="contentwrapper">
|
||||||
|
{% if user.loggedin %}
|
||||||
|
<div class="hidden" id="headerLoginForm">
|
||||||
|
login form
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
Reference in a new issue