mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 05:52:40 +03:00
Properly use htmlSafe styles
This commit is contained in:
parent
43bb09ef23
commit
6aa171077e
@ -25,7 +25,7 @@ export default Ember.Component.extend({
|
||||
}),
|
||||
|
||||
authorAvatarBackground: Ember.computed('authorAvatar', function () {
|
||||
return `background-image: url(${this.get('authorAvatar')})`.htmlSafe();
|
||||
return Ember.String.htmlSafe(`background-image: url(${this.get('authorAvatar')})`);
|
||||
}),
|
||||
|
||||
viewOrEdit: Ember.computed('previewIsHidden', function () {
|
||||
|
@ -48,10 +48,12 @@ export default Ember.Component.extend({
|
||||
const email = this.get('validEmail'),
|
||||
size = this.get('size');
|
||||
|
||||
let style = '';
|
||||
if (email) {
|
||||
let url = `http://www.gravatar.com/avatar/${md5(email)}?s=${size}&d=blank`;
|
||||
return Ember.String.htmlSafe(`background-image: url(${url})`);
|
||||
style = `background-image: url(${url})`;
|
||||
}
|
||||
return Ember.String.htmlSafe(style);
|
||||
}),
|
||||
|
||||
didInsertElement: function () {
|
||||
|
@ -14,7 +14,7 @@ export default Ember.Component.extend({
|
||||
userImageBackground: Ember.computed('user.image', 'userDefault', function () {
|
||||
var url = this.get('user.image') || this.get('userDefault');
|
||||
|
||||
return `background-image: url(${url})`.htmlSafe();
|
||||
return Ember.String.htmlSafe(`background-image: url(${url})`);
|
||||
}),
|
||||
|
||||
lastLogin: Ember.computed('user.last_login', function () {
|
||||
|
@ -56,7 +56,7 @@ export default Ember.Controller.extend(ValidationEngine, {
|
||||
userImageBackground: Ember.computed('user.image', 'userDefault', function () {
|
||||
var url = this.get('user.image') || this.get('userDefault');
|
||||
|
||||
return `background-image: url(${url})`.htmlSafe();
|
||||
return Ember.String.htmlSafe(`background-image: url(${url})`);
|
||||
}),
|
||||
|
||||
// end duplicated
|
||||
@ -68,7 +68,7 @@ export default Ember.Controller.extend(ValidationEngine, {
|
||||
coverImageBackground: Ember.computed('user.cover', 'coverDefault', function () {
|
||||
var url = this.get('user.cover') || this.get('coverDefault');
|
||||
|
||||
return `background-image: url(${url})`.htmlSafe();
|
||||
return Ember.String.htmlSafe(`background-image: url(${url})`);
|
||||
}),
|
||||
|
||||
coverTitle: Ember.computed('user.name', function () {
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
<div class="view-container settings-user">
|
||||
|
||||
<figure class="user-cover" style="{{coverImageBackground}}">
|
||||
<figure class="user-cover" style={{coverImageBackground}}>
|
||||
<button class="btn btn-default user-cover-edit js-modal-cover" {{action "openModal" "upload" user "cover"}}>Change Cover</button>
|
||||
</figure>
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<fieldset class="user-details-top">
|
||||
|
||||
<figure class="user-image">
|
||||
<div id="user-image" class="img" style="{{userImageBackground}}"><span class="hidden">{{user.name}}"s Picture</span></div>
|
||||
<div id="user-image" class="img" style={{userImageBackground}}><span class="hidden">{{user.name}}"s Picture</span></div>
|
||||
<button type="button" {{action "openModal" "upload" user "image"}} class="edit-user-image js-modal-image">Edit Picture</button>
|
||||
</figure>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user