diff --git a/app/assets/javascripts/discourse/controllers/group_post_controller.js b/app/assets/javascripts/discourse/controllers/group_post_controller.js new file mode 100644 index 00000000000..45d4553d559 --- /dev/null +++ b/app/assets/javascripts/discourse/controllers/group_post_controller.js @@ -0,0 +1,21 @@ +Discourse.GroupPostController = Em.ObjectController.extend({ + + byName: function() { + var result = "", + longName = this.get('user_long_name'), + title = this.get('user_title'); + + if (!Em.isEmpty(longName)) { + result += longName; + } + if (!Em.isEmpty(title)) { + if (result.length > 0) { + result += ", "; + } + result += title; + } + return result; + }.property() + +}); + diff --git a/app/assets/javascripts/discourse/templates/group/index.js.handlebars b/app/assets/javascripts/discourse/templates/group/index.js.handlebars index 8e73e8e3ebb..afb673f8870 100644 --- a/app/assets/javascripts/discourse/templates/group/index.js.handlebars +++ b/app/assets/javascripts/discourse/templates/group/index.js.handlebars @@ -1,5 +1,5 @@
{{{unbound cooked}}}