mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 15:05:18 +08:00
FEATURE: add flair to avatars using new settings in the groups admin UI
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
import { propertyEqual } from 'discourse/lib/computed';
|
||||
import { escapeExpression } from 'discourse/lib/utilities';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
needs: ['adminGroupsType'],
|
||||
@ -35,6 +36,23 @@ export default Ember.Controller.extend({
|
||||
];
|
||||
}.property(),
|
||||
|
||||
flairPreviewStyle: function() {
|
||||
var style = '';
|
||||
if (this.get('model.flair_url')) {
|
||||
style += 'background-image: url(' + escapeExpression(this.get('model.flair_url')) + '); ';
|
||||
}
|
||||
if (this.get('model.flairBackgroundHexColor')) {
|
||||
style += 'background-color: #' + this.get('model.flairBackgroundHexColor') + ';';
|
||||
}
|
||||
return style;
|
||||
}.property('model.flair_url', 'model.flairBackgroundHexColor'),
|
||||
|
||||
flairPreviewClasses: function() {
|
||||
if (this.get('model.flairBackgroundHexColor')) {
|
||||
return 'rounded';
|
||||
}
|
||||
}.property('model.flairBackgroundHexColor'),
|
||||
|
||||
actions: {
|
||||
next() {
|
||||
if (this.get("showingLast")) { return; }
|
||||
|
Reference in New Issue
Block a user