mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FEATURE: Allow group owners to edit group name and avatar flair.
This commit is contained in:
parent
b45fd21ed9
commit
31acd311e5
26 changed files with 453 additions and 209 deletions
|
@ -1,7 +1,5 @@
|
|||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
import { propertyEqual } from 'discourse/lib/computed';
|
||||
import { escapeExpression } from 'discourse/lib/utilities';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
adminGroupsType: Ember.inject.controller(),
|
||||
|
@ -37,43 +35,6 @@ export default Ember.Controller.extend({
|
|||
];
|
||||
}.property(),
|
||||
|
||||
@computed
|
||||
demoAvatarUrl() {
|
||||
return Discourse.getURL('/images/avatar.png');
|
||||
},
|
||||
|
||||
@computed('model.flair_url')
|
||||
flairPreviewIcon() {
|
||||
return this.get('model.flair_url') && this.get('model.flair_url').substr(0,3) === 'fa-';
|
||||
},
|
||||
|
||||
@computed('flairPreviewIcon')
|
||||
flairPreviewImage() {
|
||||
return this.get('model.flair_url') && !this.get('flairPreviewIcon');
|
||||
},
|
||||
|
||||
@computed('flairPreviewImage', 'model.flair_url', 'model.flairBackgroundHexColor', 'model.flairHexColor')
|
||||
flairPreviewStyle() {
|
||||
var style = '';
|
||||
if (this.get('flairPreviewImage')) {
|
||||
style += 'background-image: url(' + escapeExpression(this.get('model.flair_url')) + '); ';
|
||||
}
|
||||
if (this.get('model.flairBackgroundHexColor')) {
|
||||
style += 'background-color: #' + this.get('model.flairBackgroundHexColor') + ';';
|
||||
}
|
||||
if (this.get('model.flairHexColor')) {
|
||||
style += 'color: #' + this.get('model.flairHexColor') + ';';
|
||||
}
|
||||
return style;
|
||||
},
|
||||
|
||||
@computed('model.flairBackgroundHexColor')
|
||||
flairPreviewClasses() {
|
||||
if (this.get('model.flairBackgroundHexColor')) {
|
||||
return 'rounded';
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
next() {
|
||||
if (this.get("showingLast")) { return; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue