diff options
| author | Hunternif <hunternif@gmail.com> | 2019-04-10 01:22:53 +0700 |
|---|---|---|
| committer | Hunternif <hunternif@gmail.com> | 2019-04-10 01:22:53 +0700 |
| commit | 9c1db76434312c3dcfcb8b075cd79fd8a7e5fd12 (patch) | |
| tree | 2ae267ff0aef14e862020ac40066036fbf629b73 /client/html | |
| parent | 51c0f500c0293e0fdf7e686296b45db09bdfe287 (diff) | |
client/post: Add sidebar navigation button to go to random post
Diffstat (limited to 'client/html')
| -rw-r--r-- | client/html/post_main.tpl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client/html/post_main.tpl b/client/html/post_main.tpl index 4f7a59e..2d55538 100644 --- a/client/html/post_main.tpl +++ b/client/html/post_main.tpl @@ -29,6 +29,20 @@ <span class='vim-nav-hint'>Next post ></span> </a> </article> + <article class='random-post'> + <% if (ctx.randomPostId) { %> + <% if (ctx.editMode) { %> + <a rel='next' href='<%= ctx.getPostEditUrl(ctx.randomPostId, ctx.parameters) %>'> + <% } else { %> + <a rel='next' href='<%= ctx.getPostUrl(ctx.randomPostId, ctx.parameters) %>'> + <% } %> + <% } 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) %>'> |