Skip to content

Commit 6de5334

Browse files
committed
Merge pull request #61 from huonw/user-link
Add user-links & tweak alignment
2 parents 709f4ff + 4282a4f commit 6de5334

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
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/styles/app.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ body {
105105
background: rgb(42, 79, 39);
106106
box-shadow: inset -2px 2px 4px 0px rgb(36, 61, 38);
107107
}
108+
109+
img {
110+
vertical-align: top;
111+
}
108112
}
109113

110114
#current-user-links {

app/styles/me.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.info { @include display-flex; }
77
dl {
8-
margin-left: 30px;
8+
margin: 0 0 0 30px;
99
line-height: 150%;
1010
font-size: 110%;
1111
dt {

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)