diff options
| -rw-r--r-- | client/html/posts_header.tpl | 6 | ||||
| -rw-r--r-- | client/js/controllers/post_list_controller.js | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/client/html/posts_header.tpl b/client/html/posts_header.tpl index 7d5fa78..1e30eb4 100644 --- a/client/html/posts_header.tpl +++ b/client/html/posts_header.tpl @@ -6,10 +6,12 @@ %><button id='randomize-button' class='icon-button'><% %><i class="fa fa-random"><% %></button><% - %><% if (ctx.enableSafety) { %><% + %><% if (ctx.enableSafety && (ctx.canListSketchy || ctx.canListUnsafe)) { %><% %><input data-safety=safe type='button' class='mousetrap safety safety-safe <%- ctx.settings.listPosts.safe ? '' : 'disabled' %>'/><% %><input data-safety=sketchy type='button' class='mousetrap safety safety-sketchy <%- ctx.settings.listPosts.sketchy ? '' : 'disabled' %>'/><% - %><input data-safety=unsafe type='button' class='mousetrap safety safety-unsafe <%- ctx.settings.listPosts.unsafe ? '' : 'disabled' %>'/><% + if (ctx.canListUnsafe) { + %><input data-safety=unsafe type='button' class='mousetrap safety safety-unsafe <%- ctx.settings.listPosts.unsafe ? '' : 'disabled' %>'/><% + } %><% } %><% %><% if (ctx.isLoggedIn) { %><% %><a href class='mousetrap icon-button query-shortcut' data-term='special:liked'><% diff --git a/client/js/controllers/post_list_controller.js b/client/js/controllers/post_list_controller.js index 0146e9e..9e5d6d5 100644 --- a/client/js/controllers/post_list_controller.js +++ b/client/js/controllers/post_list_controller.js @@ -44,6 +44,8 @@ class PostListController { parameters: ctx.parameters, isLoggedIn: api.isLoggedIn(), enableSafety: api.safetyEnabled(), + canListSketchy: api.hasPrivilege("posts:list:sketchy"), + canListUnsafe: api.hasPrivilege("posts:list:unsafe"), canBulkEditTags: api.hasPrivilege("posts:bulk-edit:tags"), canBulkEditSafety: api.hasPrivilege("posts:bulk-edit:safety"), canViewMetrics: api.hasPrivilege("metrics:list"), |