<% if (ctx.results.length) { %>
<% } %>
diff --git a/client/html/tag_categories.tpl b/client/html/tag_categories.tpl
index 5abd0f5c..cc8fe6ac 100644
--- a/client/html/tag_categories.tpl
+++ b/client/html/tag_categories.tpl
@@ -10,7 +10,7 @@
- <% _.each(ctx.tagCategories, category => { %>
+ <% for (let category of ctx.tagCategories) { %>
<% if (category.default) { %>
<% } else { %>
@@ -50,7 +50,7 @@
<% } %>
- <% }) %>
+ <% } %>
diff --git a/client/html/tag_relations.tpl b/client/html/tag_relations.tpl
index 39c09d46..1d354633 100644
--- a/client/html/tag_relations.tpl
+++ b/client/html/tag_relations.tpl
@@ -1,16 +1,16 @@
<% if (ctx.suggestions.length) { %>
- <% _.each(ctx.suggestions.slice(0, 20), tagName => { %>
+ <% for (let tagName of ctx.suggestions.slice(0, 20)) { %>
- <%= ctx.makeTagLink(tagName) %>
- <% }) %>
+ <% } %>
<% } %>
<% if (ctx.siblings.length) { %>
- <% _.each(ctx.siblings.slice(0, 20), tagName => { %>
+ <% for (let tagName of ctx.siblings.slice(0, 20)) { %>
- <%= ctx.makeTagLink(tagName) %>
- <% }) %>
+ <% } %>
<% } %>
diff --git a/client/html/tags_page.tpl b/client/html/tags_page.tpl
index 774ff615..cca8daa8 100644
--- a/client/html/tags_page.tpl
+++ b/client/html/tags_page.tpl
@@ -39,21 +39,21 @@
- <% _.each(ctx.results, tag => { %>
+ <% for (let tag of ctx.results) { %>
- <% _.each(tag.names, name => { %>
+ <% for (let name of tag.names) { %>
- <%= ctx.makeTagLink(name) %>
- <% }) %>
+ <% } %>
|
<% if (tag.implications.length) { %>
- <% _.each(tag.implications, name => { %>
+ <% for (let name of tag.implications) { %>
- <%= ctx.makeTagLink(name) %>
- <% }) %>
+ <% } %>
<% } else { %>
-
@@ -62,9 +62,9 @@
|
<% if (tag.suggestions.length) { %>
- <% _.each(tag.suggestions, name => { %>
+ <% for (let name of tag.suggestions) { %>
- <%= ctx.makeTagLink(name) %>
- <% }) %>
+ <% } %>
<% } else { %>
-
@@ -77,7 +77,7 @@
<%= ctx.makeRelativeTime(tag.lastEditTime) %>
|
- <% }) %>
+ <% } %>
<% } %>
diff --git a/client/html/top_nav.tpl b/client/html/top_nav.tpl
index 75a7ad1b..860b5f89 100644
--- a/client/html/top_nav.tpl
+++ b/client/html/top_nav.tpl
@@ -1,6 +1,6 @@
diff --git a/client/html/users_page.tpl b/client/html/users_page.tpl
index 6c145c88..a906828d 100644
--- a/client/html/users_page.tpl
+++ b/client/html/users_page.tpl
@@ -1,6 +1,6 @@
<% _.each(ctx.results, user => { %><% for (let user of ctx.results) { %>-
<% }) %><% } %><%= ctx.makeFlexboxAlign() %>
diff --git a/client/js/controllers/top_nav_controller.js b/client/js/controllers/top_nav_controller.js
index f030770e..15485585 100644
--- a/client/js/controllers/top_nav_controller.js
+++ b/client/js/controllers/top_nav_controller.js
@@ -4,6 +4,25 @@ const api = require('../api.js');
const events = require('../events.js');
const TopNavView = require('../views/top_nav_view.js');
+function _createNavigationItemMap() {
+ const ret = new Map();
+ ret.set('home', new NavigationItem('H', 'Home', '/'));
+ ret.set('posts', new NavigationItem('P', 'Posts', '/posts'));
+ ret.set('upload', new NavigationItem('U', 'Upload', '/upload'));
+ ret.set('comments', new NavigationItem('C', 'Comments', '/comments'));
+ ret.set('tags', new NavigationItem('T', 'Tags', '/tags'));
+ ret.set('users', new NavigationItem('S', 'Users', '/users'));
+ ret.set('account', new NavigationItem('A', 'Account', '/user/{me}'));
+ ret.set('register', new NavigationItem('R', 'Register', '/register'));
+ ret.set('login', new NavigationItem('L', 'Log in', '/login'));
+ ret.set('logout', new NavigationItem('O', 'Logout', '/logout'));
+ ret.set('help', new NavigationItem('E', 'Help', '/help'));
+ ret.set(
+ 'settings',
+ new NavigationItem(null, '