From 199584824b9b039cc5130c9016e5d0c6ca571549 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 9 Sep 2013 12:21:47 -0400 Subject: [PATCH] Don't show approval on admin user page if the site doesn't require approval of users (must_approve_users) --- .../controllers/admin_user_controller.js | 6 ++- .../admin/templates/user.js.handlebars | 48 ++++++++++--------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin_user_controller.js b/app/assets/javascripts/admin/controllers/admin_user_controller.js index d23b49ab2..d2c0e83c4 100644 --- a/app/assets/javascripts/admin/controllers/admin_user_controller.js +++ b/app/assets/javascripts/admin/controllers/admin_user_controller.js @@ -22,5 +22,9 @@ Discourse.AdminUserController = Discourse.ObjectController.extend({ }); this.toggleTitleEdit(); - } + }, + + showApproval: function() { + return Discourse.SiteSettings.must_approve_users; + }.property() }); diff --git a/app/assets/javascripts/admin/templates/user.js.handlebars b/app/assets/javascripts/admin/templates/user.js.handlebars index 474c27955..08979e4f6 100644 --- a/app/assets/javascripts/admin/templates/user.js.handlebars +++ b/app/assets/javascripts/admin/templates/user.js.handlebars @@ -64,32 +64,34 @@

{{i18n admin.user.permissions}}

-
-
{{i18n admin.users.approved}}
-
- {{#if approved}} - {{i18n admin.user.approved_by}} + {{#if showApproval}} +
+
{{i18n admin.users.approved}}
+
+ {{#if approved}} + {{i18n admin.user.approved_by}} - {{#linkTo 'adminUser' approved_by}}{{avatar approved_by imageSize="small"}}{{/linkTo}} - {{#linkTo 'adminUser' approved_by}}{{approved_by.username}}{{/linkTo}} - {{else}} - {{i18n no_value}} - {{/if}} - -
-
- {{#if approved}} - {{i18n admin.user.approve_success}} - {{else}} - {{#if can_approve}} - + {{#linkTo 'adminUser' approved_by}}{{avatar approved_by imageSize="small"}}{{/linkTo}} + {{#linkTo 'adminUser' approved_by}}{{approved_by.username}}{{/linkTo}} + {{else}} + {{i18n no_value}} {{/if}} - {{/if}} + +
+
+ {{#if approved}} + {{i18n admin.user.approve_success}} + {{else}} + {{#if can_approve}} + + {{/if}} + {{/if}} +
-
+ {{/if}}
{{i18n admin.users.active}}