Fixed display of Gravatar for accounts
This commit is contained in:
parent
82020e9ae6
commit
face5d5e99
3 changed files with 8 additions and 4 deletions
|
@ -603,9 +603,8 @@ HopObject.prototype.creator_macro = function(param, mode) {
|
|||
html.link({href: this.creator.url}, this.creator.name);
|
||||
} else if (mode === 'url') {
|
||||
res.write(this.creator.url);
|
||||
} else if (mode === 'gravatar' && this.creator.email) {
|
||||
res.write('https://secure.gravatar.com/avatar/');
|
||||
res.write(this.creator.email.trim().toLowerCase().md5());
|
||||
} else if (mode === 'gravatar') {
|
||||
this.creator.gravatar_macro(param);
|
||||
} else {
|
||||
res.write(this.creator.name);
|
||||
} return;
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<input type="hidden" name="hash" id="hash">
|
||||
<figure class='uk-float-right' style='height: 0'>
|
||||
<a href='https://gravatar.com'>
|
||||
<img alt='' src='<% membership.creator gravatar suffix='?s=160&d=mm' %>' style='border: 1px solid #ddd; border-radius: 4px'>
|
||||
<img alt='' src='<% user.gravatar suffix="?s=160&d=mm" %> 'style='border: 1px solid #ddd; border-radius: 4px;'>
|
||||
<figcaption class='uk-text-center'>
|
||||
<% gettext 'Account Image' %></a>
|
||||
</figcaption>
|
||||
|
|
|
@ -503,4 +503,9 @@ User.prototype.list_macro = function(param, type) {
|
|||
});
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
||||
User.prototype.gravatar_macro = function () {
|
||||
res.write('https://secure.gravatar.com/avatar/');
|
||||
this.email && res.write(this.email.trim().toLowerCase().md5());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue