Fixed extra spaces between items in top navigation

This commit is contained in:
Marcin Kurczewski 2014-09-14 17:00:31 +02:00
parent 3e1aaebf89
commit e6073ba7c7

View file

@ -1,51 +1,33 @@
<ul> <ul>
<li class="home"> <%
<a href="#/home">Home</a> var links = [['home', '#/home', 'Home']];
</li> if (canListPosts) {
links.push(['posts', '#/posts', 'Posts']);
if (canUploadPosts) {
links.push(['upload', '#/upload', 'Upload']);
}
links.push(['comments', '#/comments', 'Comments']);
}
if (canListTags) {
links.push(['tags', '#/tags', 'Tags']);
}
if (canListUsers) {
links.push(['users', '#/users', 'Users']);
}
if (!loggedIn) {
links.push(['login', '#/login', 'Login']);
links.push(['register', '#/register', 'Register']);
} else {
links.push(['my-account', '#/user/' + user.name, user.name]);
links.push(['logout', '#/logout', 'Logout']);
}
links.push(['help', '#/help', 'Help']);
%>
<% if (canListPosts) { %> <% _.each(links, function(link) { %><!--
<li class="posts"> --><% var className = link[0], target=link[1], title=link[2] %><!--
<a href="#/posts">Posts</a> --><li class="<%= className %>">
</li> <a href="<%= target %>"><%= title %></a>
<% if (canUploadPosts) { %> </li><!--
<li class="upload"> --><% }) %>
<a href="#/upload">Upload</a>
</li>
<% } %>
<li class="comments">
<a href="#/comments">Comments</a>
</li>
<% } %>
<% if (canListTags) { %>
<li class="tags">
<a href="#/tags">Tags</a>
</li>
<% } %>
<% if (canListUsers) { %>
<li class="users">
<a href="#/users">Users</a>
</li>
<% } %>
<% if (!loggedIn) { %>
<li class="login">
<a href="#/login">Login</a>
</li>
<li class="register">
<a href="#/register">Register</a>
</li>
<% } else { %>
<li class="my-account">
<a href="#/user/<%= user.name %>"><%= user.name %></a>
</li>
<li class="logout">
<a href="#/logout">Logout</a>
</li>
<% } %>
<li class="help">
<a href="#/help">Help</a>
</li>
</ul> </ul>