-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tom Coquereau
committed
Feb 6, 2014
1 parent
a6af2db
commit 80a67a9
Showing
35 changed files
with
195 additions
and
78 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
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
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
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,6 @@ | ||
// Date helper | ||
// =========== | ||
|
||
export default Ember.Handlebars.makeBoundHelper(function(date) { | ||
return moment(date).format('MMM Do'); | ||
}); |
This file was deleted.
Oops, something went wrong.
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
Empty file.
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,67 @@ | ||
// Mailbox model | ||
// ============= | ||
|
||
var Mailbox = Em.Object.extend(); | ||
|
||
Mailbox.reopenClass({ | ||
find: function(id) { | ||
if (id) { | ||
return FIXTURES.findBy('id', id); | ||
} else { | ||
console.log(FIXTURES); | ||
return FIXTURES; | ||
} | ||
} | ||
}); | ||
|
||
export default Mailbox; | ||
|
||
var FIXTURES = [ | ||
{ | ||
name: "Inbox", | ||
id: "inbox", | ||
messages: [ | ||
{ | ||
id: 1, | ||
subject: "Welcome to Ember", | ||
from: "[email protected]", | ||
to: "[email protected]", | ||
date: new Date(), | ||
body: "Welcome to Ember. We hope you enjoy your stay" | ||
}, { | ||
id: 2, | ||
subject: "Great Ember Resources", | ||
from: "[email protected]", | ||
to: "[email protected]", | ||
date: new Date(), | ||
body: "Have you seen embercasts.com? How about emberaddons.com?" | ||
} | ||
] | ||
}, { | ||
name: "Spam", | ||
id: "spam", | ||
messages: [ | ||
{ | ||
id: 3, | ||
subject: "You have one the lottery!!!111ONEONE", | ||
from: "[email protected]", | ||
to: "[email protected]", | ||
date: new Date(), | ||
body: "You have ONE the lottery! You only have to send us a small amount of monies to claim your prize" | ||
} | ||
] | ||
}, { | ||
name: "Sent Mail", | ||
id: "sent-mail", | ||
messages: [ | ||
{ | ||
id: 4, | ||
subject: "Should I use Ember", | ||
from: "[email protected]", | ||
to: "[email protected]", | ||
date: new Date(), | ||
body: "Ember looks pretty good, should I use it?" | ||
} | ||
] | ||
} | ||
]; |
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
// Mailbox router | ||
// ============== | ||
|
||
var Router = Ember.Router.extend(); // ensure we don't share routes between all Router instances | ||
|
||
Router.map(function() { | ||
this.route('component-test'); | ||
this.route('helper-test'); | ||
// this.resource('posts', function() { | ||
// this.route('new'); | ||
// }); | ||
this.resource('mailbox', { path: '/:mailbox_id' }, function() { | ||
this.resource('mail', { path: '/:message_id' }); | ||
}); | ||
}); | ||
|
||
export default Router; |
Empty file.
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 @@ | ||
// Application route | ||
// ================== | ||
|
||
import Mailbox from 'appkit/models/mailbox'; | ||
|
||
var ApplicationRoute = Em.Route.extend({ | ||
model: function() { | ||
return Mailbox.find(); | ||
} | ||
}); | ||
|
||
export default ApplicationRoute; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
// Mail route | ||
// ========== | ||
|
||
import Mailbox from 'appkit/models/mailbox'; | ||
|
||
var MailRoute = Em.Route.extend({ | ||
model: function(params) { | ||
return this.modelFor('mailbox').messages.findBy('id', params.message_id); | ||
} | ||
}); | ||
|
||
export default MailRoute; |
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
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 |
---|---|---|
@@ -1,3 +1,21 @@ | ||
<h2 id='title'>Welcome to Ember.js</h2> | ||
<div class="url">URL: {{target.url}}</div> | ||
<aside> | ||
|
||
{{outlet}} | ||
<ul> | ||
<li><h2>Mailboxes</h2></li> | ||
{{#each}} | ||
<li> | ||
{{#link-to "mailbox" this currentWhen="mailbox"}} | ||
<span class="count"> | ||
{{messages.length}} | ||
</span> | ||
{{name}} | ||
{{/link-to}} | ||
</li> | ||
{{/each}} | ||
</ul> | ||
</aside> | ||
|
||
<section class="main"> | ||
{{outlet}} | ||
</section> |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<ul> | ||
{{#each}} | ||
<li>{{this}}</li> | ||
{{/each}} | ||
</ul> | ||
<div class="index"> | ||
<h1>TomsterMail</h1> | ||
<span class="tomster"></span> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="mail"> | ||
<dl> | ||
<dt>From</dt> | ||
<dd>{{from}}</dd> | ||
<dt>To</dt> | ||
<dd>{{to}}</dd> | ||
<dt>Date</dt> | ||
<dd>{{mail-date date}}</dd> | ||
</dl> | ||
<h4>{{subject}}</h4> | ||
<p>{{body}}</p> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<table> | ||
<tr> | ||
<th>Date</th> | ||
<th>Subject</th> | ||
<th>From</th> | ||
<th>To</th> | ||
</tr> | ||
|
||
{{#each messages}} | ||
{{#link-to "mail" this tagName='tr'}} | ||
<td>{{mail-date date}}</td> | ||
<td>{{view.isActive}}{{subject}}</td> | ||
<td>{{from}}</td> | ||
<td>{{to}}</td> | ||
{{/link-to}} | ||
</tr> | ||
{{/each}} | ||
</table> | ||
|
||
{{outlet}} |
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,3 @@ | ||
<div class="mailbox-index"> | ||
Select an email | ||
</div> |
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
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