diff --git a/app/assets/javascripts/admin/models/admin_user.js b/app/assets/javascripts/admin/models/admin_user.js index 79cc831289a..ba5bc32fcef 100644 --- a/app/assets/javascripts/admin/models/admin_user.js +++ b/app/assets/javascripts/admin/models/admin_user.js @@ -67,10 +67,8 @@ Discourse.AdminUser = Discourse.User.extend({ }, trustLevels: function() { - return Discourse.Site.instance().get('trustLevels').map(function (tl) { - return {id: tl.get('id'), name: tl.get('detailedName') }; - }); - }.property('trust_level'), + return Discourse.Site.instance().get('trustLevels'); + }.property(), dirty: Discourse.computed.propertyNotEqual('originalTrustLevel', 'trustLevel.id'), diff --git a/app/assets/javascripts/admin/templates/user.js.handlebars b/app/assets/javascripts/admin/templates/user.js.handlebars index 0690b6b2ea6..38775f17af2 100644 --- a/app/assets/javascripts/admin/templates/user.js.handlebars +++ b/app/assets/javascripts/admin/templates/user.js.handlebars @@ -165,7 +165,7 @@
{{i18n trust_level}}
- {{combobox content=trustLevels value=trust_level }} + {{combobox content=trustLevels value=trust_level nameProperty="detailedName"}}
{{#if dirty}} diff --git a/app/assets/javascripts/discourse/views/combobox_view.js b/app/assets/javascripts/discourse/views/combobox_view.js index 81a0a57f629..07364d8db51 100644 --- a/app/assets/javascripts/discourse/views/combobox_view.js +++ b/app/assets/javascripts/discourse/views/combobox_view.js @@ -13,6 +13,8 @@ Discourse.ComboboxView = Discourse.View.extend({ render: function(buffer) { + var nameProperty = this.get('nameProperty') || 'name'; + // Add none option if required if (this.get('none')) { buffer.push('"); @@ -33,10 +35,10 @@ Discourse.ComboboxView = Discourse.View.extend({ var data = ""; if (comboboxView.dataAttributes) { comboboxView.dataAttributes.forEach(function(a) { - data += "data-" + a + "=\"" + (o.get(a)) + "\" "; + data += "data-" + a + "=\"" + o.get(a) + "\" "; }); } - buffer.push(""); + buffer.push(""); }); } },