diff options
Diffstat (limited to 'client/html/post_main.tpl')
| -rw-r--r-- | client/html/post_main.tpl | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/client/html/post_main.tpl b/client/html/post_main.tpl index 84e48b1..cebab17 100644 --- a/client/html/post_main.tpl +++ b/client/html/post_main.tpl @@ -29,7 +29,26 @@ <span class='vim-nav-hint'>Next post ></span> </a> </article> - <% if (ctx.canEditPosts || ctx.canDeletePosts || ctx.canFeaturePosts) { %> + <article class='random-post'> + <% if (ctx.randomPostId) { %> + <% if (ctx.editMode) { %> + <a rel='next' href='<%= ctx.getPostEditUrl(ctx.randomPostId, { + query: ctx.parameters.query, + metrics: ctx.parameters.metrics, + cachenumber: Math.round(Math.random() * 1000)}) %>'> + <% } else { %> + <a rel='next' href='<%= ctx.getPostUrl(ctx.randomPostId, { + query: ctx.parameters.query, + metrics: ctx.parameters.metrics, + cachenumber: Math.round(Math.random() * 1000)}) %>'> + <% } %> + <% } else { %> + <a rel='next' class='inactive'> + <% } %> + <i class='fa fa-random'></i> + <span class='vim-nav-hint'>Random post</span> + </a> + </article> <article class='edit-post'> <% if (ctx.editMode) { %> <a href='<%= ctx.getPostUrl(ctx.post.id, ctx.parameters) %>'> @@ -37,30 +56,45 @@ <span class='vim-nav-hint'>Back to view mode</span> </a> <% } else { %> - <a href='<%= ctx.getPostEditUrl(ctx.post.id, ctx.parameters) %>'> - <i class='fa fa-pencil'></i> - <span class='vim-nav-hint'>Edit post</span> + <% if (ctx.canEditPosts || ctx.canDeletePosts || ctx.canFeaturePosts) { %> + <a href='<%= ctx.getPostEditUrl(ctx.post.id, ctx.parameters) %>'> + <% } else { %> + <a class='inactive'> + <% } %> + <i class='fa fa-pencil-alt'></i> + <span class='vim-nav-hint'>Edit post</span> </a> <% } %> </article> - <% } %> </nav> <div class='sidebar-container'></div> + + <% if (window.innerWidth <= 1000) { %> + <div class='comments-panel'> + <% if (ctx.canListComments) { %> + <div class='comments-container'></div> + <% } %> + <% if (ctx.canCreateComments) { %> + <a id='add-comment-button'><h3>Add comment</h3></a> + <div class='comment-form-container'></div> + <% } %> + </div> + <% } %> </aside> <div class='content'> <div class='post-container'></div> - <div class='after-mobile-controls'> - <% if (ctx.canCreateComments) { %> - <h2>Add comment</h2> - <div class='comment-form-container'></div> - <% } %> - + <% if (window.innerWidth > 1000) { %> <% if (ctx.canListComments) { %> <div class='comments-container'></div> <% } %> - </div> + + <% if (ctx.canCreateComments) { %> + <a id='add-comment-button'><h3>Add comment</h3></a> + <div class='comment-form-container'></div> + <% } %> + <% } %> </div> </div> |