Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Coquereau committed Feb 6, 2014
1 parent a6af2db commit 80a67a9
Show file tree
Hide file tree
Showing 35 changed files with 195 additions and 78 deletions.
21 changes: 11 additions & 10 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"predef": {
"document": true,
"window": true,
"location": true,
"setTimeout": true,
"Ember": true,
"Em": true,
"DS": true,
"$": true
},
"predef": [
"document",
"window",
"location",
"setTimeout",
"Ember",
"Em",
"DS",
"$",
"moment"
],
"node" : false,
"browser" : false,
"boss" : true,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ We welcome ideas and experiments.

* [Project Documentation Site](http://stefanpenner.github.io/ember-app-kit/)
* [Getting Started Guide](http://stefanpenner.github.io/ember-app-kit/guides/getting-started.html)
* [ember-app-kit-todos](https://github.com/stefanpenner/ember-app-kit-todos) - the Emberjs [todos](http://emberjs.com/guides/getting-started/) using Ember App Kit
* [ember-app-kit-todos](https://github.com/stefanpenner/ember-app-kit-todos) - the Emberjs [todos](http://emberjs.com/guides/getting-started/) using Ember App Kit
* [ember-app-kit-bloggr](https://github.com/pixelhandler/ember-app-kit-example-with-bloggr-client) - bloggr demo
* *Safari Books Online Blog* - [Introduction to Ember App Kit](http://blog.safaribooksonline.com/2013/09/18/ember-app-kit/) for more experienced Ember developers by @mixonic
* *Ember Sherpa* - [Introduction to Ember App Kit](http://embersherpa.com/articles/introduction-to-ember-app-kit/) for those who are new to the Grunt workflow by @taras
* *Ember Sherpa* - [Introduction to Ember App Kit](http://embersherpa.com/articles/introduction-to-ember-app-kit/) for those who are new to the Grunt workflow by @taras


## Features
Expand Down
3 changes: 2 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ var App = Ember.Application.extend({
LOG_TRANSITIONS_INTERNAL: true,
LOG_VIEW_LOOKUPS: true,
modulePrefix: 'appkit', // TODO: loaded via config
Resolver: Resolver['default']
Resolver: Resolver['default'],
rootElement: "#target"
});

export default App;
Empty file removed app/components/.gitkeep
Empty file.
7 changes: 0 additions & 7 deletions app/components/pretty-color.js

This file was deleted.

Empty file removed app/controllers/.gitkeep
Empty file.
Empty file removed app/helpers/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions app/helpers/mail-date.js
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');
});
8 changes: 0 additions & 8 deletions app/helpers/reverse-word.js

This file was deleted.

17 changes: 14 additions & 3 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<!-- build:js(tmp/result) /assets/vendor.min.js -->

<script src="/vendor/jquery/jquery.js"></script>
<script src="/vendor/moment/moment.js"></script>

<!-- @if dist=false -->
<script src="/vendor/handlebars/handlebars.js"></script>
Expand All @@ -42,10 +43,9 @@
<script src="/vendor/ember/ember.prod.js"></script>
<!-- @endif -->

<script src="/vendor/ember-data/ember-data.js"></script>

<script src="/vendor/loader.js"></script>
<script src="/vendor/ember-resolver/dist/ember-resolver.js"></script>
<script src="/vendor/ic-ajax/main.js"></script>

<!-- endbuild -->

Expand Down Expand Up @@ -79,14 +79,25 @@
<!-- @endif -->

</head>
<body>
<body class="index">
<!--[if lt IE 8]>
<p class="browsehappy">
You are using an <strong>outdated</strong> browser. Please
<a href="http://browsehappy.com/">upgrade your browser</a>
to improve your experience.
</p>
<![endif]-->
<div id="content-wrapper">
<div id="content">
<div class="getting-started section">
<div id="routing-example" class="example-app">
<div id="target" class="example-output">

</div>
</div>
</div>
</div>
</div>

<!-- @if tests=true -->
<div id="qunit"></div>
Expand Down
Empty file removed app/models/.gitkeep
Empty file.
67 changes: 67 additions & 0 deletions app/models/mailbox.js
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?"
}
]
}
];
11 changes: 6 additions & 5 deletions app/router.js
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 removed app/routes/.gitkeep
Empty file.
12 changes: 12 additions & 0 deletions app/routes/application.js
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;
5 changes: 0 additions & 5 deletions app/routes/component_test.js

This file was deleted.

7 changes: 0 additions & 7 deletions app/routes/helper_test.js

This file was deleted.

5 changes: 0 additions & 5 deletions app/routes/index.js

This file was deleted.

12 changes: 12 additions & 0 deletions app/routes/mail.js
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 removed app/styles/.gitkeep
Empty file.
8 changes: 1 addition & 7 deletions app/styles/app.css

Large diffs are not rendered by default.

Empty file removed app/templates/.gitkeep
Empty file.
22 changes: 20 additions & 2 deletions app/templates/application.hbs
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>
3 changes: 0 additions & 3 deletions app/templates/component-test.hbs

This file was deleted.

Empty file removed app/templates/components/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion app/templates/components/pretty-color.hbs

This file was deleted.

1 change: 0 additions & 1 deletion app/templates/helper-test.hbs

This file was deleted.

9 changes: 4 additions & 5 deletions app/templates/index.hbs
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>
12 changes: 12 additions & 0 deletions app/templates/mail.hbs
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>
20 changes: 20 additions & 0 deletions app/templates/mailbox.hbs
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}}
3 changes: 3 additions & 0 deletions app/templates/mailbox/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="mailbox-index">
Select an email
</div>
Empty file removed app/utils/.gitkeep
Empty file.
4 changes: 0 additions & 4 deletions app/utils/ajax.js

This file was deleted.

Empty file removed app/views/.gitkeep
Empty file.
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"ember": "~1.4.0-beta.2",
"ember-data": "~1.0.0-beta.6",
"ember-resolver": "git://github.com/stefanpenner/ember-jj-abrams-resolver.git#master",
"ic-ajax": "~0.3.0",
"ember-testing-httpRespond": "~0.1.1"
"ic-ajax": "~0.2",
"ember-testing-httpRespond": "~0.1.1",
"moment": "~2.4.0"
},
"resolutions": {
"ember": "~1.4.0-beta.2"
Expand Down

0 comments on commit 80a67a9

Please sign in to comment.