Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Wouter Willaert committed Dec 27, 2013
0 parents commit 1419dd0
Show file tree
Hide file tree
Showing 66 changed files with 1,396 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "vendor"
}
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# compiled output
/dist
/tmp

# dependencies
/node_modules
/vendor/*
!/vendor/loader.js

# misc
/.sass-cache
/connect.lock
/libpeerconnection.log
.DS_Store
Thumbs.db
/coverage/*
37 changes: 37 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"predef": [
"document",
"window",
"location",
"setTimeout",
"Ember",
"Em",
"DS",
"$"
],
"node" : false,
"browser" : false,
"boss" : true,
"curly": false,
"debug": false,
"devel": false,
"eqeqeq": true,
"evil": true,
"forin": false,
"immed": false,
"laxbreak": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": false,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"undef": true,
"sub": true,
"strict": false,
"white": false,
"eqnull": true,
"esnext": true
}
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- 0.10
before_script:
- npm install -g grunt-cli
- npm install -g bower
- bower install
156 changes: 156 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/* jshint node: true */

module.exports = function(grunt) {

var path = require('path'),
_ = grunt.util._;

// Loads tasks for package.json and options from `tasks/options`
var config = require('load-grunt-config')(grunt, {
defaultPath: path.join(__dirname, 'tasks/options'),
configPath: path.join(__dirname, 'tasks/custom'),
init: false
});

// Loads tasks in `tasks` folder
grunt.loadTasks('tasks');

grunt.registerTask('createResultDirectory', function() {
grunt.file.mkdir('tmp/result');
});

// Environment
config.env = process.env;

// Default Task

grunt.registerTask(
'default',
"Build (in debug mode) & test your application.",
['test']
);

// Release Task

grunt.registerTask(
'dist',
"Build a minified & production-ready version of your app.",
['clean:dist', 'build:dist', 'copy:assemble', 'createDistVersion']
);

// Server Tasks

grunt.registerTask(
'server',
"Run your server in development mode, auto-rebuilding when files change.",
['clean:debug', 'build:debug', 'serve:debug', 'watch']
);

grunt.registerTask(
'server:dist',
"Build and preview a minified & production-ready version of your app.",
['dist', 'serve:dist:keepalive']
);

// Testing Tasks

grunt.registerTask(
'test',
"Run your apps's tests once. Uses Google Chrome by default.",
['clean:debug', 'build:debug', 'testem:ci:basic']
);

grunt.registerTask(
'test:ci',
"Run your app's tests in PhantomJS. For use in continuous integration.",
['clean:debug', 'build:debug', 'testem:ci:basic' ]
);

grunt.registerTask(
'test:browsers',
"Run your app's tests in multiple browsers.",
['clean:debug', 'build:debug', 'testem:ci:browsers']
);

grunt.registerTask(
'test:server',
"Start the test server and the standard development server.",
['clean:debug', 'build:debug', 'testem:run:basic', 'serve:debug', 'watch']
);

// Build Tasks

grunt.registerTask('build:dist', [
'createResultDirectory', // Create directoy beforehand, fixes race condition
'concurrent:buildDist', // Executed in parallel, see config below
]);

grunt.registerTask('build:debug', [
'jshint:tooling',
'createResultDirectory', // Create directoy beforehand, fixes race condition
'concurrent:buildDebug', // Executed in parallel, see config below
]);


grunt.registerTask('createDistVersion', [
'useminPrepare', // Configures concat, cssmin and uglify
'concat', // Combines css and javascript files

'cssmin', // Minifies css
'uglify', // Minifies javascript
'imagemin', // Optimizes image compression
// 'svgmin',
'copy:dist', // Copies files not covered by concat and imagemin

'rev', // Appends 8 char hash value to filenames
'usemin', // Replaces file references
'htmlmin:dist' // Removes comments and whitespace
]);

// Parallelize most of the build process

_.merge(config, {
concurrent: {
buildDist: [
"buildTemplates:dist",
"buildScripts",
"buildStyles",
"buildIndexHTML:dist"
],
buildDebug: [
"buildTemplates:debug",
"buildScripts",
"buildStyles",
"buildIndexHTML:debug"
]
}
});

// Templates

grunt.registerTask('buildTemplates:dist', ['emberTemplates:dist']);
grunt.registerTask('buildTemplates:debug', ['emberTemplates:debug']);

// Javascript

grunt.registerTask('buildScripts', [
'jshint:app',
'jshint:tests',
'copy:javascriptToTmp',
'transpile',
'concat_sourcemap'
]);

// CSS

grunt.registerTask('buildStyles', ['less:compile', 'copy:cssToResult']);

// HTML

grunt.registerTask('buildIndexHTML:dist', ['preprocess:indexHTMLDistApp', 'preprocess:indexHTMLDistTests']);
grunt.registerTask('buildIndexHTML:debug', ['preprocess:indexHTMLDebugApp', 'preprocess:indexHTMLDebugTests']);

// Initialize the config object for the current project.

grunt.initConfig(config);
};
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
timesheets
==========

*simple time tracking for teams*

## Dependencies

npm install -g grunt-cli
npm install bower

## Usage

npm install
bower install

## License

(C) 2014, [Typework, bvba][typework]

[typework]: http://typework.com/ 'Typework'
3 changes: 3 additions & 0 deletions api/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"node": true
}
63 changes: 63 additions & 0 deletions api/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module.exports = function(server) {
server.namespace('/api', function() {

server.post('/sessions', function(req, res) {
var email = req.param('email');
var password = req.param('password');

if (email !== 'medufy' || password !== 'foobar') {
return res.send({ errors: 'unauthorized' }, 401);
}

var session = {
'user_session': {
'access_token': 'abcdefghijklmnopqrstuvwxyz'
}
};

return res.send(session, 201);
});

server.get('/projects', function(req, res) {
var records = db.find('projects');
res.send({ projects: records });
});

server.get('/projects/:id', function(req, res) {
var record = db.find('projects', req.params.id);
res.send({ project: record });
});

});
};


var db = {
records: {},

find: function(type, id) {
if (id === undefined) {
return this.records[type];
}

var records = this.records[type].filter(function(item){
return item.id === id;
});

return records[0];
}
};


db.records.projects = [
{
"id": 1,
"name": "Project X",
"description": ""
},
{
"id": 2,
"name": "Project Y",
"description": ""
},
];
3 changes: 3 additions & 0 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default DS.RESTAdapter.extend({
namespace: 'api'
});
22 changes: 22 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Resolver from 'resolver';

var App = Ember.Application.extend({
LOG_ACTIVE_GENERATION: true,
LOG_MODULE_RESOLVER: true,
LOG_TRANSITIONS: true,
LOG_TRANSITIONS_INTERNAL: true,
LOG_VIEW_LOOKUPS: true,
modulePrefix: 'appkit',
Resolver: Resolver['default']
});

Ember.RSVP.configure('onerror', function(error) {
// ensure unhandled promises raise awareness.
// may result in false negatives, but visibility is more important
if (error instanceof Error) {
Ember.Logger.assert(false, error);
Ember.Logger.error(error.stack);
}
});

export default App;
Empty file added app/components/.keep
Empty file.
Empty file added app/controllers/.keep
Empty file.
Empty file added app/helpers/.keep
Empty file.
Loading

0 comments on commit 1419dd0

Please sign in to comment.