From 7566d2e0f3b7f5e3bb80a8562b86419d2d5118db Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 11 Jun 2016 09:59:29 +0200 Subject: [PATCH] client/general: respect privileges --- client/html/post.tpl | 6 +- client/html/post_readonly_sidebar.tpl | 62 ++++++++++++------- client/html/posts_page.tpl | 6 +- client/html/users_page.tpl | 17 ++++- client/js/controllers/page_controller.js | 11 ++++ client/js/controllers/posts_controller.js | 11 ++-- client/js/controllers/tags_controller.js | 11 ++-- client/js/controllers/users_controller.js | 10 +-- .../controls/post_readonly_sidebar_control.js | 20 ++++-- client/js/util/views.js | 31 +++++++--- client/js/views/endless_page_view.js | 11 ++-- client/js/views/manual_page_view.js | 11 ++-- 12 files changed, 141 insertions(+), 66 deletions(-) diff --git a/client/html/post.tpl b/client/html/post.tpl index d767fa8d..00757774 100644 --- a/client/html/post.tpl +++ b/client/html/post.tpl @@ -28,7 +28,11 @@ Back to view mode <% } else { %> - + <% if (ctx.canEditPosts) { %> + + <% } else { %> + + <% } %> Edit post diff --git a/client/html/post_readonly_sidebar.tpl b/client/html/post_readonly_sidebar.tpl index fabfedc0..a95e5c31 100644 --- a/client/html/post_readonly_sidebar.tpl +++ b/client/html/post_readonly_sidebar.tpl @@ -39,30 +39,42 @@
- <% if (ctx.post.ownFavorite) { %> - + <% if (ctx.canFavoritePosts) { %> + <% if (ctx.post.ownFavorite) { %> + + <% } else { %> + + <% } %> <% } else { %> - + <% } %> <%= ctx.post.favoriteCount %>
@@ -74,12 +86,20 @@