From 7fd58d51e7ea673f83cac00dcb9951d8039faf3d Mon Sep 17 00:00:00 2001 From: Hamza Ben Hamed Date: Thu, 29 Oct 2015 22:05:34 +0100 Subject: [PATCH 1/2] Initial fix to make the build pass --- Jakefile.js | 7 ++++++- app/models/client.js | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Jakefile.js b/Jakefile.js index d607012..cdb440f 100755 --- a/Jakefile.js +++ b/Jakefile.js @@ -102,7 +102,12 @@ namespace('db', function() { var Client; log('- db:populate'.yellow); - + if (!JK.models) { + JK.models = {}; + ['client'].forEach(function (elem, index) { + JK.models[elem] = require('./app/models/' + elem)(JK.mongoose); + }); + } Client = JK.models.client; howMany = howMany || 50; diff --git a/app/models/client.js b/app/models/client.js index 4b90a36..e2b3885 100755 --- a/app/models/client.js +++ b/app/models/client.js @@ -1,5 +1,6 @@ module.exports = function(mongoose) { var validator = require('../../lib/validator'), + mongoose = require('mongoose'), Schema = mongoose.Schema, Client; From eb918061d9522d0e3379fe6a0acadbdb131e48ea Mon Sep 17 00:00:00 2001 From: Hamza Ben Hamed Date: Fri, 6 Nov 2015 01:22:15 +0100 Subject: [PATCH 2/2] popup for save/delete a client done (not fancy at all :D) --- public/js/views/clients/edit.js | 1 + public/js/views/clients/show.js | 1 + 2 files changed, 2 insertions(+) diff --git a/public/js/views/clients/edit.js b/public/js/views/clients/edit.js index ddb39cd..4a3ea95 100755 --- a/public/js/views/clients/edit.js +++ b/public/js/views/clients/edit.js @@ -70,6 +70,7 @@ define('ClientEditView', [ that.renderErrMsg(res.errors); } else { model.trigger('save-success', model.get('_id')); + window.alert("Client informations updated "); } }, error: function(model, res) { diff --git a/public/js/views/clients/show.js b/public/js/views/clients/show.js index 02e9d92..e273924 100755 --- a/public/js/views/clients/show.js +++ b/public/js/views/clients/show.js @@ -30,6 +30,7 @@ define('ClientView', [ sync: true, success: function(model) { model.trigger('delete-success'); + window.alert("Client deleted "); }, error: function(model, res) { if (res.status === 404) {