forked from rust-lang/crates.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The intent is to eventually be able to go to a user's profile page and see a list of their crates. See rust-lang#409.
- Loading branch information
Showing
6 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Route.extend({ | ||
model(params) { | ||
return this.store.find('user', params.user_id).catch(e => { | ||
if (e.errors.any(e => e.detail === 'Not Found')) { | ||
this.controllerFor('application').set('nextFlashError', `User '${params.user_id}' does not exist`); | ||
return this.replaceWith('index'); | ||
} | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div id='crates-heading'> | ||
<img class='gear logo' src="/assets/gear.png"/> | ||
<h1>{{ model.login }}</h1> | ||
</div> | ||
|
||
<div id='user-profile'> | ||
<h2>{{ model.login }}</h2> | ||
|
||
<div class='info'> | ||
{{#user-link user=model }} {{user-avatar user=model size='medium'}} {{/user-link}} | ||
|
||
<dl> | ||
<dt>Name</dt> | ||
<dd>{{ model.name }}</dd> | ||
<dt>GitHub Account</dt> | ||
<dd>{{ model.login }}</dd> | ||
</dl> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
|
||
moduleFor('route:user', 'Unit | Route | user', { | ||
// Specify the other units that are required for this test. | ||
// needs: ['controller:foo'] | ||
}); | ||
|
||
test('it exists', function(assert) { | ||
let route = this.subject(); | ||
assert.ok(route); | ||
}); |