FEATURE: Add Group#full_name.

This commit is contained in:
Guo Xiang Tan
2016-12-13 16:16:26 +08:00
parent 5a2794a0c7
commit 43ee9f884e
14 changed files with 30 additions and 15 deletions

View File

@@ -11,6 +11,11 @@
{{#if model.id}}
{{#unless model.automatic}}
<div>
<label for='full_name'>{{i18n 'groups.edit.full_name'}}</label>
{{input type='text' name='full_name' value=model.full_name class='group-edit-full-name'}}
</div>
<div>
<label for="bio">{{i18n 'groups.bio'}}</label>
{{d-editor value=model.bio_raw}}

View File

@@ -36,9 +36,9 @@ export default Ember.Controller.extend({
return !automatic && isGroupOwner;
},
@computed('model.name', 'model.title')
groupName(name, title) {
return (title || name).capitalize();
@computed('model.name', 'model.full_name')
groupName(name, fullName) {
return (fullName || name).capitalize();
},
@computed('model.name', 'model.flair_url', 'model.flair_bg_color', 'model.flair_color')

View File

@@ -134,7 +134,8 @@ const Group = Discourse.Model.extend({
flair_color: this.get('flairHexColor'),
bio_raw: this.get('bio_raw'),
public: this.get('public'),
allow_membership_requests: this.get('allow_membership_requests')
allow_membership_requests: this.get('allow_membership_requests'),
full_name: this.get('full_name')
};
},

View File

@@ -1,8 +1,8 @@
<div class='group-edit'>
<form class="form-horizontal">
<div class="control-group">
<label for='title'>{{i18n 'groups.edit.group_title'}}</label>
{{input type='text' name='title' value=model.title class='group-edit-title'}}
<label for='full_name'>{{i18n 'groups.edit.full_name'}}</label>
{{input type='text' name='full_name' value=model.full_name class='group-edit-full-name'}}
</div>
<div class="control-group">

View File

@@ -16,7 +16,7 @@
<span class='group-title'>{{groupName}}</span>
</h1>
{{#if model.title}}
{{#if model.full_name}}
<h3 class='group-name'>@{{model.name}}</h3>
{{/if}}
</span>