Skip to content

Commit 76f4473

Browse files
committed
Link the owner image to their github profile.
This temporarily provides more info about the owners of crates, without having to find the repository or recognise the image (temporary until crates.io has its own profile pages).
1 parent 0ea1f04 commit 76f4473

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

app/components/user-link.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Ember from 'ember';
2+
3+
export default Ember.Component.extend({
4+
user: null,
5+
attributeBindings: ['title', 'href'],
6+
tagName: 'a',
7+
8+
title: function() {
9+
return this.get('user.login');
10+
}.property('user'),
11+
12+
'href': function() {
13+
// TODO replace this with a link to a native crates.io profile
14+
// page when they exist.
15+
return 'https://github.com/' + this.get('user.login');
16+
}.property('user'),
17+
});

app/templates/crate/index.hbs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,11 @@
9494
<h3>Owners</h3>
9595
<ul class='owners'>
9696
{{#each owners}}
97-
{{! TODO: hyperlink to a profile page }}
98-
<li>{{user-avatar user=this size='medium-small'}}</li>
97+
<li>
98+
{{#user-link user=this}}
99+
{{user-avatar user=this size='medium-small'}}
100+
{{/user-link}}
101+
</li>
99102
{{/each}}
100103
</ul>
101104
</div>

app/templates/me/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h2>Profile Information</h2>
88

99
<div class='info'>
10-
{{user-avatar user=this size='medium'}}
10+
{{#user-link user=this }} {{user-avatar user=this size='medium'}} {{/user-link}}
1111

1212
<dl>
1313
<dt>Name</dt>

0 commit comments

Comments
 (0)