org settings: Move disable attribute to admin_auth_methods_list.

This commits disables the auth-methods table using the disabled attribute
in admin_auth_methods_list handlebars instead of doing that in
settings_org.
This commit is contained in:
Pragati Agrawal
2019-04-07 21:23:23 +05:30
committed by Tim Abbott
parent 75fc19acfd
commit 2277ee0c90
2 changed files with 2 additions and 3 deletions

View File

@@ -289,13 +289,12 @@ exports.populate_auth_methods = function (auth_methods) {
method: {
method: key,
enabled: auth_methods[key],
is_admin: page_params.is_admin,
},
}));
});
loading.destroy_indicator($('#admin_page_auth_methods_loading_indicator'));
if (!page_params.is_admin) {
$(".organization-box [data-name='auth-methods']")
.find("input, button, select, checked").attr("disabled", true);
var tip_box = $("<div class='tip'></div>")
.text(i18n.t("Only organization administrators can edit these settings."));
// Don't prepend a tip to custom emoji settings page. We handle it separately.

View File

@@ -5,7 +5,7 @@
</td>
<td>
<label class="checkbox">
<input type="checkbox" {{#if enabled}}checked="checked"{{/if}} />
<input type="checkbox" {{#if enabled}}checked="checked"{{/if}} {{#unless is_admin}}disabled{{/unless}}/>
<span></span>
</label>
</td>