szurubooru/public_html/templates/top-navigation.tpl

37 lines
1.1 KiB
Smarty
Raw Normal View History

2014-09-02 09:36:42 +02:00
<ul>
<%
2014-09-16 18:51:36 +02:00
var links = [['home', '#/home', 'Home', 'fa-home']];
if (canListPosts) {
2014-09-16 18:51:36 +02:00
links.push(['posts', '#/posts', 'Posts', 'fa-th']);
if (canUploadPosts) {
2014-09-16 18:51:36 +02:00
links.push(['upload', '#/upload', 'Upload', 'fa-upload']);
}
2014-09-16 18:51:36 +02:00
links.push(['comments', '#/comments', 'Comments', 'fa-comments']);
}
if (canListTags) {
2014-09-16 18:51:36 +02:00
links.push(['tags', '#/tags', 'Tags', 'fa-tags']);
}
if (canListUsers) {
2014-09-16 18:51:36 +02:00
links.push(['users', '#/users', 'Users', 'fa-users']);
}
if (!loggedIn) {
2014-09-16 18:51:36 +02:00
links.push(['login', '#/login', 'Login', 'fa-sign-in']);
links.push(['register', '#/register', 'Register', 'fa-file-text-o']);
} else {
2014-09-16 18:51:36 +02:00
links.push(['my-account', '#/user/' + user.name, 'Account', 'fa-user']);
links.push(['logout', '#/logout', 'Logout', 'fa-sign-out']);
}
2014-09-16 18:51:36 +02:00
links.push(['help', '#/help', 'Help', 'fa-question-circle']);
%>
2014-09-07 19:49:11 +02:00
<% _.each(links, function(link) { %><!--
2014-09-16 18:51:36 +02:00
--><% var className = link[0], target=link[1], title=link[2], iconClassName=link[3] %><!--
--><li class="<%= className %>">
2014-09-17 11:48:10 +02:00
<a class="big-button" href="<%= target %>">
2014-09-16 18:51:36 +02:00
<i class="fa <%= iconClassName %>"></i><br/>
<%= title %>
</a>
</li><!--
--><% }) %>
2014-09-02 09:36:42 +02:00
</ul>