2014-09-02 09:36:42 +02:00
|
|
|
<ul>
|
2014-09-14 17:00:31 +02:00
|
|
|
<%
|
2014-09-16 18:51:36 +02:00
|
|
|
var links = [['home', '#/home', 'Home', 'fa-home']];
|
2014-09-14 17:00:31 +02:00
|
|
|
if (canListPosts) {
|
2014-09-16 18:51:36 +02:00
|
|
|
links.push(['posts', '#/posts', 'Posts', 'fa-th']);
|
2014-09-14 17:00:31 +02:00
|
|
|
if (canUploadPosts) {
|
2014-09-16 18:51:36 +02:00
|
|
|
links.push(['upload', '#/upload', 'Upload', 'fa-upload']);
|
2014-09-14 17:00:31 +02:00
|
|
|
}
|
2014-09-16 18:51:36 +02:00
|
|
|
links.push(['comments', '#/comments', 'Comments', 'fa-comments']);
|
2014-09-14 17:00:31 +02:00
|
|
|
}
|
|
|
|
if (canListTags) {
|
2014-09-16 18:51:36 +02:00
|
|
|
links.push(['tags', '#/tags', 'Tags', 'fa-tags']);
|
2014-09-14 17:00:31 +02:00
|
|
|
}
|
|
|
|
if (canListUsers) {
|
2014-09-16 18:51:36 +02:00
|
|
|
links.push(['users', '#/users', 'Users', 'fa-users']);
|
2014-09-14 17:00:31 +02:00
|
|
|
}
|
|
|
|
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']);
|
2014-09-14 17:00:31 +02:00
|
|
|
} 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-14 17:00:31 +02:00
|
|
|
}
|
2014-09-16 18:51:36 +02:00
|
|
|
links.push(['help', '#/help', 'Help', 'fa-question-circle']);
|
2014-09-14 17:00:31 +02:00
|
|
|
%>
|
2014-09-07 19:49:11 +02:00
|
|
|
|
2014-09-14 17:00:31 +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] %><!--
|
2014-09-14 17:00:31 +02:00
|
|
|
--><li class="<%= className %>">
|
2014-09-16 18:51:36 +02:00
|
|
|
<a href="<%= target %>">
|
|
|
|
<i class="fa <%= iconClassName %>"></i><br/>
|
|
|
|
<%= title %>
|
|
|
|
</a>
|
2014-09-14 17:00:31 +02:00
|
|
|
</li><!--
|
|
|
|
--><% }) %>
|
2014-09-02 09:36:42 +02:00
|
|
|
</ul>
|