├── .bowerrc ├── .editorconfig ├── .gitignore ├── .jshintrc ├── .sailsrc ├── .travis.yml ├── CONTRIBUTORS.md ├── Gruntfile.js ├── LICENSE.md ├── README.md ├── ROADMAP.md ├── api ├── blueprints │ └── find.js ├── controllers │ ├── .gitkeep │ ├── AdminController.js │ ├── AuthController.js │ ├── CategoryController.js │ ├── EmailController.js │ ├── KueController.js │ ├── ModelController.js │ ├── PermissionController.js │ ├── RoleController.js │ ├── RouteController.js │ ├── SettingController.js │ └── UserController.js ├── hooks │ ├── cron │ │ └── index.js │ ├── kue │ │ └── index.js │ └── redisevent │ │ └── index.js ├── models │ ├── .gitkeep │ ├── Alert.js │ ├── Category.js │ ├── Criteria.js │ ├── Email.js │ ├── Model.js │ ├── Passport.js │ ├── Permission.js │ ├── RequestLog.js │ ├── Role.js │ ├── Route.js │ ├── SecurityLog.js │ ├── Setting.js │ └── User.js ├── policies │ ├── AdminPolicy │ ├── AuditPolicy.js │ ├── CriteriaPolicy.js │ ├── ModelPolicy.js │ ├── OwnerPolicy.js │ ├── PermissionPolicy.js │ ├── RolePolicy.js │ ├── RoutePolicy.js │ └── sessionAuth.js ├── responses │ ├── badRequest.js │ ├── forbidden.js │ ├── notFound.js │ ├── ok.js │ ├── response.js │ └── serverError.js └── services │ ├── .gitkeep │ ├── CronService.js │ ├── KueService.js │ ├── ModelService.js │ ├── PermissionService.js │ ├── RedisEventService.js │ └── RouteService.js ├── app.js ├── assets ├── app │ ├── .gitkeep │ ├── app.js │ ├── controllers │ │ ├── README.md │ │ ├── UserController.js │ │ └── index.js │ ├── directives │ │ ├── README.md │ │ ├── checklist.js │ │ ├── focus.js │ │ └── index.js │ ├── filters │ │ ├── README.md │ │ ├── core.js │ │ ├── index.js │ │ └── truncate.js │ ├── hooks │ │ ├── README.md │ │ └── index.js │ ├── models │ │ ├── Alert.js │ │ ├── Category.js │ │ ├── Email.js │ │ ├── Model.js │ │ ├── Passport.js │ │ ├── Permission.js │ │ ├── README.md │ │ ├── Role.js │ │ ├── Route.js │ │ ├── Setting.js │ │ ├── User.js │ │ └── index.js │ ├── policies │ │ ├── README.md │ │ └── index.js │ ├── providers │ │ ├── README.md │ │ └── js-data-angular-sailssocket.js │ ├── services │ │ ├── README.md │ │ ├── index.js │ │ └── utils.js │ └── views │ │ ├── 401.html │ │ ├── 403.html │ │ ├── 404.html │ │ ├── 500.html │ │ ├── README.md │ │ ├── admin │ │ ├── Admin.controllers.js │ │ ├── Admin.states.js │ │ ├── cms │ │ │ ├── AdminCms.controllers.js │ │ │ ├── AdminCms.states.js │ │ │ ├── categories │ │ │ │ ├── AdminCmsCategories.controllers.js │ │ │ │ ├── AdminCmsCategories.states.js │ │ │ │ ├── index.html │ │ │ │ └── view │ │ │ │ │ ├── AdminCmsCategoriesView.controllers.js │ │ │ │ │ ├── AdminCmsCategoriesView.states.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── widgets.html │ │ │ ├── index.html │ │ │ └── view │ │ │ │ ├── AdminCmsView.controllers.js │ │ │ │ ├── AdminCmsView.states.js │ │ │ │ ├── index.html │ │ │ │ └── widgets.html │ │ ├── data │ │ │ ├── AdminData.controllers.js │ │ │ ├── AdminData.states.js │ │ │ ├── index.html │ │ │ └── view │ │ │ │ ├── AdminDataView.controllers.js │ │ │ │ ├── AdminDataView.states.js │ │ │ │ ├── index.html │ │ │ │ ├── view │ │ │ │ ├── AdminDataViewView.controllers.js │ │ │ │ ├── AdminDataViewView.states.js │ │ │ │ ├── index.html │ │ │ │ └── widgets.html │ │ │ │ └── widgets.html │ │ ├── email │ │ │ ├── AdminEmail.controllers.js │ │ │ ├── AdminEmail.states.js │ │ │ ├── index.html │ │ │ └── view │ │ │ │ ├── AdminEmailView.controllers.js │ │ │ │ ├── AdminEmailView.states.js │ │ │ │ ├── index.html │ │ │ │ └── widgets.html │ │ ├── header.html │ │ ├── index.html │ │ ├── login │ │ │ ├── AdminLogin.controllers.js │ │ │ ├── AdminLogin.states.js │ │ │ └── index.html │ │ ├── role │ │ │ ├── AdminRole.controllers.js │ │ │ ├── AdminRole.states.js │ │ │ ├── index.html │ │ │ └── view │ │ │ │ ├── AdminRoleView.controllers.js │ │ │ │ ├── AdminRoleView.states.js │ │ │ │ ├── index.html │ │ │ │ └── widgets.html │ │ ├── setting │ │ │ ├── AdminSetting.controllers.js │ │ │ ├── AdminSetting.states.js │ │ │ ├── index.html │ │ │ └── view │ │ │ │ ├── AdminSettingView.controllers.js │ │ │ │ ├── AdminSettingView.states.js │ │ │ │ ├── index.html │ │ │ │ └── widgets.html │ │ ├── user │ │ │ ├── AdminUser.controllers.js │ │ │ ├── AdminUser.states.js │ │ │ ├── index.html │ │ │ └── view │ │ │ │ ├── AdminUserView.controllers.js │ │ │ │ ├── AdminUserView.states.js │ │ │ │ ├── index.html │ │ │ │ ├── password │ │ │ │ ├── AdminUserViewPassword.controllers.js │ │ │ │ ├── AdminUserViewPassword.states.js │ │ │ │ └── index.html │ │ │ │ └── widgets.html │ │ └── webhook │ │ │ ├── AdminWebhook.controllers.js │ │ │ ├── AdminWebhook.states.js │ │ │ └── index.html │ │ ├── home │ │ ├── home.controllers.js │ │ ├── home.states.js │ │ └── index.html │ │ └── index.js ├── favicon.ico ├── humans.txt ├── images │ ├── .gitkeep │ └── README.md ├── js │ └── dependencies │ │ ├── humpback.io.js │ │ └── sails.io.js ├── robots.txt ├── scss │ ├── _admin.scss │ ├── _animation.scss │ ├── _grid.scss │ ├── _home.scss │ ├── _layout.scss │ ├── _ngtagsinput.scss │ ├── _settings.scss │ ├── _svg.scss │ └── app.scss └── templates │ └── .gitkeep ├── bower.json ├── config ├── blueprints.js ├── bootstrap.js ├── connections.js ├── cors.js ├── cron.js ├── csrf.js ├── env │ ├── development.js │ ├── production.js │ └── testing.js ├── globals.js ├── http.js ├── humpback-hook.js ├── humpback.js ├── i18n.js ├── kue.js ├── locales │ ├── _README.md │ ├── de.json │ ├── en.json │ ├── es.json │ └── fr.json ├── log.js ├── models.js ├── passport.js ├── policies.js ├── redisevent.js ├── routes.js ├── session.js ├── sockets.js └── views.js ├── crons └── README.md ├── events ├── README.md └── settings.js ├── jobs └── README.md ├── package.json ├── tasks ├── README.md ├── config │ ├── clean.js │ ├── coffee.js │ ├── concat.js │ ├── copy.js │ ├── cssmin.js │ ├── ejs.js │ ├── html2js.js │ ├── jshint.js │ ├── jst.js │ ├── mochaTest.js │ ├── sails-linker.js │ ├── sass.js │ ├── svgtoolkit.js │ ├── sync.js │ ├── uglify.js │ └── watch.js ├── pipeline.js └── register │ ├── build.js │ ├── buildProd.js │ ├── compileAssets.js │ ├── default.js │ ├── humpback.js │ ├── linkAssets.js │ ├── linkAssetsBuild.js │ ├── linkAssetsBuildProd.js │ ├── prod.js │ ├── syncAssets.js │ └── test.js ├── test └── bootstrap.test.js └── views ├── 401.ejs ├── 403.ejs ├── 404.ejs ├── 500.ejs ├── README.md ├── admin ├── cms │ ├── categories │ │ ├── index.ejs │ │ └── view │ │ │ ├── index.ejs │ │ │ └── widgets.ejs │ ├── index.ejs │ └── view │ │ ├── index.ejs │ │ └── widgets.ejs ├── dashboard │ └── index.ejs ├── data │ ├── index.ejs │ └── view │ │ ├── index.ejs │ │ ├── view │ │ ├── index.ejs │ │ └── widgets.ejs │ │ └── widgets.ejs ├── email │ ├── index.ejs │ └── view │ │ ├── index.ejs │ │ └── widgets.ejs ├── header.ejs ├── index.ejs ├── login │ └── index.ejs ├── role │ ├── index.ejs │ └── view │ │ ├── index.ejs │ │ └── widgets.ejs ├── setting │ ├── index.ejs │ └── view │ │ ├── index.ejs │ │ └── widgets.ejs ├── user │ ├── index.ejs │ └── view │ │ ├── index.ejs │ │ ├── password │ │ └── index.ejs │ │ └── widgets.ejs └── webhook │ └── index.ejs ├── emailTemplates └── testEmail │ └── html.ejs ├── home └── index.ejs ├── layout-alt.ejs └── layout.ejs /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory" : "assets/bower_components" 3 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "browser": true, 4 | "camelcase": true, 5 | "curly": true, 6 | "eqeqeq": true, 7 | "esnext": true, 8 | "immed": true, 9 | "latedef": true, 10 | "newcap": true, 11 | "noarg": true, 12 | "node": true, 13 | "mocha": true, 14 | "quotmark": "single", 15 | "strict": true, 16 | "undef": true, 17 | "unused": true, 18 | "expr": true, 19 | "ignore": true, 20 | "globals": { 21 | "sails": true, 22 | "io": true, 23 | "_": true 24 | } 25 | } -------------------------------------------------------------------------------- /.sailsrc: -------------------------------------------------------------------------------- 1 | { 2 | "generators": { 3 | "modules": { 4 | "sails-stripe": "sails-stripe" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - "0.10" 5 | - "0.12" 6 | 7 | # before install 8 | before_install: 9 | - npm install -g grunt-cli 10 | 11 | # whitelisted branches 12 | branches: 13 | only: 14 | - master 15 | - stable 16 | - beta -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | #Contributers 2 | 3 | ## Style Guide 4 | Humpback uses a jshint file for standardized javascript for the front and backend. 5 | 6 | ##Development Process 7 | Developers work in their own brances, then submit pull requests when they think their feature or bug fix is ready. 8 | 9 | If it is a simple/trivial/non-controversial change, then one of the Humpback maintainers simply merges it. 10 | 11 | If it is a more complicated or potentially controversial change, then the patch submitter will be asked to start a discussion with the devs and community. 12 | 13 | The patch will be accepted if there is broad consensus that it is a good thing. Developers should expect to rework and resubmit patches if the code doesn't match the project's coding conventions (see doc/coding.txt) or are controversial. 14 | 15 | The master branch is regularly built and tested, but is not guaranteed to be completely stable. Tags are created regularly to indicate new official, stable release versions of Humpback. 16 | 17 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Gruntfile 3 | * 4 | * This Node script is executed when you run `grunt` or `sails lift`. 5 | * It's purpose is to load the Grunt tasks in your project's `tasks` 6 | * folder, and allow you to add and remove tasks as you see fit. 7 | * For more information on how this works, check out the `README.md` 8 | * file that was generated in your `tasks` folder. 9 | * 10 | * WARNING: 11 | * Unless you know what you're doing, you shouldn't change this file. 12 | * Check out the `tasks` directory instead. 13 | */ 14 | 15 | module.exports = function(grunt) { 16 | 17 | 18 | // Load the include-all library in order to require all of our grunt 19 | // configurations and task registrations dynamically. 20 | var includeAll; 21 | try { 22 | includeAll = require('include-all'); 23 | } catch (e0) { 24 | try { 25 | includeAll = require('sails/node_modules/include-all'); 26 | } 27 | catch(e1) { 28 | console.error('Could not find `include-all` module.'); 29 | console.error('Skipping grunt tasks...'); 30 | console.error('To fix this, please run:'); 31 | console.error('npm install include-all --save`'); 32 | console.error(); 33 | 34 | grunt.registerTask('default', []); 35 | return; 36 | } 37 | } 38 | 39 | 40 | /** 41 | * Loads Grunt configuration modules from the specified 42 | * relative path. These modules should export a function 43 | * that, when run, should either load/configure or register 44 | * a Grunt task. 45 | */ 46 | function loadTasks(relPath) { 47 | return includeAll({ 48 | dirname: require('path').resolve(__dirname, relPath), 49 | filter: /(.+)\.js$/ 50 | }) || {}; 51 | } 52 | 53 | /** 54 | * Invokes the function from a Grunt configuration module with 55 | * a single argument - the `grunt` object. 56 | */ 57 | function invokeConfigFn(tasks) { 58 | for (var taskName in tasks) { 59 | if (tasks.hasOwnProperty(taskName)) { 60 | tasks[taskName](grunt); 61 | } 62 | } 63 | } 64 | 65 | 66 | 67 | 68 | // Load task functions 69 | var taskConfigurations = loadTasks('./tasks/config'), 70 | registerDefinitions = loadTasks('./tasks/register'); 71 | 72 | // (ensure that a default task exists) 73 | if (!registerDefinitions.default) { 74 | registerDefinitions.default = function (grunt) { grunt.registerTask('default', []); }; 75 | } 76 | 77 | // Run task functions to configure Grunt. 78 | invokeConfigFn(taskConfigurations); 79 | invokeConfigFn(registerDefinitions); 80 | 81 | }; 82 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Scott Wyatt, Cali Style & Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | #Humpback Road Map 2 | ##Where to from here? 3 | 4 | Humpback is quickly evolving and so is the web around us. We want to build a platform that will last 5 | and that includes making some future proofing changes to Humpback. 6 | 7 | When Humpback was started, angular was getting pretty old and angular 2 was way way to new, but many of 8 | us agree with the concepts of angular 2, which is where we think humpback will move to. 9 | 10 | ###Typescript 11 | We want to completely convert the humpback platform over to Typescript. 12 | 13 | ###Angular 2 14 | We want rebuild all the Humpback modules to tightly integrate with the angular 2 methodology to make 15 | development even quicker and resuable. 16 | 17 | ###Barnacles 18 | Humpback currently uses installable hooks called Barnacles. We want to standardize a way to create and 19 | use these. Possiblly even make a market place for them. 20 | 21 | ###Pipelines 22 | It's not a secret that devs have a lot of choices when it comes to their pipeline. Wether that's AWS, Gcloud, Heroku, etc. 23 | We would love to make prekitted pipelines that make deploying humpback a breeze on these platforms and allow for 24 | continuous integration and deployment. Heck, why not add some Hubot stuff in there? 25 | 26 | ##The Choice is up to you! 27 | Even when I started Humpback I was never under the illusion that I was the best at this. I knew it was ambitious 28 | and I would have to really count on the OS community to feel the same pains as me and want to work together to 29 | solve them. So the call is up to all of us now. -------------------------------------------------------------------------------- /api/blueprints/find.js: -------------------------------------------------------------------------------- 1 | var actionUtil = require('sails/lib/hooks/blueprints/actionUtil'); 2 | 3 | module.exports = function (req, res) { 4 | if (actionUtil.parsePk(req)) { 5 | return require('./findOne')(req, res); 6 | } 7 | 8 | var ThisModel = actionUtil.parseModel(req), 9 | where = actionUtil.parseCriteria(req), 10 | limit = actionUtil.parseLimit(req), 11 | skip = actionUtil.parseSkip(req), 12 | sort = actionUtil.parseSort(req), 13 | query = ThisModel.find().where(where).limit(limit).skip(skip).sort(sort); 14 | 15 | query = actionUtil.populateEach(query, req); 16 | query.exec(function (error, records) { 17 | if (error) { 18 | return res.serverError(error); 19 | } 20 | 21 | ThisModel 22 | .count(where) 23 | .exec(function (error, count) { 24 | if (error) { 25 | return res.serverError(error); 26 | } 27 | 28 | var metaInfo = { 29 | start: skip, 30 | end: skip + limit, 31 | limit: limit, 32 | total: count, 33 | criteria: where 34 | }; 35 | 36 | res.set('Content-Range', metaInfo.start + '-' + metaInfo.end + '/' + metaInfo.total); 37 | res.set('Content-Count', metaInfo.total); 38 | return res.ok(records, null, null, metaInfo); 39 | }); 40 | }); 41 | }; -------------------------------------------------------------------------------- /api/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/api/controllers/.gitkeep -------------------------------------------------------------------------------- /api/controllers/AdminController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * AdminController 3 | * 4 | * @description :: Server-side logic for managing humpback admin 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#admincontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | module.exports = { 10 | 11 | }; 12 | 13 | // TODO implement in hook 14 | //var _ = require('lodash'); 15 | //var _super = require('humpback-hook/api/controllers/AdminController'); 16 | 17 | //_.merge(exports, _super); 18 | //_.merge(exports, { 19 | 20 | /** 21 | * Extend the Controller 22 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/controllers/AdminController.js 23 | * @exmaple: 24 | * bar: function(req, res){ 25 | * res.ok(); 26 | * } 27 | */ 28 | 29 | //}); -------------------------------------------------------------------------------- /api/controllers/CategoryController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * CategoryController 3 | * 4 | * @description :: Server-side logic for managing Categories 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#categorycontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-cms-hook/api/controllers/CategoryController'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Controller 17 | * https://github.com/CaliStyle/humpback-cms-hook/blob/master/api/controllers/CategoryController.js 18 | * @exmaple: 19 | * bar: function(req, res){ 20 | * res.ok(); 21 | * } 22 | */ 23 | 24 | 25 | 26 | }); -------------------------------------------------------------------------------- /api/controllers/EmailController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * EmailController 3 | * 4 | * @description :: Server-side logic for managing emails 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#emailcontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-email-hook/api/controllers/EmailController'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Controller 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/controllers/EmailController.js 18 | * @exmaple: 19 | * bar: function(req, res){ 20 | * res.ok(); 21 | * } 22 | */ 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /api/controllers/ModelController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ModelController 3 | * 4 | * @description :: Server-side logic for managing settings 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#modelcontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/controllers/ModelController'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Controller 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/controllers/ModelController.js 18 | * @exmaple: 19 | * bar: function(req, res){ 20 | * res.ok(); 21 | * } 22 | */ 23 | 24 | }); -------------------------------------------------------------------------------- /api/controllers/PermissionController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * PermissionController 3 | * 4 | * @description :: Server-side logic for managing humpback permissions 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#permissioncontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/controllers/PermissionController'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Controller 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/controllers/PermissionController.js 18 | * @exmaple: 19 | * bar: function(req, res){ 20 | * res.ok(); 21 | * } 22 | */ 23 | 24 | }); -------------------------------------------------------------------------------- /api/controllers/RoleController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * RoleController 3 | * 4 | * @description :: Server-side logic for managing Roles 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#rolecontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | module.exports = { 10 | 11 | } 12 | 13 | //var _ = require('lodash'); 14 | //var _super = require('humpback-hook/api/controllers/RoleController'); 15 | 16 | //_.merge(exports, _super); 17 | //_.merge(exports, { 18 | 19 | /** 20 | * Extend the Controller 21 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/controllers/ModelController.js 22 | * @exmaple: 23 | * bar: function(req, res){ 24 | * res.ok(); 25 | * } 26 | */ 27 | 28 | //}); -------------------------------------------------------------------------------- /api/controllers/RouteController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * RouteController 3 | * 4 | * @description :: Server-side logic for managing settings 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#routecontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-cms-hook/api/controllers/RouteController'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Controller 17 | * https://github.com/CaliStyle/humpback-cms-hook/blob/master/api/controllers/RouteController.js 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/controllers/RouteController.js 19 | * @exmaple: 20 | * bar: function(req, res){ 21 | * res.ok(); 22 | * } 23 | */ 24 | 25 | }); -------------------------------------------------------------------------------- /api/controllers/SettingController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SettingController 3 | * 4 | * @description :: Server-side logic for managing settings 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#settingcontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/controllers/SettingController'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Controller 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/controllers/SettingController.js 18 | * @exmaple: 19 | * bar: function(req, res){ 20 | * res.ok(); 21 | * } 22 | */ 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /api/controllers/UserController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * UserController 3 | * 4 | * @description :: Server-side logic for managing humpback User 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Controllers#usercontroller 6 | * @help :: See http://links.sailsjs.org/docs/controllers 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/controllers/UserController'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Controller 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/controllers/UserController.js 18 | * @exmaple: 19 | * bar: function(req, res){ 20 | * res.ok(); 21 | * } 22 | */ 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /api/hooks/cron/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (sails) { 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | /** 7 | * Expose hook definition 8 | */ 9 | 10 | return { 11 | 12 | // Run when sails loads-- be sure and call `next()`. 13 | initialize: function (next) { 14 | 15 | sails.after('hook:orm:loaded', function () { 16 | sails.log.info("Starting cron-cluster"); 17 | 18 | var cron_engine = sails.config.cron; 19 | 20 | //register cron-cluster. 21 | sails.log.info("Registering cron jobs"); 22 | var crons = require('include-all')({ 23 | dirname : sails.config.appPath +'/crons', 24 | filter : /(.+)\.js$/, 25 | excludeDirs : /^\.(git|svn)$/, 26 | optional : true 27 | }); 28 | 29 | sails.log.info("CRONS DIR:" + sails.config.appPath + "/crons"); 30 | 31 | _.forEach(crons, function(cron, name){ 32 | sails.log.info("Registering cron-cluster handler: "+name); 33 | 34 | }); 35 | }); 36 | 37 | return next(); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /api/hooks/kue/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * kue hook 3 | */ 4 | 5 | module.exports = function (sails) { 6 | /** 7 | * Module dependencies. 8 | */ 9 | 10 | var kue = require('kue'); 11 | 12 | /** 13 | * Expose hook definition 14 | */ 15 | 16 | return { 17 | 18 | // Run when sails loads-- be sure and call `next()`. 19 | initialize: function (next) { 20 | 21 | sails.after('hook:orm:loaded', function () { 22 | sails.log.info("Starting kue") 23 | var kue_engine = sails.config.kue; 24 | 25 | //register kue. 26 | sails.log.info("Registering jobs") 27 | var jobs = require('include-all')({ 28 | dirname : sails.config.appPath +'/jobs', 29 | filter : /(.+)\.js$/, 30 | excludeDirs : /^\.(git|svn)$/, 31 | optional : true 32 | }); 33 | 34 | sails.log.info("HUMPBACK.JOBS.DIR:" + sails.config.appPath + "/jobs"); 35 | 36 | _.forEach(jobs, function(job, name){ 37 | sails.log.info("Registering kue handler: "+name) 38 | kue_engine.process(name, job); 39 | }) 40 | 41 | process.once('SIGTERM', function (sig) { 42 | kue_engine.shutdown(function (err) { 43 | console.log('Kue is shut down.', err || ''); 44 | process.exit(0); 45 | }, 5000); 46 | }); 47 | }); 48 | 49 | return next(); 50 | } 51 | }; 52 | }; -------------------------------------------------------------------------------- /api/hooks/redisevent/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * redisevent hook 3 | */ 4 | 5 | module.exports = function (sails) { 6 | /** 7 | * Module dependencies. 8 | */ 9 | 10 | /** 11 | * Expose hook definition 12 | */ 13 | 14 | return { 15 | 16 | // Run when sails loads-- be sure and call `next()`. 17 | initialize: function (next) { 18 | sails.after('hook:orm:loaded', function () { 19 | sails.log.info("Starting redis-event"); 20 | var redisevent_engine = sails.config.redisevent; 21 | 22 | //register humpback redis-event channels. 23 | sails.log.info("Registering redis-event channels"); 24 | var events = require('include-all')({ 25 | dirname : sails.config.appPath +'/events', 26 | filter : /(.+)\.js$/, 27 | excludeDirs : /^\.(git|svn)$/, 28 | optional : true 29 | }); 30 | 31 | sails.log.info("EVENTS DIR:" + sails.config.appPath + "/events"); 32 | 33 | _.forEach(events, function(pubsub, channel){ 34 | sails.log.info("Registering channel: "+channel); 35 | redisevent_engine.subscribe(channel); 36 | }); 37 | 38 | process.once('SIGTERM', function (sig) { 39 | redisevent_engine.shutdown(function (err) { 40 | console.log('redis-event is shut down.', err || ''); 41 | process.exit(0); 42 | }, 5000); 43 | }); 44 | 45 | }); 46 | 47 | return next(); 48 | } 49 | }; 50 | }; -------------------------------------------------------------------------------- /api/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/api/models/.gitkeep -------------------------------------------------------------------------------- /api/models/Alert.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Alert.js 3 | * 4 | * @description :: Stores an alert for front end displayed 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#alert 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | 10 | var _ = require('lodash'); 11 | var _super = require('humpback-hook/api/models/Alert'); 12 | 13 | _.merge(exports, _super); 14 | _.merge(exports, { 15 | 16 | /** 17 | * Extend the Model 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Alert.js 19 | * @exmaple: 20 | * attributes : { 21 | * foo : {type: 'string'} 22 | * }, 23 | * bar: function(values, next){ 24 | * next(); 25 | * } 26 | */ 27 | 28 | }); 29 | 30 | -------------------------------------------------------------------------------- /api/models/Category.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Route.js 3 | * 4 | * @description :: Stores the Route 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#category 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-cms-hook/api/models/Category'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-cms-hook/blob/master/api/models/Category.js 18 | * @exmaple: 19 | * attributes : { 20 | * foo : {type: 'string'} 21 | * }, 22 | * bar: function(values, next){ 23 | * next(); 24 | * } 25 | */ 26 | 27 | }); -------------------------------------------------------------------------------- /api/models/Criteria.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Criteria.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#alert 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | 10 | var _ = require('lodash'); 11 | var _super = require('humpback-hook/api/models/Criteria'); 12 | 13 | _.merge(exports, _super); 14 | _.merge(exports, { 15 | 16 | /** 17 | * Extend the Model 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Criteria.js 19 | * @exmaple: 20 | * attributes : { 21 | * foo : {type: 'string'} 22 | * }, 23 | * bar: function(values, next){ 24 | * next(); 25 | * } 26 | */ 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /api/models/Email.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Email.js 3 | * 4 | * @description :: Represents a Waterline collection that stores Email Templates 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#email 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-email-hook/api/models/Email'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Email.js 18 | * @exmaple: 19 | * attributes : { 20 | * foo : {type: 'string'} 21 | * }, 22 | * bar: function(values, next){ 23 | * next(); 24 | * } 25 | */ 26 | 27 | }); -------------------------------------------------------------------------------- /api/models/Model.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Model.js 3 | * 4 | * @description :: Represents a Waterline collection that a User can preform CRUD, query, etc. 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#model 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/models/Model'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Model.js 18 | * @exmaple: 19 | * attributes : { 20 | * foo : {type: 'string'} 21 | * }, 22 | * bar: function(values, next){ 23 | * next(); 24 | * } 25 | */ 26 | 27 | }); -------------------------------------------------------------------------------- /api/models/Passport.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Passport.js 3 | * 4 | * @description :: Stores a passport for a user 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#passport 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/models/Passport'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Passport.js 18 | * @exmaple: 19 | * attributes : { 20 | * foo : {type: 'string'} 21 | * }, 22 | * bar: function(values, next){ 23 | * next(); 24 | * } 25 | */ 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /api/models/Permission.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Permission.js 3 | * 4 | * @description :: The actions a Role is granted on a particular Model and its attributes 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#permission 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/models/Permission'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Permission.js 18 | * @exmaple: 19 | * attributes : { 20 | * foo : {type: 'string'} 21 | * }, 22 | * bar: function(values, next){ 23 | * next(); 24 | * } 25 | */ 26 | 27 | }); -------------------------------------------------------------------------------- /api/models/RequestLog.js: -------------------------------------------------------------------------------- 1 | /** 2 | * RequestLog.js 3 | * 4 | * @description :: This is a private model, meaning that 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#requestlog 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/models/RequestLog'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/RequestLog.js 18 | * @exmaple: 19 | * attributes : { 20 | * foo : {type: 'string'} 21 | * }, 22 | * bar: function(values, next){ 23 | * next(); 24 | * } 25 | */ 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /api/models/Role.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Role.js 3 | * 4 | * @description :: Stores the type of Role 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#role 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/models/Role'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Role.js 18 | * @exmaple: 19 | * attributes : { 20 | * foo : {type: 'string'} 21 | * }, 22 | * bar: function(values, next){ 23 | * next(); 24 | * } 25 | */ 26 | 27 | }); -------------------------------------------------------------------------------- /api/models/Route.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Route.js 3 | * 4 | * @description :: Stores the Route 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#route 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-cms-hook/api/models/Route'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-cms-hook/blob/master/api/models/Route.js 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Route.js 19 | * @exmaple: 20 | * attributes : { 21 | * foo : {type: 'string'} 22 | * }, 23 | * bar: function(values, next){ 24 | * next(); 25 | * } 26 | */ 27 | 28 | }); -------------------------------------------------------------------------------- /api/models/SecurityLog.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SecurityLog.js 3 | * 4 | * @description :: Stores the security log 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#securitylog 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-hook/api/models/SecurityLog'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * @exmaple: 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/SecurityLog.js 19 | * attributes : { 20 | * foo : {type: 'string'} 21 | * }, 22 | * bar: function(values, next){ 23 | * next(); 24 | * } 25 | */ 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /api/models/Setting.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Setting.js 3 | * 4 | * @description :: Setting Contains the settings for the Humpback Application 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#setting 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | var _ = require('lodash'); 10 | var _super = require('humpback-cms-hook/api/models/Setting'); 11 | 12 | _.merge(exports, _super); 13 | _.merge(exports, { 14 | 15 | /** 16 | * Extend the Model 17 | * https://github.com/CaliStyle/humpback-cms-hook/blob/master/api/models/Setting.js 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/Setting.js 19 | * @exmaple: 20 | * attributes : { 21 | * foo : {type: 'string'} 22 | * }, 23 | * bar: function(values, next){ 24 | * next(); 25 | * } 26 | */ 27 | afterCreate: [ 28 | function eventBroadcast (setting, next){ 29 | sails.log('Setting.afterCreate.eventBroadcast', setting); 30 | 31 | sails.config.redisevent.pub('settings:create', { 32 | setting: setting 33 | }); 34 | 35 | next(); 36 | }, 37 | function webhookBroadcast (setting, next){ 38 | sails.log('Setting.afterCreate.webhookBroadcast', setting); 39 | 40 | next(); 41 | } 42 | ], 43 | afterUpdate: [ 44 | function eventBroadcast (setting, next){ 45 | sails.log('Setting.afterUpdate.eventBroadcast', setting); 46 | 47 | sails.config.redisevent.pub('settings:update', { 48 | setting: setting 49 | }); 50 | 51 | next(); 52 | }, 53 | function webhookBroadcast (subcategory, next){ 54 | sails.log('Setting.afterUpdate.webhookBroadcast', subcategory); 55 | 56 | next(); 57 | } 58 | ], 59 | afterDestroy: [ 60 | function eventBroadcast (setting, next){ 61 | sails.log('Setting.afterDestroy.eventBroadcast', setting); 62 | 63 | sails.config.redisevent.pub('settings:destroy', { 64 | setting: setting 65 | }); 66 | 67 | next(); 68 | }, 69 | function webhookBroadcast (subcategory, next){ 70 | sails.log('Setting.afterDestroy.webhookBroadcast', subcategory); 71 | 72 | next(); 73 | } 74 | ] 75 | 76 | }); 77 | -------------------------------------------------------------------------------- /api/models/User.js: -------------------------------------------------------------------------------- 1 | /** 2 | * User.js 3 | * 4 | * @description :: User Model stores the user model with the humpback default attributes and functions 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Models#user 6 | * @sails-docs :: http://sailsjs.org/#!documentation/models 7 | */ 8 | 9 | 10 | var _ = require('lodash'); 11 | var _super = require('humpback-hook/api/models/User'); 12 | 13 | _.merge(exports, _super); 14 | _.merge(exports, { 15 | 16 | /** 17 | * Extend the Model 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/models/User.js 19 | * @exmaple: 20 | * attributes : { 21 | * foo : {type: 'string'} 22 | * }, 23 | * bar: function(values, next){ 24 | * next(); 25 | * } 26 | */ 27 | 28 | }); -------------------------------------------------------------------------------- /api/policies/AdminPolicy: -------------------------------------------------------------------------------- 1 | module.exports = require('humpback-admin-hook/api/policies/AdminPolicy'); -------------------------------------------------------------------------------- /api/policies/AuditPolicy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * AuditPolicy.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Policies#audit 6 | * @sails-docs :: http://sailsjs.org/#!documentation/policies 7 | */ 8 | 9 | module.exports = require('humpback-hook/api/policies/AuditPolicy'); 10 | 11 | //var _ = require('lodash'); 12 | //var _super = require('humpback-hook/api/policies/AuditPolicy'); 13 | 14 | //_.merge(exports, _super); 15 | //_.merge(exports, { 16 | 17 | /** 18 | * Extend the Policy 19 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/policies/AuditPolicy.js 20 | */ 21 | 22 | 23 | //}); 24 | -------------------------------------------------------------------------------- /api/policies/CriteriaPolicy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * CriteriaPolicy.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Policies#criteria 6 | * @sails-docs :: http://sailsjs.org/#!documentation/policies 7 | */ 8 | 9 | module.exports = require('humpback-hook/api/policies/CriteriaPolicy'); 10 | 11 | //var _ = require('lodash'); 12 | //var _super = require('humpback-hook/api/policies/CriteriaPolicy'); 13 | 14 | //_.merge(exports, _super); 15 | //_.merge(exports, { 16 | 17 | /** 18 | * Extend the Policy 19 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/policies/CriteriaPolicy.js 20 | */ 21 | 22 | 23 | //}); 24 | -------------------------------------------------------------------------------- /api/policies/ModelPolicy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ModelPolicy.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Policies#model 6 | * @sails-docs :: http://sailsjs.org/#!documentation/policies 7 | */ 8 | 9 | module.exports = require('humpback-hook/api/policies/ModelPolicy'); 10 | 11 | //var _ = require('lodash'); 12 | //var _super = require('humpback-hook/api/policies/ModelPolicy'); 13 | 14 | //_.merge(exports, _super); 15 | //_.merge(exports, { 16 | 17 | /** 18 | * Extend the Policy 19 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/policies/ModelPolicy.js 20 | */ 21 | 22 | 23 | //}); 24 | -------------------------------------------------------------------------------- /api/policies/OwnerPolicy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * OwnerPolicy.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Policies#owner 6 | * @sails-docs :: http://sailsjs.org/#!documentation/policies 7 | */ 8 | 9 | module.exports = require('humpback-hook/api/policies/OwnerPolicy'); 10 | -------------------------------------------------------------------------------- /api/policies/PermissionPolicy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * PermissionPolicy.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Policies#permission 6 | * @sails-docs :: http://sailsjs.org/#!documentation/policies 7 | */ 8 | 9 | module.exports = require('humpback-hook/api/policies/PermissionPolicy'); 10 | -------------------------------------------------------------------------------- /api/policies/RolePolicy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * RolePolicy.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Policies#role 6 | * @sails-docs :: http://sailsjs.org/#!documentation/policies 7 | */ 8 | 9 | module.exports = require('humpback-hook/api/policies/RolePolicy'); 10 | -------------------------------------------------------------------------------- /api/policies/RoutePolicy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * RoutePolicy.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Policies#route 6 | * @sails-docs :: http://sailsjs.org/#!documentation/policies 7 | */ 8 | 9 | module.exports = require('humpback-hook/api/policies/RoutePolicy'); 10 | -------------------------------------------------------------------------------- /api/policies/sessionAuth.js: -------------------------------------------------------------------------------- 1 | /** 2 | * sessionAuth 3 | * 4 | * @module :: Policy 5 | * @description :: Simple policy to allow any authenticated user 6 | * Assumes that your login action in one of your controllers sets `req.session.authenticated = true;` 7 | * @docs :: http://sailsjs.org/#!documentation/policies 8 | * 9 | */ 10 | module.exports = function(req, res, next) { 11 | 12 | // User is allowed, proceed to the next policy, 13 | // or if this is the last policy, the controller 14 | if (req.session.authenticated) { 15 | return next(); 16 | } 17 | 18 | // User is not allowed 19 | // (default res.forbidden() behavior can be overridden in `config/403.js`) 20 | return res.forbidden('You are not permitted to perform this action.'); 21 | }; 22 | -------------------------------------------------------------------------------- /api/responses/badRequest.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 400 (Bad Request) Handler 3 | * 4 | * Usage: 5 | * return res.badRequest(); 6 | * return res.badRequest(data); 7 | * return res.badRequest(data, 'some/specific/badRequest/view'); 8 | * 9 | * e.g.: 10 | * ``` 11 | * return res.badRequest( 12 | * 'Please choose a valid `password` (6-12 characters)', 13 | * 'trial/signup' 14 | * ); 15 | * ``` 16 | */ 17 | 18 | module.exports = function badRequest(data, options) { 19 | 20 | // Get access to `req`, `res`, & `sails` 21 | var req = this.req; 22 | var res = this.res; 23 | var sails = req._sails; 24 | 25 | // Set status code 26 | res.status(400); 27 | 28 | // Log error to console 29 | if (data !== undefined) { 30 | sails.log.verbose('Sending 400 ("Bad Request") response: \n',data); 31 | } 32 | else sails.log.verbose('Sending 400 ("Bad Request") response'); 33 | 34 | // Only include errors in response if application environment 35 | // is not set to 'production'. In production, we shouldn't 36 | // send back any identifying information about errors. 37 | if (sails.config.environment === 'production') { 38 | data = undefined; 39 | } 40 | 41 | // If the user-agent wants JSON, always respond with JSON 42 | if (req.wantsJSON) { 43 | return res.jsonx(data); 44 | } 45 | 46 | // If second argument is a string, we take that to mean it refers to a view. 47 | // If it was omitted, use an empty object (`{}`) 48 | options = (typeof options === 'string') ? { view: options } : options || {}; 49 | 50 | // If a view was provided in options, serve it. 51 | // Otherwise try to guess an appropriate view, or if that doesn't 52 | // work, just send JSON. 53 | if (options.view) { 54 | return res.view(options.view, { data: data }); 55 | } 56 | 57 | // If no second argument provided, try to serve the implied view, 58 | // but fall back to sending JSON(P) if no view can be inferred. 59 | else return res.guessView({ data: data }, function couldNotGuessView () { 60 | return res.jsonx(data); 61 | }); 62 | 63 | }; 64 | 65 | -------------------------------------------------------------------------------- /api/responses/forbidden.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 403 (Forbidden) Handler 3 | * 4 | * Usage: 5 | * return res.forbidden(); 6 | * return res.forbidden(err); 7 | * return res.forbidden(err, 'some/specific/forbidden/view'); 8 | * 9 | * e.g.: 10 | * ``` 11 | * return res.forbidden('Access denied.'); 12 | * ``` 13 | */ 14 | 15 | module.exports = function forbidden (data, options) { 16 | 17 | // Get access to `req`, `res`, & `sails` 18 | var req = this.req; 19 | var res = this.res; 20 | var sails = req._sails; 21 | 22 | // Set status code 23 | res.status(403); 24 | 25 | // Log error to console 26 | if (data !== undefined) { 27 | sails.log.verbose('Sending 403 ("Forbidden") response: \n',data); 28 | } 29 | else sails.log.verbose('Sending 403 ("Forbidden") response'); 30 | 31 | // Only include errors in response if application environment 32 | // is not set to 'production'. In production, we shouldn't 33 | // send back any identifying information about errors. 34 | if (sails.config.environment === 'production') { 35 | data = undefined; 36 | } 37 | 38 | // If the user-agent wants JSON, always respond with JSON 39 | if (req.wantsJSON) { 40 | return res.jsonx(data); 41 | } 42 | 43 | // If second argument is a string, we take that to mean it refers to a view. 44 | // If it was omitted, use an empty object (`{}`) 45 | options = (typeof options === 'string') ? { view: options } : options || {}; 46 | 47 | // If a view was provided in options, serve it. 48 | // Otherwise try to guess an appropriate view, or if that doesn't 49 | // work, just send JSON. 50 | if (options.view) { 51 | return res.view(options.view, { data: data }); 52 | } 53 | 54 | // If no second argument provided, try to serve the default view, 55 | // but fall back to sending JSON(P) if any errors occur. 56 | else return res.view('403', { data: data }, function (err, html) { 57 | 58 | // If a view error occured, fall back to JSON(P). 59 | if (err) { 60 | // 61 | // Additionally: 62 | // • If the view was missing, ignore the error but provide a verbose log. 63 | if (err.code === 'E_VIEW_FAILED') { 64 | sails.log.verbose('res.forbidden() :: Could not locate view for error page (sending JSON instead). Details: ',err); 65 | } 66 | // Otherwise, if this was a more serious error, log to the console with the details. 67 | else { 68 | sails.log.warn('res.forbidden() :: When attempting to render error page view, an error occured (sending JSON instead). Details: ', err); 69 | } 70 | return res.jsonx(data); 71 | } 72 | 73 | return res.send(html); 74 | }); 75 | 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /api/responses/ok.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 200 (OK) Response 3 | * 4 | * Usage: 5 | * return res.ok(); 6 | * return res.ok(data); 7 | * return res.ok(data, 'auth/login'); 8 | * 9 | * @param {Object} data 10 | * @param {String|Object} options 11 | * - pass string to render specified view 12 | */ 13 | 14 | module.exports = function sendOK (data, options) { 15 | 16 | // Get access to `req`, `res`, & `sails` 17 | var req = this.req; 18 | var res = this.res; 19 | var sails = req._sails; 20 | 21 | sails.log.silly('res.ok() :: Sending 200 ("OK") response'); 22 | 23 | // Set status code 24 | res.status(200); 25 | 26 | // If appropriate, serve data as JSON(P) 27 | if (req.wantsJSON) { 28 | return res.jsonx(data); 29 | } 30 | 31 | // If second argument is a string, we take that to mean it refers to a view. 32 | // If it was omitted, use an empty object (`{}`) 33 | options = (typeof options === 'string') ? { view: options } : options || {}; 34 | 35 | // If a view was provided in options, serve it. 36 | // Otherwise try to guess an appropriate view, or if that doesn't 37 | // work, just send JSON. 38 | if (options.view) { 39 | return res.view(options.view, { data: data }); 40 | } 41 | 42 | // If no second argument provided, try to serve the implied view, 43 | // but fall back to sending JSON(P) if no view can be inferred. 44 | else return res.guessView({ data: data }, function couldNotGuessView () { 45 | return res.jsonx(data); 46 | }); 47 | 48 | }; 49 | -------------------------------------------------------------------------------- /api/responses/response.js: -------------------------------------------------------------------------------- 1 | module.exports = function sendResponse (options) { 2 | 3 | // Get access to `req`, `res`, & `sails` 4 | var req = this.req; 5 | var res = this.res; 6 | var sails = req._sails; 7 | 8 | // If a status is provided, it must be an int, or consider this an error 9 | if (options.status) { 10 | options.status = parseInt(options.status, 10) || 500; 11 | } 12 | // Default to status 200. 13 | else { 14 | options.status = 200; 15 | } 16 | 17 | switch (options.action) { 18 | 19 | case 'respond_with_result_and_status': 20 | case 'respond_with_value_and_status': 21 | try { 22 | JSON.parse(options.data); 23 | res.status(options.status); 24 | return res.json(options.data); 25 | } 26 | catch (e) { 27 | res.status(options.status); 28 | return res.send(options.data); 29 | } 30 | break; 31 | 32 | case 'respond_with_status': 33 | if (options.status === 200) {res.send(200);} 34 | else {res.negotiate({status: options.status, error: options.data});} 35 | break; 36 | 37 | case 'redirect': 38 | try { 39 | res.redirect(options.data); 40 | } catch (e) { 41 | res.send("Redirect error"); 42 | } 43 | break; 44 | 45 | case 'display_view': 46 | res.view(options.view, options.data, function(err, result) { 47 | if (err) {req.wantsJSON = false; return res.negotiate(err);} 48 | return res.send(result); 49 | }); 50 | break; 51 | 52 | case 'not_implemented': 53 | res.send(501); 54 | break; 55 | 56 | case 'compiler_error': 57 | res.send(500, "There was an error compiling this route!"); 58 | break; 59 | 60 | } 61 | 62 | return; 63 | 64 | }; 65 | -------------------------------------------------------------------------------- /api/responses/serverError.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 500 (Server Error) Response 3 | * 4 | * Usage: 5 | * return res.serverError(); 6 | * return res.serverError(err); 7 | * return res.serverError(err, 'some/specific/error/view'); 8 | * 9 | * NOTE: 10 | * If something throws in a policy or controller, or an internal 11 | * error is encountered, Sails will call `res.serverError()` 12 | * automatically. 13 | */ 14 | 15 | module.exports = function serverError (data, options) { 16 | 17 | // Get access to `req`, `res`, & `sails` 18 | var req = this.req; 19 | var res = this.res; 20 | var sails = req._sails; 21 | 22 | // Set status code 23 | res.status(500); 24 | 25 | // Log error to console 26 | if (data !== undefined) { 27 | sails.log.error('Sending 500 ("Server Error") response: \n',data); 28 | } 29 | else sails.log.error('Sending empty 500 ("Server Error") response'); 30 | 31 | // Only include errors in response if application environment 32 | // is not set to 'production'. In production, we shouldn't 33 | // send back any identifying information about errors. 34 | if (sails.config.environment === 'production') { 35 | data = undefined; 36 | } 37 | 38 | // If the user-agent wants JSON, always respond with JSON 39 | if (req.wantsJSON) { 40 | return res.jsonx(data); 41 | } 42 | 43 | // If second argument is a string, we take that to mean it refers to a view. 44 | // If it was omitted, use an empty object (`{}`) 45 | options = (typeof options === 'string') ? { view: options } : options || {}; 46 | 47 | // If a view was provided in options, serve it. 48 | // Otherwise try to guess an appropriate view, or if that doesn't 49 | // work, just send JSON. 50 | if (options.view) { 51 | return res.view(options.view, { data: data }); 52 | } 53 | 54 | // If no second argument provided, try to serve the default view, 55 | // but fall back to sending JSON(P) if any errors occur. 56 | else return res.view('500', { data: data }, function (err, html) { 57 | 58 | // If a view error occured, fall back to JSON(P). 59 | if (err) { 60 | // 61 | // Additionally: 62 | // • If the view was missing, ignore the error but provide a verbose log. 63 | if (err.code === 'E_VIEW_FAILED') { 64 | sails.log.verbose('res.serverError() :: Could not locate view for error page (sending JSON instead). Details: ',err); 65 | } 66 | // Otherwise, if this was a more serious error, log to the console with the details. 67 | else { 68 | sails.log.warn('res.serverError() :: When attempting to render error page view, an error occured (sending JSON instead). Details: ', err); 69 | } 70 | return res.jsonx(data); 71 | } 72 | 73 | return res.send(html); 74 | }); 75 | 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /api/services/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/api/services/.gitkeep -------------------------------------------------------------------------------- /api/services/CronService.js: -------------------------------------------------------------------------------- 1 | /** 2 | * CronService.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Services 6 | * @sails-docs :: http://sailsjs.org/#!documentation/services 7 | */ 8 | 9 | module.exports = sails.config.cron; -------------------------------------------------------------------------------- /api/services/KueService.js: -------------------------------------------------------------------------------- 1 | /** 2 | * KueService.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Services#kue 6 | * @sails-docs :: http://sailsjs.org/#!documentation/services 7 | */ 8 | 9 | module.exports = sails.config.kue; -------------------------------------------------------------------------------- /api/services/ModelService.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ModelService.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Services#model 6 | * @sails-docs :: http://sailsjs.org/#!documentation/services 7 | */ 8 | 9 | 10 | var _ = require('lodash'); 11 | var _super = require('humpback-hook/api/services/ModelService'); 12 | 13 | _.merge(exports, _super); 14 | _.merge(exports, { 15 | 16 | /** 17 | * Extend the Service 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/services/ModelService.js 19 | */ 20 | 21 | 22 | }); -------------------------------------------------------------------------------- /api/services/PermissionService.js: -------------------------------------------------------------------------------- 1 | /** 2 | * PermissionService.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Services#permission 6 | * @sails-docs :: http://sailsjs.org/#!documentation/services 7 | */ 8 | 9 | 10 | var _ = require('lodash'); 11 | var _super = require('humpback-hook/api/services/PermissionService'); 12 | 13 | _.merge(exports, _super); 14 | _.merge(exports, { 15 | 16 | /** 17 | * Extend the Service 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/services/PermissionService.js 19 | */ 20 | 21 | 22 | }); -------------------------------------------------------------------------------- /api/services/RedisEventService.js: -------------------------------------------------------------------------------- 1 | /** 2 | * RedisEventService.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Services 6 | * @sails-docs :: http://sailsjs.org/#!documentation/services 7 | */ 8 | 9 | module.exports = sails.config.redisevent; -------------------------------------------------------------------------------- /api/services/RouteService.js: -------------------------------------------------------------------------------- 1 | /** 2 | * RouteService.js 3 | * 4 | * @description :: 5 | * @humpback-docs :: https://github.com/CaliStyle/humpback/wiki/Services#route 6 | * @sails-docs :: http://sailsjs.org/#!documentation/services 7 | */ 8 | 9 | 10 | var _ = require('lodash'); 11 | var _super = require('humpback-hook/api/services/RouteService'); 12 | 13 | _.merge(exports, _super); 14 | _.merge(exports, { 15 | 16 | /** 17 | * Extend the Service 18 | * https://github.com/CaliStyle/humpback-hook/blob/master/api/services/RouteService.js 19 | */ 20 | 21 | 22 | }); -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * app.js 3 | * 4 | * Use `app.js` to run your app without `sails lift`. 5 | * To start the server, run: `node app.js`. 6 | * 7 | * This is handy in situations where the sails CLI is not relevant or useful. 8 | * 9 | * For example: 10 | * => `node app.js` 11 | * => `forever start app.js` 12 | * => `node debug app.js` 13 | * => `modulus deploy` 14 | * => `heroku scale` 15 | * 16 | * 17 | * The same command-line arguments are supported, e.g.: 18 | * `node app.js --silent --port=80 --prod` 19 | */ 20 | 21 | // Ensure we're in the project directory, so relative paths work as expected 22 | // no matter where we actually lift from. 23 | process.chdir(__dirname); 24 | 25 | // Ensure a "sails" can be located: 26 | (function() { 27 | var sails; 28 | try { 29 | sails = require('sails'); 30 | } catch (e) { 31 | console.error('To run an app using `node app.js`, you usually need to have a version of `sails` installed in the same directory as your app.'); 32 | console.error('To do that, run `npm install sails`'); 33 | console.error(''); 34 | console.error('Alternatively, if you have sails installed globally (i.e. you did `npm install -g sails`), you can use `sails lift`.'); 35 | console.error('When you run `sails lift`, your app will still use a local `./node_modules/sails` dependency if it exists,'); 36 | console.error('but if it doesn\'t, the app will run with the global sails instead!'); 37 | return; 38 | } 39 | 40 | // Try to get `rc` dependency 41 | var rc; 42 | try { 43 | rc = require('rc'); 44 | } catch (e0) { 45 | try { 46 | rc = require('sails/node_modules/rc'); 47 | } catch (e1) { 48 | console.error('Could not find dependency: `rc`.'); 49 | console.error('Your `.sailsrc` file(s) will be ignored.'); 50 | console.error('To resolve this, run:'); 51 | console.error('npm install rc --save'); 52 | rc = function () { return {}; }; 53 | } 54 | } 55 | 56 | 57 | // Start server 58 | sails.lift(rc('sails')); 59 | })(); 60 | -------------------------------------------------------------------------------- /assets/app/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/assets/app/.gitkeep -------------------------------------------------------------------------------- /assets/app/controllers/README.md: -------------------------------------------------------------------------------- 1 | ##Controllers 2 | These Controllers are the client side equivlent of sails.js backend controllers. 3 | 4 | ##Grunt 5 | Controllers are included into the app via a grunt task. see `tasks/register/humpback.js` 6 | 7 | To create a new Controller use the command 8 | ```sh 9 | $ sails generate humpback-controller 10 | ```` 11 | 12 | Example 13 | ```sh 14 | $ sails generate humpback-controller Friend 15 | ``` 16 | 17 | This will create a Sails API Controller as well as a Humpback controller. -------------------------------------------------------------------------------- /assets/app/controllers/UserController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * user.controller 4 | * humpback-controller created at Tue Jun 09 2015 14:54:28 GMT-0400 (EDT) 5 | **/ 6 | 7 | angular.module('user.controller', [ 8 | 'humpback.controllers' 9 | ]) 10 | .controller( 'UserCtrl', function UserController ( $scope ) { 11 | 12 | }); -------------------------------------------------------------------------------- /assets/app/controllers/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * assets/app/controllers/index.js 3 | * @description 4 | * controllers that load when the client side app does. 5 | * 6 | **/ 7 | 8 | angular.module( 'humpback.controllers', [ 9 | /** 10 | * @CORE 11 | * These are core controllers used by the framework 12 | * They are compiled with grunt -> tasks/register/humpback.js 13 | **/ 14 | /* CORE PROJECT CONTROLLERS */ 15 | 'user.controller', 16 | /* CORE PROJECT CONTROLLERS END */ 17 | /** 18 | * @PROJECT SPECIFIC 19 | * These project specific or custom controllers for this individual project 20 | **/ 21 | /* PROJECT CONTROLLERS */ 22 | 23 | /* PROJECT CONTROLLERS END */ 24 | ]); -------------------------------------------------------------------------------- /assets/app/directives/README.md: -------------------------------------------------------------------------------- 1 | ##Directives 2 | These Directives are the core Humpback Specific Directives. 3 | 4 | ##Grunt 5 | Directives are included into the app via a grunt task. see `tasks/register/humpback.js` -------------------------------------------------------------------------------- /assets/app/directives/focus.js: -------------------------------------------------------------------------------- 1 | angular.module('humpback.directives.focus', []) 2 | /* 3 | * @description 4 | * Factory that takes an Id and focuses the window on the element 5 | */ 6 | .factory('focus', function($timeout, $window) { 7 | return function(id) { 8 | // timeout makes sure that it is invoked after any other event has been triggered. 9 | // e.g. click events that need to run before the focus or 10 | // inputs elements that are in a disabled state but are enabled when those events 11 | // are triggered. 12 | $timeout(function() { 13 | var element = $window.document.getElementById(id); 14 | if(element) 15 | element.focus(); 16 | }); 17 | }; 18 | }) 19 | 20 | /* 21 | * @description 22 | * Directive that focuses the window on an element 23 | * @usage 24 | * ex. {{ '' }} 25 | */ 26 | .directive('eventFocus', function(focus) { 27 | return function(scope, elem, attr) { 28 | elem.on(attr.eventFocus, function() { 29 | focus(attr.eventFocusId); 30 | }); 31 | 32 | // Removes bound events in the element itself 33 | // when the scope is destroyed 34 | scope.$on('$destroy', function() { 35 | elem.off(attr.eventFocus); 36 | }); 37 | }; 38 | }); -------------------------------------------------------------------------------- /assets/app/directives/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * assets/app/directives/index.js 3 | * @description 4 | * hooks that load when the client side app does 5 | * 6 | **/ 7 | 8 | angular.module( 'humpback.directives' 9 | , [ 10 | /** 11 | * @CORE 12 | * These are core hooks used by the framework 13 | * They are compiled with grunt -> tasks/register/humpback.js 14 | **/ 15 | /* CORE PROJECT DIRECTIVES */ 16 | 'humpback.directives.checklist', 17 | 'humpback.directives.focus', 18 | /* CORE PROJECT DIRECTIVES END */ 19 | /** 20 | * @PROJECT SPECIFIC 21 | * These project specific or custom hooks for this individual project 22 | **/ 23 | /* PROJECT DIRECTIVES */ 24 | 25 | /* PROJECT DIRECTIVES END */ 26 | ] 27 | ); -------------------------------------------------------------------------------- /assets/app/filters/README.md: -------------------------------------------------------------------------------- 1 | ##Filters 2 | These Filters are the core Humpback Specific Filters. 3 | 4 | ##Grunt 5 | Filters are included into the app via a grunt task. see `tasks/register/humpback.js` -------------------------------------------------------------------------------- /assets/app/filters/core.js: -------------------------------------------------------------------------------- 1 | angular.module('humpback.filters.core', []) 2 | 3 | /* 4 | * @description 5 | * capitalizes first letter 6 | * @usage 7 | * ex. {{ 'hello world' | capitalize }} 8 | * @return 9 | * ex. 'Hello world' 10 | */ 11 | .filter('capitalize', function() { 12 | return function(input, scope) { 13 | if (input!=null && typeof input !== 'undefined'){ 14 | input = input.toLowerCase(); 15 | return input.substring(0,1).toUpperCase()+input.substring(1); 16 | } 17 | } 18 | }) 19 | 20 | /* 21 | * @description 22 | * Takes a number and converts it to a percentage before adding a precentage symbol. 23 | * @usage 24 | * ex. {{ 0.03 | percentage }} 25 | * @return 26 | * ex. 3% 27 | */ 28 | .filter('percentage', function ($window) { 29 | return function (input, decimals, suffix) { 30 | decimals = angular.isNumber( decimals ) ? decimals : 3; 31 | suffix = suffix || '%'; 32 | if ( $window.isNaN( input ) ) { 33 | return ''; 34 | } 35 | return Math.round( input * Math.pow( 10, decimals + 2 ) ) / Math.pow( 10, decimals ) + suffix; 36 | } 37 | }) 38 | 39 | /* 40 | * @description 41 | * Stands for Instant IF statement, creates an if else statement 42 | * @usage 43 | * ex. {{ happy | iif: 'Happy' : 'Sad' }} 44 | * @return 45 | * ex. if happy print "Happy" else print "Sad" 46 | */ 47 | .filter('iif', function () { 48 | return function(input, trueValue, falseValue) { 49 | return input ? trueValue : falseValue; 50 | }; 51 | }) 52 | 53 | /* 54 | * @description 55 | * TODO write description 56 | */ 57 | .filter('trustAsResourceUrl', ['$sce', function($sce) { 58 | return function(val) { 59 | return $sce.trustAsResourceUrl(val); 60 | }; 61 | }]) 62 | 63 | /* 64 | * @description 65 | * Trust html to be rendered via a variable 66 | * @usage 67 | * ex. {{ '
Trust Me
' | sanitize }} 68 | * @return 69 | * ex.
Trust Me
70 | */ 71 | .filter("sanitize", ['$sce', function($sce) { 72 | return function(htmlCode){ 73 | return $sce.trustAsHtml(htmlCode); 74 | } 75 | }]); -------------------------------------------------------------------------------- /assets/app/filters/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * assets/app/filters/index.js 3 | * @description 4 | * filters that load when the client side app does 5 | * 6 | **/ 7 | 8 | angular.module( 'humpback.filters' 9 | , [ 10 | /** 11 | * @CORE 12 | * These are core hooks used by the framework 13 | * They are compiled with grunt -> tasks/register/humpback.js 14 | **/ 15 | /* CORE PROJECT FILTERS */ 16 | 'humpback.filters.core', 17 | 'humpback.filters.truncate', 18 | /* CORE PROJECT FILTERS END */ 19 | /** 20 | * @PROJECT SPECIFIC 21 | * These project specific or custom filters for this individual project 22 | **/ 23 | /* PROJECT FILTERS */ 24 | 25 | /* PROJECT FILTERS END */ 26 | ] 27 | ); -------------------------------------------------------------------------------- /assets/app/filters/truncate.js: -------------------------------------------------------------------------------- 1 | angular.module('humpback.filters.truncate', [ 2 | 3 | ]) 4 | .filter('characters', function () { 5 | return function (input, chars, breakOnWord) { 6 | if (isNaN(chars)) return input; 7 | if (chars <= 0) return ''; 8 | if (input && input.length > chars) { 9 | input = input.substring(0, chars); 10 | 11 | if (!breakOnWord) { 12 | var lastspace = input.lastIndexOf(' '); 13 | //get last space 14 | if (lastspace !== -1) { 15 | input = input.substr(0, lastspace); 16 | } 17 | }else{ 18 | while(input.charAt(input.length-1) === ' '){ 19 | input = input.substr(0, input.length -1); 20 | } 21 | } 22 | return input + '…'; 23 | } 24 | return input; 25 | }; 26 | }) 27 | .filter('splitcharacters', function() { 28 | return function (input, chars) { 29 | if (isNaN(chars)) return input; 30 | if (chars <= 0) return ''; 31 | if (input && input.length > chars) { 32 | var prefix = input.substring(0, chars/2); 33 | var postfix = input.substring(input.length-chars/2, input.length); 34 | return prefix + '...' + postfix; 35 | } 36 | return input; 37 | }; 38 | }) 39 | .filter('words', function () { 40 | return function (input, words) { 41 | if (isNaN(words)) return input; 42 | if (words <= 0) return ''; 43 | if (input) { 44 | var inputWords = input.split(/\s+/); 45 | if (inputWords.length > words) { 46 | input = inputWords.slice(0, words).join(' ') + '…'; 47 | } 48 | } 49 | return input; 50 | }; 51 | }); -------------------------------------------------------------------------------- /assets/app/hooks/README.md: -------------------------------------------------------------------------------- 1 | ##Hooks 2 | These Hooks are the core Humpback Specific Hooks. 3 | 4 | ##Grunt 5 | Hooks are included into the app via a grunt task. see `tasks/register/humpback.js` -------------------------------------------------------------------------------- /assets/app/hooks/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * assets/app/hooks/index.js 3 | * @description 4 | * hooks that load when the client side app does 5 | * 6 | **/ 7 | 8 | angular.module( 'humpback.hooks' 9 | , [ 10 | /** 11 | * @CORE 12 | * These are core hooks used by the framework 13 | * 14 | **/ 15 | /* CORE PROJECT HOOKS */ 16 | 17 | /* CORE PROJECT HOOKS END */ 18 | /** 19 | * @PROJECT SPECIFIC 20 | * These project specific or custom hooks for this individual project 21 | * They are compiled with grunt -> tasks/register/humpback.js 22 | **/ 23 | /* PROJECT HOOKS */ 24 | 25 | /* PROJECT HOOKS END */ 26 | ] 27 | ); -------------------------------------------------------------------------------- /assets/app/models/README.md: -------------------------------------------------------------------------------- 1 | ##Models 2 | These Models are the client side equivlent of sails.js backend models. 3 | 4 | ##Grunt 5 | Models are included into the app via a grunt task. see `tasks/register/humpback.js` 6 | 7 | To create a new Model use the command 8 | ```sh 9 | $ sails generate humpback-model 10 | ```` 11 | 12 | Example 13 | ```sh 14 | $ sails generate humpback-model Friend 15 | ``` 16 | 17 | This will create a Sails API Model as well as a Humpback model -------------------------------------------------------------------------------- /assets/app/models/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * assets/app/models/index.js 3 | * @description 4 | * JSdata Models handle the client side objects sent from the server and preform 5 | * local CRUD operations that resolve with the server 6 | * 7 | **/ 8 | 9 | angular.module( 'humpback.models' 10 | , [ 11 | /** 12 | * @CORE 13 | * These are core models used by the framework 14 | * They are compiled with grunt -> tasks/register/humpback.js 15 | **/ 16 | /* CORE PROJECT MODELS */ 17 | 'alert.model', 18 | 'category.model', 19 | 'email.model', 20 | 'model.model', 21 | 'passport.model', 22 | 'permission.model', 23 | 'role.model', 24 | 'route.model', 25 | 'setting.model', 26 | 'user.model', 27 | /* CORE PROJECT MODELS END */ 28 | 29 | /** 30 | * @PROJECT SPECIFIC 31 | * These project specific or custom models for this individual project 32 | 33 | **/ 34 | /* PROJECT MODELS */ 35 | 36 | /* PROJECT MODELS END */ 37 | ] 38 | ); -------------------------------------------------------------------------------- /assets/app/policies/README.md: -------------------------------------------------------------------------------- 1 | ##Policies 2 | These Policies are the core Humpback Specific Policies. 3 | 4 | ##Grunt 5 | Policies are included into the app via a grunt task. see `tasks/register/humpback.js` -------------------------------------------------------------------------------- /assets/app/policies/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * assets/app/policies/index.js 3 | * @description 4 | * policies that load when the client side app does. 5 | * 6 | **/ 7 | 8 | angular.module( 'humpback.policies' 9 | , [ 10 | /** 11 | * @CORE 12 | * These are core policies used by the framework 13 | * They are compiled with grunt -> tasks/register/humpback.js 14 | **/ 15 | /* CORE PROJECT POLICIES */ 16 | 17 | /* CORE PROJECT POLICIES END */ 18 | 19 | /** 20 | * @PROJECT SPECIFIC 21 | * These project specific or custom policies for this individual project 22 | **/ 23 | /* PROJECT POLICIES */ 24 | 25 | /* PROJECT POLICIES END */ 26 | ] 27 | ); -------------------------------------------------------------------------------- /assets/app/providers/README.md: -------------------------------------------------------------------------------- 1 | ##Providers 2 | These Providers are the core Humpback Specific Providers. 3 | 4 | ##Grunt 5 | Providers are included into the app via a grunt task. see `tasks/register/humpback.js` -------------------------------------------------------------------------------- /assets/app/services/README.md: -------------------------------------------------------------------------------- 1 | ##Services 2 | These Services are the core Humpback Specific Services. 3 | 4 | ##Grunt 5 | Services are included into the app via a grunt task. see `tasks/register/humpback.js` -------------------------------------------------------------------------------- /assets/app/services/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * assets/app/services/index.js 3 | * @description 4 | * services that load when the client side app does. 5 | * 6 | **/ 7 | 8 | angular.module( 'humpback.services' 9 | , [ 10 | /** 11 | * @CORE 12 | * These are core services used by the framework 13 | * They are compiled with grunt -> tasks/register/humpback.js 14 | **/ 15 | /* CORE PROJECT SERVICES */ 16 | 'humpback.services.utils', 17 | /* CORE PROJECT SERVICES END */ 18 | 19 | /** 20 | * @PROJECT SPECIFIC 21 | * These project specific or custom services for this individual project 22 | **/ 23 | /* PROJECT SERVICES */ 24 | 25 | /* PROJECT SERVICES END */ 26 | ] 27 | ); -------------------------------------------------------------------------------- /assets/app/services/utils.js: -------------------------------------------------------------------------------- 1 | angular.module( 'humpback.services.utils', []) 2 | 3 | .service('utils', function($timeout, FoundationApi) { 4 | return { 5 | development: function(log){ 6 | if(!window._env){ 7 | throw new Error('Humpback enviroment not found'); 8 | } 9 | var development = !window._env || window._env === "development" ? true : false; 10 | if(development && log){ 11 | console.log(log); 12 | } 13 | return development; 14 | }, 15 | alert: function(alert){ 16 | return FoundationApi.publish(alert.location, { color: alert.color, title: alert.title, content: alert.content, autoclose: alert.autoclose}); 17 | }, 18 | 19 | /** 20 | * @param {Object} err requires status, data 21 | */ 22 | handleError: function(err){ 23 | return err; 24 | } 25 | } 26 | }); -------------------------------------------------------------------------------- /assets/app/views/README.md: -------------------------------------------------------------------------------- 1 | ##VIEWS 2 | Views are SPA view states. You should not edit the HTML files in this folder, 3 | instead edit the EJS files in the `views/` folder. This allows for the EJS files 4 | to still act like layout views which speeds up initial load time. 5 | 6 | ##Grunt 7 | Views .html files are converted from ejs and included into the app via a grunt task. 8 | see `tasks/register/humpback.js` They can be all loaded into a single JS HTML template 9 | or loaded by module depending on your Apps size. 10 | 11 | To create a new View use the command 12 | ```sh 13 | $ sails generate humpback-view 14 | ```` 15 | 16 | Example: 17 | ```sh 18 | $ sails generate humpback-view profile/dashboard 19 | ``` -------------------------------------------------------------------------------- /assets/app/views/admin/Admin.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 11:28:21 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.Admin.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminCtrl', function AdminController( $scope, DS ) { 11 | 12 | $scope.filters = { 13 | itemsPerPage: [ 14 | { 15 | value: 10, 16 | name: '10' 17 | }, 18 | { 19 | value: 20, 20 | name: '20' 21 | }, 22 | { 23 | value: 30, 24 | name: '30' 25 | }, 26 | { 27 | value: 40, 28 | name: '40' 29 | }, 30 | { 31 | value: 50, 32 | name: '50' 33 | }, 34 | { 35 | value: 100, 36 | name: '100' 37 | } 38 | ], 39 | itemsSort: [ 40 | { 41 | value: 'createdAt DESC', 42 | name: 'Oldest', 43 | 44 | }, 45 | { 46 | value: 'createdAt ASC', 47 | name: 'Newest' 48 | } 49 | ] 50 | }; 51 | 52 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/Admin.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 11:28:21 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.Admin.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin', { 13 | url: '^/admin', 14 | ncyBreadcrumb: { 15 | label: 'Admin' 16 | }, 17 | views: { 18 | "main": { 19 | controller: 'AdminCtrl', 20 | templateUrl: 'app/views/admin/index.html' 21 | }, 22 | "header@admin": { 23 | templateUrl: 'app/views/admin/header.html' 24 | } 25 | } 26 | }) 27 | ; 28 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/cms/AdminCms.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 11:28:21 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminCms.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminCmsCtrl', function AdminCmsController( $scope, $stateParams, DS, Api) { 11 | 12 | console.log($stateParams); 13 | $scope.routes = new Api('route',{ 14 | limit : $stateParams.limit ? parseInt($stateParams.limit) : 10, 15 | skip : $stateParams.skip ? parseInt($stateParams.skip) : 0, 16 | criteria : $stateParams.criteria ? $stateParams.criteria : {verb: 'get'}, 17 | page : $stateParams.page ? $stateParams.page : 1, 18 | options: { 19 | bypassCache: true 20 | } 21 | }); 22 | $scope.routes.init().then(function(){ 23 | $scope.routes.options.bypassCache = false; 24 | }); 25 | 26 | $scope.routes.model = new Api('model', { 27 | criteria: { 28 | name: 'route' 29 | } 30 | }); 31 | $scope.routes.model.search() 32 | .then(function(models){ 33 | $scope.routes.model.selected = models[0]; 34 | }); 35 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/cms/AdminCms.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 11:28:21 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminCms.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.cms', { 13 | url: '/cms?skip?sort?limit?criteria?page', 14 | reloadOnSearch: false, 15 | ncyBreadcrumb: { 16 | label: 'Content Management' 17 | }, 18 | views: { 19 | "admin": { 20 | controller: 'AdminCmsCtrl', 21 | templateUrl: 'app/views/admin/cms/index.html' 22 | } 23 | } 24 | }) 25 | ; 26 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/cms/categories/AdminCmsCategories.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Fri Sep 04 2015 15:59:24 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminCmsCategories.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminCmsCategoriesCtrl', function AdminCmsCategoriesController( $scope, $stateParams, DS, Api ) { 11 | console.log($stateParams); 12 | 13 | $scope.categories = new Api('category', { 14 | limit : $stateParams.limit ? parseInt($stateParams.limit) : 10, 15 | skip : $stateParams.skip ? parseInt($stateParams.skip) : 0, 16 | criteria : $stateParams.criteria ? $stateParams.criteria : null, 17 | page : $stateParams.page ? $stateParams.page : 1, 18 | options: { 19 | bypassCache: true 20 | } 21 | }); 22 | 23 | $scope.categories.init().then(function(){ 24 | $scope.categories.options.bypassCache = false; 25 | }); 26 | 27 | $scope.categories.model = new Api('model', { 28 | criteria: { 29 | name: 'category' 30 | } 31 | }); 32 | $scope.categories.model.search() 33 | .then(function(models){ 34 | $scope.categories.model.selected = models[0]; 35 | }); 36 | 37 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/cms/categories/AdminCmsCategories.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Fri Sep 04 2015 15:59:24 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminCmsCategories.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.cms.categories', { 13 | url: '/categories?skip?sort?limit?criteria?page', 14 | reloadOnSearch: false, 15 | ncyBreadcrumb: { 16 | label: 'Categories' 17 | }, 18 | views: { 19 | "admin@admin": { 20 | controller: 'AdminCmsCategoriesCtrl', 21 | templateUrl: 'app/views/admin/cms/categories/index.html' 22 | } 23 | } 24 | }) 25 | ; 26 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/cms/categories/view/AdminCmsCategoriesView.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Fri Sep 04 2015 17:31:09 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminCmsCategoriesView.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminCmsCategoriesViewCtrl', function AdminCmsCategoriesViewController( $scope, $state, $stateParams, DS, Api) { 11 | $scope.category = new Api('category',{ 12 | options: { 13 | bypassCache: true 14 | } 15 | }); 16 | 17 | $scope.category.read($stateParams.id); 18 | 19 | $scope.category.Routes = new Api('route', { 20 | options: { 21 | bypassCache: true, 22 | endpoint: '/category/' + $stateParams.id + '/routes' 23 | } 24 | }); 25 | $scope.category.Routes.init(); 26 | 27 | DS.bindOne('category', $stateParams.id, $scope, 'thiscategory'); 28 | 29 | $scope.category.model = new Api('model', { 30 | criteria: { 31 | name: 'category' 32 | } 33 | }); 34 | $scope.category.model.search() 35 | .then(function(models){ 36 | $scope.category.model.selected = models[0]; 37 | }); 38 | 39 | $scope.updateCategory = function(){ 40 | $scope.category.update($scope.thiscategory); 41 | } 42 | 43 | $scope.deleteCategory = function(){ 44 | $scope.category.delete($scope.thiscategory) 45 | .then(function(thiscategory){ 46 | $state.go('admin.cms.categories'); 47 | }); 48 | } 49 | 50 | }) 51 | .controller( 'AdminCmsCategoriesNewCtrl', function AdminCmsCategoriesNewController( $scope, $state, $stateParams, DS, Api) { 52 | 53 | $scope.category = new Api('category', { 54 | isNew: true 55 | }); 56 | $scope.thiscategory = $scope.category.selected; 57 | 58 | $scope.category.model = new Api('model', { 59 | criteria: { 60 | name: 'category' 61 | } 62 | }); 63 | $scope.category.model.search() 64 | .then(function(models){ 65 | $scope.category.model.selected = models[0]; 66 | }); 67 | 68 | $scope.createCategory = function(){ 69 | console.log("Clicked"); 70 | $scope.category.create($scope.thiscategory) 71 | .then(function(thiscategory){ 72 | $state.go('admin.cms.categories.view',{id: thiscategory.id}); 73 | }); 74 | } 75 | 76 | 77 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/cms/categories/view/AdminCmsCategoriesView.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Fri Sep 04 2015 17:31:09 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminCmsCategoriesView.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.cms.categories.view', { 13 | url: '/view/:id', 14 | ncyBreadcrumb: { 15 | label: '{{ thiscategory.name }}' 16 | }, 17 | views: { 18 | "admin@admin": { 19 | controller: 'AdminCmsCategoriesViewCtrl', 20 | templateUrl: 'app/views/admin/cms/categories/view/index.html' 21 | }, 22 | "widgets@admin.cms.categories.view": { 23 | templateUrl: 'app/views/admin/cms/categories/view/widgets.html' 24 | } 25 | } 26 | }) 27 | .state( 'admin.cms.categories.new', { 28 | url: '/new?id', 29 | ncyBreadcrumb: { 30 | label: 'New' 31 | }, 32 | views: { 33 | "admin@admin": { 34 | controller: 'AdminCmsCategoriesNewCtrl', 35 | templateUrl: 'app/views/admin/cms/categories/view/index.html' 36 | }, 37 | "widgets@admin.cms.categories.new": { 38 | templateUrl: 'app/views/admin/cms/categories/view/widgets.html' 39 | } 40 | } 41 | }) 42 | ; 43 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/cms/categories/view/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 | 11 |
12 |

Loading...

13 |
14 | 15 |
16 |

Category: {{ thiscategory.name }}

17 | 18 | 19 | 25 | 26 |
27 | 28 |
34 |
35 |
36 |
37 |
38 | 39 |
40 | 41 |
42 |
-------------------------------------------------------------------------------- /assets/app/views/admin/cms/categories/view/widgets.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /assets/app/views/admin/cms/view/AdminCmsView.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Fri Aug 28 2015 18:16:29 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminCmsView.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.cms.cms', { 13 | url: '/view/:id', 14 | ncyBreadcrumb: { 15 | label: '{{ thisroute.title }}' 16 | }, 17 | views: { 18 | "admin@admin": { 19 | controller: 'AdminCmsViewCtrl', 20 | templateUrl: 'app/views/admin/cms/view/index.html' 21 | }, 22 | "widgets@admin.cms.cms": { 23 | templateUrl: 'app/views/admin/cms/view/widgets.html' 24 | } 25 | } 26 | }) 27 | .state( 'admin.cms.new', { 28 | url: '/new?id', 29 | ncyBreadcrumb: { 30 | label: 'New' 31 | }, 32 | views: { 33 | "admin@admin": { 34 | controller: 'AdminCmsNewCtrl', 35 | templateUrl: 'app/views/admin/cms/view/index.html' 36 | }, 37 | "widgets@admin.cms.new": { 38 | templateUrl: 'app/views/admin/cms/view/widgets.html' 39 | } 40 | } 41 | }) 42 | ; 43 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/cms/view/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |

Loading...

12 |
13 | 14 |
15 | 16 | 22 |
25 | Slug: {{ thisroute.slug }} 26 |
27 |
31 | 32 | Parent: 33 | 40 | 41 | 42 |
43 |
46 | Permalink: {{ thisroute.uri }} 47 |
48 | 49 | 53 |
54 |
62 | 63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | 72 | 73 |
74 |
-------------------------------------------------------------------------------- /assets/app/views/admin/cms/view/widgets.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 9 |
10 |

Loading...

11 |
12 | 13 |
14 |
15 |

Publish

16 |

17 | Status {{ thisroute.status || 'Draft' }} 18 |

19 |
20 | Visible 21 | 22 |
23 | 34 |
35 |
36 |

37 | Created {{ thisroute.createdAt | date : 'short' }} 38 |

39 |

40 | Updated {{ thisroute.updatedAt | date : 'short' }} 41 |

42 | 43 | 46 | Move to Trash 47 | 48 | 53 | {{ route.updating | iif : 'Publishing...' : 'Publish' }} 54 | 55 | 56 | 61 | {{ route.updating | iif : 'Publishing...' : 'Publish' }} 62 | 63 | 64 | 65 |

Attributes

66 | 67 | 71 | 72 | 73 | 79 | 80 |

Category

81 |
82 | 93 |
94 | 95 | Add New Category 96 | 97 | 98 |

Featured Image

99 | 105 | 109 |
110 |
-------------------------------------------------------------------------------- /assets/app/views/admin/data/AdminData.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 11:52:44 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminData.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminDataCtrl', function AdminDataController( $scope, $stateParams, DS, Api) { 11 | 12 | $scope.models = new Api('model',{ 13 | limit : $stateParams.limit ? parseInt($stateParams.limit) : 10, 14 | skip : $stateParams.skip ? parseInt($stateParams.skip) : 0, 15 | criteria : $stateParams.criteria ? $stateParams.criteria : null, 16 | page : $stateParams.page ? $stateParams.page : 1, 17 | options: { 18 | bypassCache: true 19 | } 20 | }); 21 | $scope.models.init().then(function(){ 22 | $scope.models.options.bypassCache = false; 23 | }); 24 | 25 | 26 | $scope.models.model = new Api('model', { 27 | criteria: { 28 | name: 'model' 29 | } 30 | }); 31 | 32 | $scope.models.model.search() 33 | .then(function(models){ 34 | $scope.models.model.selected = models[0]; 35 | }); 36 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/data/AdminData.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 11:52:44 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminData.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.data', { 13 | url: '/data?skip?sort?limit?criteria?page', 14 | ncyBreadcrumb: { 15 | label: 'Data Management' 16 | }, 17 | views: { 18 | "admin": { 19 | controller: 'AdminDataCtrl', 20 | templateUrl: 'app/views/admin/data/index.html' 21 | } 22 | } 23 | }) 24 | ; 25 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/data/view/AdminDataView.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Sat Aug 29 2015 16:08:20 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminDataView.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminDataViewCtrl', function AdminDataViewController( $scope, $stateParams, DS, Api) { 11 | 12 | $scope.model = new Api('model'); 13 | $scope.model.read($stateParams.id) 14 | .then(function(model){ 15 | 16 | console.log(model); 17 | 18 | $scope.model.Collection = new Api(model.identity, { 19 | limit : $stateParams.limit ? parseInt($stateParams.limit) : 10, 20 | skip : $stateParams.skip ? parseInt($stateParams.skip) : 0, 21 | criteria : $stateParams.criteria ? $stateParams.criteria : null, 22 | page : $stateParams.page ? $stateParams.page : 1, 23 | options: { 24 | bypassCache: true 25 | } 26 | }); 27 | $scope.model.Collection.init().then(function(){ 28 | $scope.model.Collection.options.bypassCache = false; 29 | }); 30 | 31 | }); 32 | 33 | //$scope.thismodel = $scope.model.selected; 34 | DS.bindOne('model', $stateParams.id, $scope, 'thismodel'); 35 | 36 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/data/view/AdminDataView.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Sat Aug 29 2015 16:08:20 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminDataView.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.data.data', { 13 | url: '/:id?skip?sort?limit?criteria?page', 14 | reloadOnSearch: false, 15 | ncyBreadcrumb: { 16 | label: '{{ thismodel.name }}' 17 | }, 18 | views: { 19 | "admin@admin": { 20 | controller: 'AdminDataViewCtrl', 21 | templateUrl: 'app/views/admin/data/view/index.html' 22 | }, 23 | "widgets@admin.data.data": { 24 | templateUrl: 'app/views/admin/data/view/widgets.html' 25 | } 26 | } 27 | }) 28 | ; 29 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/data/view/view/AdminDataViewView.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Sun Sep 13 2015 21:29:15 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminDataViewView.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminDataViewViewCtrl', function AdminDataViewViewController( $scope, $state, $stateParams, DS, Api ) { 11 | 12 | console.log($stateParams.model, $stateParams.item); 13 | 14 | $scope.item = new Api($stateParams.model); 15 | $scope.item.read($stateParams.item); 16 | DS.bindOne($stateParams.model, $stateParams.item, $scope, 'thisitem'); 17 | 18 | $scope.updateItem = function(){ 19 | $scope.item.update($scope.thisitem) 20 | .then(function(thisitem){ 21 | 22 | }); 23 | } 24 | 25 | $scope.deleteItem = function(){ 26 | $scope.item.delete($scope.thisitem) 27 | .then(function(thisitem){ 28 | $state.go('admin.data.data',{model: $stateParams.model}); 29 | }); 30 | } 31 | }) 32 | 33 | .controller( 'AdminDataViewNewCtrl', function AdminDataViewNewController( $scope, $state, $stateParams, DS, Api ) { 34 | 35 | console.log($stateParams.model, $stateParams.item); 36 | 37 | $scope.item = new Api($stateParams.model, { 38 | isNew: true 39 | }); 40 | 41 | $scope.thisitem = $scope.item.selected; 42 | 43 | $scope.createItem = function(){ 44 | $scope.item.create($scope.thisitem) 45 | .then(function(thisitem){ 46 | $state.go('admin.data.data.data',{model: $stateParams.model, item: thisitem.id}); 47 | }); 48 | } 49 | 50 | 51 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/data/view/view/AdminDataViewView.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Sun Sep 13 2015 21:29:15 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminDataViewView.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.data.data.data', { 13 | url: '/:model/view/:item', 14 | ncyBreadcrumb: { 15 | label: 'Item' 16 | }, 17 | views: { 18 | "content@admin.data.data": { 19 | controller: 'AdminDataViewViewCtrl', 20 | templateUrl: 'app/views/admin/data/view/view/index.html' 21 | }, 22 | "widgets@admin.data.data.data": { 23 | templateUrl: 'app/views/admin/data/view/view/widgets.html' 24 | } 25 | } 26 | }) 27 | .state( 'admin.data.data.new', { 28 | url: '/:model/new?id', 29 | ncyBreadcrumb: { 30 | label: 'New Item' 31 | }, 32 | views: { 33 | "content@admin.data.data": { 34 | controller: 'AdminDataViewNewCtrl', 35 | templateUrl: 'app/views/admin/data/view/view/index.html' 36 | }, 37 | "widgets@admin.data.data.new": { 38 | templateUrl: 'app/views/admin/data/view/view/widgets.html' 39 | } 40 | } 41 | }) 42 | ; 43 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/data/view/view/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |

Loading...

12 |
13 | 14 |
17 |
18 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 31 |
-------------------------------------------------------------------------------- /assets/app/views/admin/data/view/view/widgets.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 |

Loading...

10 |
11 |
12 | 13 | 18 | {{ item.updating | iif : 'Creating...' : 'Create' }} 19 | 20 | 25 | {{ item.updating | iif : 'Updating...' : 'Update' }} 26 | 27 | 32 | {{ item.deleting | iif : 'Deleting...' : 'Delete' }} 33 | 34 | 35 |

Attributes

36 | 37 |

38 | {{ key }} 39 | 40 | {{ value.type }} 41 | Model: {{ value.model }} 42 | {{ value.enum }} 43 | Collection: {{ value.collection }} 44 |

45 |
46 |
-------------------------------------------------------------------------------- /assets/app/views/admin/data/view/widgets.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 |

Loading...

10 |
11 |
12 | 13 | 17 | New {{ thismodel.name }} 18 | 19 | 20 |

Attributes

21 | 22 |

23 | {{ key }} 24 | 25 | {{ value.type }} 26 | Model: {{ value.model }} 27 | {{ value.enum }} 28 | Collection: {{ value.collection }} 29 |

30 |
31 |
-------------------------------------------------------------------------------- /assets/app/views/admin/email/AdminEmail.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Mon Aug 31 2015 09:23:58 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminEmail.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminEmailCtrl', function AdminEmailController( $scope, $stateParams, DS, Api) { 11 | 12 | console.log($stateParams); 13 | $scope.emails = new Api('email', { 14 | limit : $stateParams.limit ? parseInt($stateParams.limit) : 10, 15 | skip : $stateParams.skip ? parseInt($stateParams.skip) : 0, 16 | criteria : $stateParams.criteria ? $stateParams.criteria : null, 17 | page : $stateParams.page ? $stateParams.page : 1, 18 | options: { 19 | bypassCache: true 20 | } 21 | }); 22 | $scope.emails.init().then(function(){ 23 | $scope.emails.options.bypassCache = false; 24 | }); 25 | 26 | $scope.emails.model = new Api('model', { 27 | criteria: { 28 | name: 'email' 29 | } 30 | }); 31 | $scope.emails.model.search() 32 | .then(function(models){ 33 | $scope.emails.model.selected = models[0]; 34 | }); 35 | 36 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/email/AdminEmail.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Mon Aug 31 2015 09:23:58 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminEmail.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.email', { 13 | url: '/email?skip?sort?limit?criteria?page', 14 | ncyBreadcrumb: { 15 | label: 'Email Management' 16 | }, 17 | views: { 18 | "admin": { 19 | controller: 'AdminEmailCtrl', 20 | templateUrl: 'app/views/admin/email/index.html' 21 | } 22 | } 23 | }) 24 | ; 25 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/email/view/AdminEmailView.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Fri Sep 25 2015 14:25:31 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminEmailView.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.email.email', { 13 | url: '/view/:id', 14 | ncyBreadcrumb: { 15 | label: '{{ thisemail.name }}' 16 | }, 17 | views: { 18 | "admin@admin": { 19 | controller: 'AdminEmailViewCtrl', 20 | templateUrl: 'app/views/admin/email/view/index.html' 21 | }, 22 | "widgets@admin.email.email": { 23 | templateUrl: 'app/views/admin/email/view/widgets.html' 24 | } 25 | } 26 | }) 27 | .state( 'admin.email.new', { 28 | url: '/new?id', 29 | ncyBreadcrumb: { 30 | label: 'New' 31 | }, 32 | views: { 33 | "admin@admin": { 34 | controller: 'AdminEmailNewCtrl', 35 | templateUrl: 'app/views/admin/email/view/index.html' 36 | }, 37 | "widgets@admin.email.new": { 38 | templateUrl: 'app/views/admin/email/view/widgets.html' 39 | } 40 | } 41 | }) 42 | ; 43 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/email/view/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
13 |
14 | 15 |

{{ thisemail.email }}

16 | 17 |
20 |
21 | 22 |
28 |
29 |
30 | 31 | 35 |
36 |
44 | 45 |
46 |
47 |
48 |
49 | 50 |
51 |
52 | 53 |
54 |
55 |
56 |
57 | 58 |
59 |
-------------------------------------------------------------------------------- /assets/app/views/admin/email/view/widgets.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /assets/app/views/admin/header.html: -------------------------------------------------------------------------------- 1 |
2 | Admin Header 3 |
-------------------------------------------------------------------------------- /assets/app/views/admin/login/AdminLogin.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Sep 29 2015 09:42:27 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminLogin.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminLoginCtrl', function AdminLoginController( $scope, DS ) { 11 | 12 | 13 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/login/AdminLogin.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Sep 29 2015 09:42:27 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminLogin.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.login', { 13 | url: '/login', 14 | ncyBreadcrumb: { 15 | label: 'Admin Login' 16 | }, 17 | views: { 18 | "main@": { 19 | controller: 'AdminLoginCtrl', 20 | templateUrl: 'app/views/admin/login/index.html' 21 | } 22 | } 23 | }) 24 | ; 25 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/login/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 |
11 |
12 |
18 |

Admin Login

19 |

20 | {{ loginerror.message }} 21 |

22 | 31 | 32 | 40 | 41 | 47 | 58 |
59 |
60 |
61 |
62 |
-------------------------------------------------------------------------------- /assets/app/views/admin/role/AdminRole.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Wed Sep 09 2015 15:10:53 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminRole.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminRoleCtrl', function AdminRoleController( $scope, DS, $stateParams, Api) { 11 | 12 | console.log($stateParams); 13 | $scope.roles = new Api('role', { 14 | limit : $stateParams.limit ? parseInt($stateParams.limit) : 10, 15 | skip : $stateParams.skip ? parseInt($stateParams.skip) : 0, 16 | criteria : $stateParams.criteria ? $stateParams.criteria : null, 17 | page : $stateParams.page ? $stateParams.page : 1, 18 | options: { 19 | bypassCache: true 20 | } 21 | }); 22 | $scope.roles.init().then(function(){ 23 | $scope.roles.options.bypassCache = false; 24 | }); 25 | 26 | $scope.roles.model = new Api('model', { 27 | criteria: { 28 | name: 'role' 29 | } 30 | }); 31 | 32 | $scope.roles.model.search() 33 | .then(function(models){ 34 | $scope.roles.model.selected = models[0]; 35 | }); 36 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/role/AdminRole.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Wed Sep 09 2015 15:10:53 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminRole.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.role', { 13 | url: '/roles?skip?sort?limit?criteria?page', 14 | reloadOnSearch: false, 15 | ncyBreadcrumb: { 16 | label: 'Roles' 17 | }, 18 | views: { 19 | "admin": { 20 | controller: 'AdminRoleCtrl', 21 | templateUrl: 'app/views/admin/role/index.html' 22 | } 23 | } 24 | }) 25 | ; 26 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/role/view/AdminRoleView.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Wed Sep 09 2015 18:52:30 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminRoleView.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminRolesViewCtrl', function AdminRolesViewController( $scope, $stateParams, DS, Api ) { 11 | 12 | $scope.role = new Api('role'); 13 | $scope.role.read($stateParams.id); 14 | DS.bindOne('role', $stateParams.id, $scope, 'thisrole'); 15 | 16 | $scope.role.model = new Api('model', { 17 | criteria: { 18 | name: 'role' 19 | } 20 | }); 21 | $scope.role.model.search() 22 | .then(function(models){ 23 | $scope.role.model.selected = models[0]; 24 | }); 25 | 26 | $scope.role.Users = new Api('user', { 27 | options: { 28 | bypassCache: true, 29 | endpoint: '/role/' + $stateParams.id + '/users' 30 | } 31 | }); 32 | $scope.role.Users.init(); 33 | 34 | $scope.updateRole = function(){ 35 | $scope.role.update($scope.thisrole) 36 | .then(function(thisrole){ 37 | 38 | }); 39 | } 40 | 41 | $scope.deleteRole = function(){ 42 | $scope.role.delete($scope.thisrole) 43 | .then(function(thisrole){ 44 | $state.go('admin.role'); 45 | }); 46 | } 47 | 48 | }) 49 | .controller( 'AdminRolesNewCtrl', function AdminRolesViewController( $scope, $stateParams, DS, Api ) { 50 | 51 | $scope.role = new Api('role', { 52 | isNew: true 53 | }); 54 | $scope.thisrole = $scope.role.selected; 55 | //$scope.role.read($stateParams.id); 56 | //DS.bindOne('role', $stateParams.id, $scope, 'thisrole'); 57 | 58 | $scope.role.model = new Api('model', { 59 | criteria: { 60 | name: 'role' 61 | } 62 | }); 63 | 64 | $scope.role.model.search() 65 | .then(function(models){ 66 | $scope.role.model.selected = models[0]; 67 | }); 68 | 69 | $scope.createRole = function(){ 70 | $scope.role.create($scope.thisrole) 71 | .then(function(thisrole){ 72 | $state.go('admin.role.role',{id: thisrole.id}); 73 | }); 74 | } 75 | 76 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/role/view/AdminRoleView.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Wed Sep 09 2015 18:52:30 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminRoleView.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.role.role', { 13 | url: '/view/:id', 14 | ncyBreadcrumb: { 15 | label: '{{ thisrole.name }}' 16 | }, 17 | views: { 18 | "admin@admin": { 19 | controller: 'AdminRolesViewCtrl', 20 | templateUrl: 'app/views/admin/role/view/index.html' 21 | }, 22 | "widgets@admin.role.role": { 23 | templateUrl: 'app/views/admin/role/view/widgets.html' 24 | } 25 | } 26 | }) 27 | .state( 'admin.role.new', { 28 | url: '/new?id', 29 | ncyBreadcrumb: { 30 | label: 'New' 31 | }, 32 | views: { 33 | "admin@admin": { 34 | controller: 'AdminRolesNewCtrl', 35 | templateUrl: 'app/views/admin/role/view/index.html' 36 | }, 37 | "widgets@admin.role.new": { 38 | templateUrl: 'app/views/admin/role/view/widgets.html' 39 | } 40 | } 41 | }) 42 | ; 43 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/role/view/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 | 11 |
12 |

Loading...

13 |
14 | 15 |
16 |

{{ thisrole.name }}

17 |
20 |
21 | 22 |
28 |
29 |
30 |
31 |
32 |
33 | 34 |
35 | 36 |
37 | 38 |
39 | 40 | -------------------------------------------------------------------------------- /assets/app/views/admin/role/view/widgets.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 13 | {{ role.updating | iif : 'Creating...' : 'Create' }} 14 | 15 | 20 | {{ role.updating | iif : 'Updating...' : 'Update' }} 21 | 22 | 27 | {{ role.deleting | iif : 'Deleting...' : 'Delete' }} 28 | 29 | 30 |
31 |

Users: {{ thisrole.name }}

32 | 33 |
34 |

35 | Loading Users... 36 |

37 |
38 | 39 |
40 |

No Users

41 |
42 | 43 | 51 | 52 |
63 |
64 |
65 |
66 |

Routes: {{ thisrole.name }}

67 | 68 |
69 |

70 | Loading Routes... 71 |

72 |
73 | 74 |
75 |

No Routes

76 |
77 |
78 |
-------------------------------------------------------------------------------- /assets/app/views/admin/setting/AdminSetting.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 13:43:23 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminSetting.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminSettingCtrl', function AdminSettingController( $scope, $stateParams, DS, Api) { 11 | 12 | console.log($stateParams); 13 | $scope.settings = new Api('setting', { 14 | limit : $stateParams.limit ? parseInt($stateParams.limit) : 10, 15 | skip : $stateParams.skip ? parseInt($stateParams.skip) : 0, 16 | criteria : $stateParams.criteria ? $stateParams.criteria : null, 17 | page : $stateParams.page ? $stateParams.page : 1, 18 | options: { 19 | bypassCache: true 20 | } 21 | }); 22 | $scope.settings.init().then(function(){ 23 | $scope.settings.options.bypassCache = false; 24 | }); 25 | 26 | 27 | $scope.settings.model = new Api('model', { 28 | criteria: { 29 | name: 'setting' 30 | } 31 | }); 32 | $scope.settings.model.search() 33 | .then(function(models){ 34 | $scope.settings.model.selected = models[0]; 35 | }); 36 | 37 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/setting/AdminSetting.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 13:43:23 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminSetting.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.setting', { 13 | url: '/settings?skip?sort?limit?criteria?page', 14 | reloadOnSearch: false, 15 | ncyBreadcrumb: { 16 | label: 'Settings' 17 | }, 18 | views: { 19 | "admin": { 20 | controller: 'AdminSettingCtrl', 21 | templateUrl: 'app/views/admin/setting/index.html' 22 | } 23 | } 24 | }) 25 | ; 26 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/setting/view/AdminSettingView.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Sep 15 2015 09:04:45 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminSettingView.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminSettingViewCtrl', function AdminSettingViewController( $scope, $state, $stateParams, DS, Api ) { 11 | $scope.setting = new Api('setting'); 12 | $scope.setting.read($stateParams.id); 13 | DS.bindOne('setting', $stateParams.id, $scope, 'thissetting'); 14 | 15 | $scope.setting.model = new Api('model', { 16 | criteria: { 17 | name: 'setting' 18 | } 19 | }); 20 | $scope.setting.model.search() 21 | .then(function(models){ 22 | $scope.setting.model.selected = models[0]; 23 | }); 24 | 25 | $scope.updateSetting = function(){ 26 | console.log("Clicked"); 27 | $scope.setting.update($scope.thissetting) 28 | .then(function(thissetting){ 29 | 30 | }); 31 | } 32 | $scope.deleteSetting = function(){ 33 | console.log("Clicked"); 34 | $scope.setting.delete($scope.thissetting) 35 | .then(function(thissetting){ 36 | $state.go('admin.setting'); 37 | }); 38 | } 39 | 40 | }) 41 | .controller( 'AdminSettingNewCtrl', function AdminSettingNewController( $scope, $state, DS, Api ) { 42 | 43 | $scope.setting = new Api('setting', { 44 | isNew: true 45 | }); 46 | 47 | $scope.thissetting = $scope.setting.selected; 48 | 49 | $scope.setting.model = new Api('model', { 50 | criteria: { 51 | name: 'setting' 52 | } 53 | }); 54 | $scope.setting.model.search() 55 | .then(function(models){ 56 | $scope.setting.model.selected = models[0]; 57 | }); 58 | 59 | $scope.createSetting = function(){ 60 | $scope.setting.create($scope.thissetting) 61 | .then(function(thissetting){ 62 | $state.go('admin.setting.setting',{id: thissetting.id}); 63 | }); 64 | } 65 | 66 | 67 | 68 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/setting/view/AdminSettingView.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Sep 15 2015 09:04:45 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminSettingView.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.setting.setting', { 13 | url: '/view/:id', 14 | ncyBreadcrumb: { 15 | label: '{{ thissetting.title }}' 16 | }, 17 | views: { 18 | "admin@admin": { 19 | controller: 'AdminSettingViewCtrl', 20 | templateUrl: 'app/views/admin/setting/view/index.html' 21 | }, 22 | "widgets@admin.setting.setting": { 23 | templateUrl: 'app/views/admin/setting/view/widgets.html' 24 | } 25 | } 26 | }) 27 | .state( 'admin.setting.new', { 28 | url: '/new?id', 29 | ncyBreadcrumb: { 30 | label: 'New' 31 | }, 32 | views: { 33 | "admin@admin": { 34 | controller: 'AdminSettingNewCtrl', 35 | templateUrl: 'app/views/admin/setting/view/index.html' 36 | }, 37 | "widgets@admin.setting.new": { 38 | templateUrl: 'app/views/admin/setting/view/widgets.html' 39 | } 40 | } 41 | }) 42 | ; 43 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/setting/view/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 |
10 |

11 | {{ thissetting.title || 'New Setting'}} 12 |

13 |

14 | {{ thissetting.description }} 15 |

16 |
17 | 18 |
24 |
25 |
26 |
27 |
28 |
29 | 30 |
31 |
-------------------------------------------------------------------------------- /assets/app/views/admin/setting/view/widgets.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/app/views/admin/user/AdminUser.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 13:11:17 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminUser.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminUserCtrl', function AdminUserController( $scope, $stateParams, DS, Api ) { 11 | 12 | console.log($stateParams); 13 | $scope.users = new Api('user', { 14 | limit : $stateParams.limit ? parseInt($stateParams.limit) : 10, 15 | skip : $stateParams.skip ? parseInt($stateParams.skip) : 0, 16 | criteria : $stateParams.criteria ? $stateParams.criteria : null, 17 | page : $stateParams.page ? $stateParams.page : 1, 18 | options: { 19 | bypassCache: true 20 | } 21 | }); 22 | $scope.users.init().then(function(){ 23 | $scope.users.options.bypassCache = false; 24 | }); 25 | 26 | $scope.users.model = new Api('model', { 27 | criteria: { 28 | name: 'user' 29 | } 30 | }); 31 | $scope.users.model.search() 32 | .then(function(models){ 33 | $scope.users.model.selected = models[0]; 34 | }); 35 | 36 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/user/AdminUser.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Tue Aug 25 2015 13:11:17 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminUser.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.user', { 13 | url: '/users?skip?sort?limit?criteria?page', 14 | reloadOnSearch: false, 15 | ncyBreadcrumb: { 16 | label: 'User Management' 17 | }, 18 | views: { 19 | "admin": { 20 | controller: 'AdminUserCtrl', 21 | templateUrl: 'app/views/admin/user/index.html' 22 | } 23 | } 24 | }) 25 | ; 26 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/user/view/AdminUserView.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Fri Aug 28 2015 17:08:01 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminUserView.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminUserViewCtrl', function AdminUserViewController( $scope, $state, $stateParams, DS, utils, Api) { 11 | 12 | $scope.user = new Api('user',{ 13 | options : { 14 | bypassCache: true, 15 | params: { 16 | populate: 'roles' 17 | } 18 | } 19 | }); 20 | 21 | $scope.thisuser = $scope.user.selected; 22 | 23 | $scope.user.read($stateParams.id); 24 | 25 | $scope.user.Roles = new Api('role', { 26 | limit: 100 27 | }); 28 | $scope.user.Roles.init(); 29 | 30 | $scope.user.Passports = new Api('passport', { 31 | options: { 32 | bypassCache: true, 33 | endpoint: '/user/' + $stateParams.id + '/passports' 34 | } 35 | }); 36 | $scope.user.Passports.init(); 37 | 38 | DS.bindOne('user', $stateParams.id, $scope, 'thisuser'); 39 | 40 | $scope.user.model = new Api('model', { 41 | criteria: { 42 | name: 'user' 43 | } 44 | }); 45 | $scope.user.model.search() 46 | .then(function(models){ 47 | $scope.user.model.selected = models[0]; 48 | }); 49 | 50 | 51 | $scope.updateUser = function(){ 52 | $scope.user.update($scope.thisuser) 53 | .then(function(thisuser){ 54 | 55 | }); 56 | } 57 | 58 | $scope.deleteUser = function(){ 59 | $scope.user.delete($scope.thisuser) 60 | .then(function(thisuser){ 61 | $state.go('admin.user'); 62 | }); 63 | } 64 | 65 | 66 | }) 67 | .controller( 'AdminUserNewCtrl', function AdminUserNewController( $scope, $state, $stateParams, DS, utils, Api) { 68 | 69 | $scope.user = new Api('user', { 70 | isNew: true 71 | }); 72 | 73 | $scope.thisuser = $scope.user.selected; 74 | 75 | $scope.user.Roles = new Api('role', { 76 | limit: 100 77 | }); 78 | $scope.user.Roles.init(); 79 | 80 | $scope.user.model = new Api('model', { 81 | criteria: { 82 | name: 'user' 83 | } 84 | }); 85 | $scope.user.model.search() 86 | .then(function(models){ 87 | $scope.user.model.selected = models[0]; 88 | }); 89 | 90 | $scope.createUser = function(){ 91 | $scope.user.create($scope.thisuser) 92 | .then(function(thisuser){ 93 | $state.go('admin.user.user',{id: thisuser.id}); 94 | }); 95 | } 96 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/user/view/AdminUserView.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Fri Aug 28 2015 17:08:01 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminUserView.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.user.user', { 13 | url: '/view/:id', 14 | ncyBreadcrumb: { 15 | label: '{{ thisuser.username }}' 16 | }, 17 | views: { 18 | "admin@admin": { 19 | controller: 'AdminUserViewCtrl', 20 | templateUrl: 'app/views/admin/user/view/index.html' 21 | }, 22 | "widgets@admin.user.user": { 23 | templateUrl: 'app/views/admin/user/view/widgets.html' 24 | } 25 | } 26 | }) 27 | .state( 'admin.user.new', { 28 | url: '/new?id', 29 | ncyBreadcrumb: { 30 | label: 'New' 31 | }, 32 | views: { 33 | "admin@admin": { 34 | controller: 'AdminUserNewCtrl', 35 | templateUrl: 'app/views/admin/user/view/index.html' 36 | }, 37 | "widgets@admin.user.new": { 38 | templateUrl: 'app/views/admin/user/view/widgets.html' 39 | } 40 | } 41 | }) 42 | ; 43 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/user/view/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
13 |
14 | 15 |

16 | 17 | {{ thisuser.username }} 18 |

19 | 20 |
23 |
24 | 25 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 38 |
39 |
-------------------------------------------------------------------------------- /assets/app/views/admin/user/view/password/AdminUserViewPassword.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Sat Oct 10 2015 11:43:23 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminUserViewPassword.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminUserViewPasswordCtrl', function AdminUserViewPasswordController( $stateParams, $state, $scope, DS, Api ) { 11 | 12 | /* 13 | $scope.user = new Api('user',{ 14 | options : { 15 | bypassCache: true, 16 | params: { 17 | populate: 'passports' 18 | } 19 | } 20 | }); 21 | 22 | $scope.user.read($stateParams.id); 23 | DS.bindOne('user', $stateParams.id, $scope, 'thisuser'); 24 | */ 25 | $scope.createPassword = function(passport){ 26 | 27 | passport.user = $scope.thisuser; 28 | 29 | console.log(passport); 30 | 31 | $scope.passport = new Api('passport',{ 32 | isNew : true, 33 | options: { 34 | baseUrl: '/auth', 35 | endpoint: '/local/adminreset', 36 | cacheResponse: false 37 | } 38 | }); 39 | 40 | $scope.passport.create(passport) 41 | .then(function(thispassport){ 42 | $state.go('admin.user.user', {id: $scope.thisuser.id}); 43 | }); 44 | 45 | } 46 | 47 | $scope.updatePassword = function(passport){ 48 | 49 | passport.user = $scope.thisuser; 50 | console.log(passport); 51 | 52 | $scope.passport = new Api('passport',{ 53 | options: { 54 | baseUrl: '/auth', 55 | endpoint: '/local/adminreset', 56 | cacheResponse: false 57 | } 58 | }); 59 | 60 | $scope.passport.create(passport) 61 | .then(function(thispassport){ 62 | $state.go('admin.user.user', {id: $scope.thisuser.id}); 63 | }); 64 | //console.log(passport); 65 | //$scope.user.Passports 66 | } 67 | 68 | $scope.deletePassport = function(passport){ 69 | $scope.passport = new Api('passport',{ 70 | options: { 71 | baseUrl: '/auth', 72 | endpoint: '/local/disconnect', 73 | cacheResponse: false 74 | } 75 | }); 76 | 77 | $scope.passport.update(passport) 78 | .then(function(thispassport){ 79 | $state.go('admin.user.user', {id: $scope.thisuser.id}); 80 | }); 81 | 82 | } 83 | 84 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/user/view/password/AdminUserViewPassword.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Sat Oct 10 2015 11:43:23 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminUserViewPassword.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.user.user.password', { 13 | url: '/passports', 14 | ncyBreadcrumb: { 15 | label: 'Edit Passports' 16 | }, 17 | views: { 18 | "content@admin.user.user": { 19 | controller: 'AdminUserViewPasswordCtrl', 20 | templateUrl: 'app/views/admin/user/view/password/index.html' 21 | } 22 | } 23 | }); 24 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/user/view/password/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 |

Passports: {{ thisuser.username }}

11 |
15 | 16 |
17 | 18 |
22 | 25 | 31 | 36 |
37 | 38 |
39 | 40 |
41 | 42 | {{ passport.protocol }} 43 | Disconnect {{ passport.protocol }} 44 | 45 |
46 | 47 |
48 |
49 |
53 | 56 | 62 | 67 |
68 |
69 |
70 |
-------------------------------------------------------------------------------- /assets/app/views/admin/user/view/widgets.html: -------------------------------------------------------------------------------- 1 |
2 | 7 | {{ user.updating | iif : 'Creating...' : 'Create' }} 8 | 9 | 14 | {{ user.updating | iif : 'Updating...' : 'Update' }} 15 | 16 | 21 | {{ user.updating | iif : 'Deleting...' : 'Delete' }} 22 | 23 | 24 |

Roles

25 |
26 | 37 |
38 | 39 | Add New Role 40 | 41 | 42 |

Passports

43 |
44 |

45 | 46 |

47 |
48 | 52 | Edit Passports 53 | 54 | 55 |
-------------------------------------------------------------------------------- /assets/app/views/admin/webhook/AdminWebhook.controllers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Mon Sep 28 2015 10:41:40 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminWebhook.controllers', [ 8 | 9 | ]) 10 | .controller( 'AdminWebhookCtrl', function AdminWebhookController( $scope, DS ) { 11 | 12 | 13 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/webhook/AdminWebhook.states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3 | * 4 | * A humpback-view created at Mon Sep 28 2015 10:41:40 GMT-0400 (EDT). 5 | */ 6 | 7 | angular.module( 'humpback.views.AdminWebhook.states', [ 8 | 9 | ]) 10 | .config(function config( $stateProvider, $urlRouterProvider) { 11 | $stateProvider 12 | .state( 'admin.webhook', { 13 | url: '/webhook?skip?sort?limit?criteria?page', 14 | reloadOnSearch: false, 15 | ncyBreadcrumb: { 16 | label: 'Webhook Management' 17 | }, 18 | views: { 19 | "admin": { 20 | controller: 'AdminWebhookCtrl', 21 | templateUrl: 'app/views/admin/webhook/index.html' 22 | } 23 | } 24 | }) 25 | ; 26 | }); -------------------------------------------------------------------------------- /assets/app/views/admin/webhook/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/app/views/home/home.controllers.js: -------------------------------------------------------------------------------- 1 | angular.module( 'humpback.views.home.controllers', [ 2 | 3 | ]) 4 | .controller( 'HomeCtrl', function HomeController( $scope, DS ) { 5 | 6 | 7 | }); 8 | -------------------------------------------------------------------------------- /assets/app/views/home/home.states.js: -------------------------------------------------------------------------------- 1 | angular.module( 'humpback.views.home.states', [ 2 | 3 | ]) 4 | .config(function config( $stateProvider, $urlRouterProvider) { 5 | $stateProvider 6 | .state( 'home', { 7 | url: '^/', 8 | ncyBreadcrumb: { 9 | label: 'One World Lab' 10 | }, 11 | views: { 12 | "main": { 13 | controller: 'HomeCtrl', 14 | templateUrl: 'app/views/home/index.html' 15 | } 16 | } 17 | }) 18 | ; 19 | }); -------------------------------------------------------------------------------- /assets/app/views/home/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 |
14 | Welcome to your new Humpback App 15 |
16 |
17 |
-------------------------------------------------------------------------------- /assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/assets/favicon.ico -------------------------------------------------------------------------------- /assets/humans.txt: -------------------------------------------------------------------------------- 1 | /* TEAM */ 2 | 3 | 4 | Your title: Scott Wyatt. 5 | 6 | 7 | Site: 8 | /* email, link to a contact form, etc. */ 9 | 10 | 11 | Twitter: @scottBwyatt. 12 | 13 | 14 | Location: 15 | /* City, Country. */ 16 | 17 | 18 | /* THANKS */ 19 | 20 | 21 | Name: Cali Style Technologies 22 | 23 | 24 | /* SITE */ 25 | 26 | 27 | Last update: YYYY/MM/DD 28 | 29 | 30 | Standards: HTML5, CSS3 31 | 32 | 33 | Components: Angular 34 | 35 | 36 | Software: Node.js, Sails.js, Humpback -------------------------------------------------------------------------------- /assets/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/assets/images/.gitkeep -------------------------------------------------------------------------------- /assets/images/README.md: -------------------------------------------------------------------------------- 1 | Store images here, they will be copied and transformed into the `assets/img` folder. This is done by SVG toolkit -------------------------------------------------------------------------------- /assets/js/dependencies/humpback.io.js: -------------------------------------------------------------------------------- 1 | io.sails.transports=['websocket']; -------------------------------------------------------------------------------- /assets/robots.txt: -------------------------------------------------------------------------------- 1 | # The robots.txt file is used to control how search engines index your live URLs. 2 | # See http://www.robotstxt.org/wc/norobots.html for more information. 3 | 4 | 5 | 6 | # To prevent search engines from seeing the site altogether, uncomment the next two lines: 7 | # User-Agent: * 8 | # Disallow: / 9 | -------------------------------------------------------------------------------- /assets/scss/_animation.scss: -------------------------------------------------------------------------------- 1 | /* Holds animations */ 2 | $animation-time: 0.3s; 3 | 4 | .fade { 5 | opacity: 0; 6 | -webkit-transition: opacity $animation-time linear; 7 | transition: opacity $animation-time linear; 8 | } 9 | 10 | .fade.in { 11 | opacity: 1; 12 | } 13 | 14 | .loader { 15 | position: absolute; 16 | left: 50%; 17 | top: 50%; 18 | margin-right: -100px; 19 | z-index: 100; 20 | opacity: 1; 21 | -webkit-transition: opacity $animation-time linear; 22 | transition: opacity $animation-time linear; 23 | //-webkit-transition: z-index $animation-time linear; 24 | // transition: z-index $animation-time linear; 25 | } 26 | 27 | .loader.done { 28 | z-index: 0; 29 | opacity: 0; 30 | } -------------------------------------------------------------------------------- /assets/scss/_grid.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * @class 3 | * disconnected 4 | * 5 | * @description 6 | * Class applied to the body when the app is disconnected from the server 7 | * 8 | **/ 9 | .disconnected{ 10 | input, textarea, select{ 11 | background: lighten($warning-color, 20) !important; 12 | cursor: not-allowed; 13 | } 14 | } 15 | /** 16 | * @class 17 | * loading 18 | * 19 | * @description 20 | * Class applied to the body when the app is loading a state 21 | * 22 | **/ 23 | .loading{ 24 | cursor: progress; 25 | } 26 | 27 | /** 28 | * @class 29 | * max-width 30 | * 31 | * @description 32 | * max-width can be added inside page wide grid blocks to make innner divs work like foundations traditional page width 33 | * 34 | **/ 35 | .max-width{ 36 | min-width: 100%; 37 | 38 | @include breakpoint(medium only){ 39 | min-width: 100%; 40 | } 41 | 42 | @include breakpoint(large up){ 43 | max-width: rem-calc(1000); 44 | min-width: rem-calc(1000); 45 | margin: 0 auto; 46 | } 47 | } 48 | 49 | 50 | ul.inline-list-center { 51 | 52 | list-style-type: none; 53 | text-align: center; 54 | margin-left: 0px; 55 | > li { 56 | display: inline-block; 57 | margin-right: -4px; 58 | } 59 | } -------------------------------------------------------------------------------- /assets/scss/_home.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/assets/scss/_home.scss -------------------------------------------------------------------------------- /assets/scss/_layout.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/assets/scss/_layout.scss -------------------------------------------------------------------------------- /assets/scss/_svg.scss: -------------------------------------------------------------------------------- 1 | /* Holds base64 encoded images and svgs */ 2 | -------------------------------------------------------------------------------- /assets/scss/app.scss: -------------------------------------------------------------------------------- 1 | /* CORE PROJECT SCSS */ 2 | @import "settings"; 3 | @import "foundation"; 4 | @import "layout"; 5 | @import "svg"; 6 | @import "animation"; 7 | @import "grid"; 8 | @import "ngtagsinput"; 9 | @import "admin"; 10 | 11 | /* CORE PROJECT SCSS END */ 12 | 13 | /* PROJECT SCSS */ 14 | @import "home"; 15 | /* PROJECT SCSS END */ -------------------------------------------------------------------------------- /assets/templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaliStyle/humpback/5cbd98c36564eee29176e884866c1770c938f601/assets/templates/.gitkeep -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Humpback Core", 3 | "version": "0.0.1", 4 | "homepage": "https://github.com/CaliStyle/humpback", 5 | "authors": [ 6 | "Scott Wyatt " 7 | ], 8 | "description": "Humpback Core bower components", 9 | "main": "app.js", 10 | "moduleType": [ 11 | "globals" 12 | ], 13 | "keywords": [ 14 | "Humpback" 15 | ], 16 | "license": "MIT", 17 | "ignore": [ 18 | "**/.*", 19 | "node_modules", 20 | "bower_components", 21 | "test", 22 | "tests" 23 | ], 24 | "dependencies": { 25 | "angular": "1.4.2", 26 | "angular-animate": "1.4.2", 27 | "angular-breadcrumb": "~0.4.1", 28 | "angular-filter": "~0.5.6", 29 | "angular-lodash": "~0.1.2", 30 | "angular-translate": "~2.7.2", 31 | "angular-translate-loader-static-files": "~2.7.2", 32 | "angular-translate-loader-url": "~2.7.2", 33 | "foundation-apps": "~1.1.0", 34 | "humpback-core-pack": "~0.11.2", 35 | "js-data": "~1.8.0", 36 | "js-data-angular": "~2.4.0", 37 | "lodash": "~3.10.1", 38 | "ng-file-upload": "~10.0.2", 39 | "ng-file-upload-shim": "~10.0.2" 40 | }, 41 | "resolutions": { 42 | "angular": "1.4.2", 43 | "angular-animate": "1.4.2", 44 | "lodash": "3.10.1" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /config/bootstrap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap 3 | * (sails.config.bootstrap) 4 | * 5 | * An asynchronous bootstrap function that runs before your Sails app gets lifted. 6 | * This gives you an opportunity to set up your data model, run jobs, or perform some special logic. 7 | * 8 | * For more information on bootstrapping your app, check out: 9 | * http://sailsjs.org/#/documentation/reference/sails.config/sails.config.bootstrap.html 10 | */ 11 | 12 | module.exports.bootstrap = function(cb) { 13 | 14 | // It's very important to trigger this callback method when you are finished 15 | // with the bootstrap! (otherwise your server will never lift, since it's waiting on the bootstrap) 16 | cb(); 17 | }; 18 | -------------------------------------------------------------------------------- /config/cron.js: -------------------------------------------------------------------------------- 1 | 2 | /************************************************************* 3 | * Humpback takes advantage of cron-cluster and Kue, however 4 | * these require redis. 5 | * While in development you may find it easier to 'fake' redis 6 | * Once you have a real redis connection, remove fake Redis 7 | **************************************************************/ 8 | 9 | //Fake Redis Connection 10 | var redis = require('fakeredis').createClient(6379, '127.0.0.1'); 11 | //Real Redis Connection 12 | /* 13 | var redis = require('redis').createClient(,); 14 | redis.auth('', function() { 15 | sails.log.verbose('Redis client connected'); 16 | }); 17 | */ 18 | 19 | var cron_engine = require('cron-cluster')(redis).CronJob; 20 | 21 | module.exports.cron = cron_engine; -------------------------------------------------------------------------------- /config/env/development.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Development environment settings 3 | * 4 | * This file can include shared settings for a development team, 5 | * such as API keys or remote database passwords. If you're using 6 | * a version control solution for your Sails app, this file will 7 | * be committed to your repository unless you add it to your .gitignore 8 | * file. If your repository will be publicly viewable, don't add 9 | * any private information to this file! 10 | * 11 | */ 12 | 13 | module.exports = { 14 | 15 | /*************************************************************************** 16 | * Set the default database connection for models in the development * 17 | * environment (see config/connections.js and config/models.js ) * 18 | ***************************************************************************/ 19 | 20 | models: { 21 | // connection: 'someMongodbServer' 22 | migrate: 'alter' 23 | }, 24 | 25 | humpback: { 26 | name: 'HUMPBACK DEV', 27 | env: 'development', 28 | host: 'localhost', 29 | livereload: true 30 | }, 31 | 32 | policies: { 33 | UserController: { create: true, register: true } 34 | } 35 | 36 | }; 37 | -------------------------------------------------------------------------------- /config/env/production.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Production environment settings 3 | * 4 | * This file can include shared settings for a production environment, 5 | * such as API keys or remote database passwords. If you're using 6 | * a version control solution for your Sails app, this file will 7 | * be committed to your repository unless you add it to your .gitignore 8 | * file. If your repository will be publicly viewable, don't add 9 | * any private information to this file! 10 | * 11 | */ 12 | 13 | module.exports = { 14 | 15 | /*************************************************************************** 16 | * Set the default database connection for models in the production * 17 | * environment (see config/connections.js and config/models.js ) * 18 | ***************************************************************************/ 19 | 20 | models: { 21 | // connection: 'someMysqlServer' 22 | migrate: 'safe' 23 | }, 24 | 25 | 26 | /*************************************************************************** 27 | * Set the default humpback configuration for production * 28 | * environment (see config/connections.js and config/models.js ) * 29 | ***************************************************************************/ 30 | 31 | humpback: { 32 | name: 'HUMPBACK', 33 | env: 'production', 34 | host: '', 35 | livereload: false 36 | }, 37 | 38 | policies: { 39 | UserController: { create: true, register: true } 40 | } 41 | /*************************************************************************** 42 | * Set the port in the production environment to 80 * 43 | ***************************************************************************/ 44 | 45 | // port: 80, 46 | 47 | /*************************************************************************** 48 | * Set the log level in production environment to "silent" * 49 | ***************************************************************************/ 50 | 51 | // log: { 52 | // level: "silent" 53 | // } 54 | 55 | }; 56 | -------------------------------------------------------------------------------- /config/env/testing.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Test environment settings 3 | * 4 | * This file is for testing. 5 | * This file can include shared settings for a development team, 6 | * such as API keys or remote database passwords. If you're using 7 | * a version control solution for your Sails app, this file will 8 | * be committed to your repository unless you add it to your .gitignore 9 | * file. If your repository will be publicly viewable, don't add 10 | * any private information to this file! 11 | * 12 | */ 13 | 14 | module.exports = { 15 | //Set the port 16 | port: 1337, // Yay for LEET! 17 | 18 | hooks: { 19 | // Run grunt (unless you want to skip it) 20 | //'grunt': true 21 | }, 22 | 23 | //Set the model settigns 24 | models: { 25 | connection: 'localDiskDb', 26 | migrate: 'alter' 27 | }, 28 | 29 | connections: { 30 | localDiskDb: { 31 | adapter: 'sails-disk' 32 | } 33 | }, 34 | 35 | log: { 36 | level: 'error' 37 | }, 38 | 39 | humpback: { 40 | name: 'HUMPBACK TESTING', 41 | env: 'testing', 42 | host: 'localhost', 43 | livereload: false 44 | }, 45 | 46 | policies: { 47 | UserController: { create: true, register: true } 48 | } 49 | } -------------------------------------------------------------------------------- /config/humpback-hook.js: -------------------------------------------------------------------------------- 1 | module.exports['humpback-hook'] = { 2 | _hookTimeout: 200000 3 | } -------------------------------------------------------------------------------- /config/humpback.js: -------------------------------------------------------------------------------- 1 | module.exports.humpback = { 2 | 3 | /*************************************************************************** 4 | * Humpback Name is used for front end console output * 5 | ***************************************************************************/ 6 | name: process.env.HUMPBACK_NAME, 7 | 8 | /*************************************************************************** 9 | * In "Testing Enviorments" Sails runs in "development mode", which may * 10 | * not always be the best idea. When a Mocha test, Grunt Test, Protractor * 11 | * test is running, Humpback will set the enviroment to "testing". * 12 | ***************************************************************************/ 13 | env: process.env.NODE_ENV || process.env.HUMPBACK_ENV, 14 | 15 | 16 | //TODO: Find a Better way to do this other than explicity setting a host. 17 | host: process.env.HUMPBACK_HOST || 'localhost', 18 | 19 | /*************************************************************************** 20 | * Humpback uses livereload to speed up design/development time. When * 21 | * you alter an SCSS, client side JS, or template file, Humpback will * 22 | * re-run the Grunt and then reload the browsers connected * 23 | * * 24 | ***************************************************************************/ 25 | livereload: process.env.HUMPBACK_LIVERELOAD, 26 | 27 | /*************************************************************************** 28 | * Humpback does not preload HTML templates by default, this protects * 29 | * restricted assets, and also speeds up initial loading time of large * 30 | * web apps. * 31 | * * 32 | * If `preload` is true, Humpback will convert all EJS files as html * 33 | * files and then convert them to JS partials using html2js * 34 | ***************************************************************************/ 35 | preload: false, 36 | 37 | /*************************************************************************** 38 | * Humpback has a maintenance mood that persists across all instances * 39 | ***************************************************************************/ 40 | maintenance: false, 41 | 42 | /*************************************************************************** 43 | * Humpback has settings that persists across all instances * 44 | ***************************************************************************/ 45 | settings: [ 46 | 47 | ] 48 | 49 | } -------------------------------------------------------------------------------- /config/kue.js: -------------------------------------------------------------------------------- 1 | 2 | // config/kue.js 3 | 4 | /************************************************************* 5 | * Humpback takes advantage of Kue, however Kue requires redis. 6 | * While in development you may find it easier to 'fake' redis 7 | * Once you have a real redis connection, remove fake Redis 8 | **************************************************************/ 9 | 10 | var fake = require('fakeredis'); 11 | var redis = require('redis'); 12 | 13 | var kue = require('kue') 14 | , kue_engine = kue.createQueue({ 15 | prefix: 'kue', 16 | 17 | //Fake Redis Connection 18 | redis: { 19 | createClientFactory: function(){ 20 | return fake.createClient(6379, '127.0.0.1'); 21 | } 22 | } 23 | /* 24 | //Real Redis Connection 25 | redis: { 26 | port: 6379, //Port of Redis 27 | host: '127.0.0.1' //Host of Redis 28 | auth: 'PASSWORD' //Password for Redis 29 | } 30 | */ 31 | }); 32 | 33 | module.exports.kue = kue_engine; -------------------------------------------------------------------------------- /config/locales/_README.md: -------------------------------------------------------------------------------- 1 | # Internationalization / Localization Settings 2 | 3 | > Also see the official docs on internationalization/localization: 4 | > http://links.sailsjs.org/docs/config/locales 5 | 6 | ## Locales 7 | All locale files live under `config/locales`. Here is where you can add 8 | translations as JSON key-value pairs. The name of the file should match the 9 | language that you are supporting, which allows for automatic language 10 | detection based on request headers. 11 | 12 | Here is an example locale stringfile for the Spanish language 13 | (`config/locales/es.json`): 14 | 15 | ```json 16 | { 17 | "Hello!": "Hola!", 18 | "Hello %s, how are you today?": "¿Hola %s, como estas?", 19 | } 20 | ``` 21 | 22 | ## Usage 23 | Locales can be accessed in controllers/policies through `res.i18n()`, or in 24 | views through the `__(key)` or `i18n(key)` functions. Remember that the keys 25 | are case sensitive and require exact key matches, e.g. 26 | 27 | ```ejs 28 |

<%= __('Welcome to PencilPals!') %>

29 |

<%= i18n('Hello %s, how are you today?', 'Pencil Maven') %>

30 |

<%= i18n('That\'s right-- you can use either i18n() or __()') %>

31 | ``` 32 | 33 | ## Configuration 34 | Localization/internationalization config can be found in `config/i18n.js`, 35 | from where you can set your supported locales. 36 | 37 | # Internationalization of Model Validations 38 | Humpback includes the ability to set i18n model validation messages when 39 | a validation error occurs during a CRUD opperation. 40 | 41 | See [humpback-validation-hook](https://github.com/CaliStyle/humpback-validation-hook) for more information. -------------------------------------------------------------------------------- /config/locales/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "Welcome": "Willkommen", 3 | "A brand new app.": "Eine neue App." 4 | } 5 | -------------------------------------------------------------------------------- /config/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "Welcome": "Welcome", 3 | "A brand new app.": "A brand new app." 4 | } 5 | -------------------------------------------------------------------------------- /config/locales/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "Welcome": "Bienvenido", 3 | "A brand new app.": "Una aplicación de la nueva marca." 4 | } 5 | -------------------------------------------------------------------------------- /config/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Welcome": "Bienvenue", 3 | "A brand new app.": "Une toute nouvelle application." 4 | } 5 | -------------------------------------------------------------------------------- /config/log.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Built-in Log Configuration 3 | * (sails.config.log) 4 | * 5 | * Configure the log level for your app, as well as the transport 6 | * (Underneath the covers, Sails uses Winston for logging, which 7 | * allows for some pretty neat custom transports/adapters for log messages) 8 | * 9 | * For more information on the Sails logger, check out: 10 | * http://sailsjs.org/#/documentation/concepts/Logging 11 | */ 12 | 13 | module.exports.log = { 14 | 15 | /*************************************************************************** 16 | * * 17 | * Valid `level` configs: i.e. the minimum log level to capture with * 18 | * sails.log.*() * 19 | * * 20 | * The order of precedence for log levels from lowest to highest is: * 21 | * silly, verbose, info, debug, warn, error * 22 | * * 23 | * You may also set the level to "silent" to suppress all logs. * 24 | * * 25 | ***************************************************************************/ 26 | 27 | // level: 'info' 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /config/models.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Default model configuration 3 | * (sails.config.models) 4 | * 5 | * Unless you override them, the following properties will be included 6 | * in each of your models. 7 | * 8 | * For more info on Sails models, see: 9 | * http://sailsjs.org/#/documentation/concepts/ORM 10 | */ 11 | 12 | module.exports.models = { 13 | 14 | /*************************************************************************** 15 | * * 16 | * Your app's default connection. i.e. the name of one of your app's * 17 | * connections (see `config/connections.js`) * 18 | * * 19 | ***************************************************************************/ 20 | // connection: 'localDiskDb', 21 | 22 | /*************************************************************************** 23 | * * 24 | * How and whether Sails will attempt to automatically rebuild the * 25 | * tables/collections/etc. in your schema. * 26 | * * 27 | * See http://sailsjs.org/#/documentation/concepts/ORM/model-settings.html * 28 | * * 29 | ***************************************************************************/ 30 | // migrate: 'alter' 31 | 32 | }; 33 | -------------------------------------------------------------------------------- /config/passport.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Passport configuration 3 | * 4 | * This is the configuration for your Passport.js setup and it where you'd 5 | * define the authentication strategies you want your application to employ. 6 | * 7 | * Authentication scopes can be set through the `scope` property. 8 | * 9 | * For more information on the available providers, check out: 10 | * http://passportjs.org/guide/providers/ 11 | */ 12 | 13 | module.exports.passport = { 14 | local: { 15 | strategy: require('passport-local').Strategy 16 | }, 17 | 18 | basic: { 19 | strategy: require('passport-http').BasicStrategy, 20 | protocol: 'basic' 21 | }, 22 | /* 23 | google: { 24 | name: 'Google', 25 | protocol: 'openid', 26 | strategy: require('passport-google').Strategy 27 | } 28 | */ 29 | /* 30 | twitter: { 31 | name: 'Twitter', 32 | protocol: 'oauth', 33 | strategy: require('passport-twitter').Strategy, 34 | options: { 35 | consumerKey: 'your-consumer-key', 36 | consumerSecret: 'your-consumer-secret' 37 | } 38 | }, 39 | */ 40 | /* 41 | github: { 42 | name: 'GitHub', 43 | protocol: 'oauth2', 44 | strategy: require('passport-github').Strategy, 45 | options: { 46 | clientID: 'your-client-id', 47 | clientSecret: 'your-client-secret' 48 | } 49 | }, 50 | */ 51 | /* 52 | facebook: { 53 | name: 'Facebook', 54 | protocol: 'oauth2', 55 | strategy: require('passport-facebook').Strategy, 56 | options: { 57 | clientID: 'your-client-id', 58 | clientSecret: 'your-client-secret' 59 | } 60 | } 61 | 62 | */ 63 | 64 | }; 65 | -------------------------------------------------------------------------------- /config/policies.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Policy Mappings 3 | * (sails.config.policies) 4 | * 5 | * Policies are simple functions which run **before** your controllers. 6 | * You can apply one or more policies to a given controller, or protect 7 | * its actions individually. 8 | * 9 | * Any policy file (e.g. `api/policies/authenticated.js`) can be accessed 10 | * below by its filename, minus the extension, (e.g. "authenticated") 11 | * 12 | * For more information on how policies work, see: 13 | * http://sailsjs.org/#/documentation/concepts/Policies 14 | * 15 | * For more information on configuring policies, check out: 16 | * http://sailsjs.org/#/documentation/reference/sails.config/sails.config.policies.html 17 | */ 18 | 19 | 20 | module.exports.policies = { 21 | 22 | '*': [ 23 | 'ModelPolicy', 24 | 'AuditPolicy', 25 | 'OwnerPolicy', 26 | 'PermissionPolicy', 27 | 'RolePolicy', 28 | 'CriteriaPolicy', 29 | 'RoutePolicy' 30 | ], 31 | AuthController: { 32 | '*': [] 33 | } 34 | 35 | /*************************************************************************** 36 | * * 37 | * Default policy for all controllers and actions (`true` allows public * 38 | * access) * 39 | * * 40 | ***************************************************************************/ 41 | 42 | // '*': true, 43 | 44 | /*************************************************************************** 45 | * * 46 | * Here's an example of mapping some policies to run before a controller * 47 | * and its actions * 48 | * * 49 | ***************************************************************************/ 50 | // RabbitController: { 51 | 52 | // Apply the `false` policy as the default for all of RabbitController's actions 53 | // (`false` prevents all access, which ensures that nothing bad happens to our rabbits) 54 | // '*': false, 55 | 56 | // For the action `nurture`, apply the 'isRabbitMother' policy 57 | // (this overrides `false` above) 58 | // nurture : 'isRabbitMother', 59 | 60 | // Apply the `isNiceToAnimals` AND `hasRabbitFood` policies 61 | // before letting any users feed our rabbits 62 | // feed : ['isNiceToAnimals', 'hasRabbitFood'] 63 | // } 64 | }; 65 | -------------------------------------------------------------------------------- /config/redisevent.js: -------------------------------------------------------------------------------- 1 | // config/redisevent.js 2 | 3 | var fake = require('fakeredis'); 4 | var RedisEvent = require('humpback-redis-event') 5 | /* 6 | var redis = { 7 | port: , 8 | host: '', 9 | auth: '', 10 | options: { 11 | // see https://github.com/mranney/node_redis#rediscreateclient 12 | enable_offline_queue: false, 13 | retry_max_delay: 10000, 14 | max_attempts: 10000, 15 | no_ready_check: true 16 | } 17 | } 18 | */ 19 | 20 | var redis = { 21 | createClientFactory: function(){ 22 | return fake.createClient(6379, '127.0.0.1',{ 23 | enable_offline_queue: false, 24 | retry_max_delay: 10000, 25 | max_attempts: 10000, 26 | no_ready_check: true 27 | }); 28 | } 29 | } 30 | 31 | 32 | //Channels are populated through `api/hooks/redisevent` from the `events` folder 33 | var redisevent_engine = new RedisEvent(['settings','system','email'], { 34 | redis: redis 35 | }); 36 | 37 | module.exports.redisevent = redisevent_engine; -------------------------------------------------------------------------------- /crons/README.md: -------------------------------------------------------------------------------- 1 | #Crons 2 | Add a .js file here to create/subscribe to a cron-cluster job -------------------------------------------------------------------------------- /events/README.md: -------------------------------------------------------------------------------- 1 | #Events 2 | Add a .js file here to create/subscribe to a redis-event channel -------------------------------------------------------------------------------- /events/settings.js: -------------------------------------------------------------------------------- 1 | //events/settings.js 2 | 3 | var ev = sails.config.redisevent; 4 | 5 | ev.pub('settings:test', { 6 | now: new Date(), 7 | from: '' 8 | }); 9 | 10 | ev.on('settings:test', function(data) { 11 | sails.log.verbose("settings grid test", data.now, 'from', data.from); 12 | }); 13 | 14 | ev.on('settings:created', function(data){ 15 | console.log("settings:created", data); 16 | 17 | var setting = data.setting; 18 | if(setting.secure){ 19 | sails.config.humpback.secure[setting.name] = Setting.convertType(setting.type, setting.setting); 20 | }else{ 21 | sails.config.humpback.notsecure[setting.name] = Setting.convertType(setting.type, setting.setting); 22 | } 23 | 24 | }); 25 | 26 | ev.on('settings:update', function(data){ 27 | console.log("settings:update", data); 28 | var setting = data.setting; 29 | 30 | if(setting.secure){ 31 | sails.config.humpback.secure[setting.name] = Setting.convertType(setting.type, setting.setting); 32 | delete sails.config.humpback.notsecure[setting.name]; 33 | }else{ 34 | sails.config.humpback.notsecure[setting.name] = Setting.convertType(setting.type, setting.setting); 35 | delete sails.config.humpback.secure[setting.name]; 36 | } 37 | Setting.updateSetting('name', setting); 38 | 39 | }); 40 | 41 | ev.on('settings:destroy', function(data){ 42 | console.log("settings:destroy", data); 43 | var setting = data.setting; 44 | 45 | delete sails.config.humpback.secure[setting.name]; 46 | delete sails.config.humpback.notsecure[setting.name]; 47 | 48 | Setting.removeSetting('name', setting); 49 | 50 | next(); 51 | 52 | }); 53 | 54 | module.exports.settings = ev; -------------------------------------------------------------------------------- /jobs/README.md: -------------------------------------------------------------------------------- 1 | #Jobs 2 | add a .js file here to create a Kue process handler -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "humpback", 3 | "version": "0.11.2", 4 | "description": "The Humpback Platform, a rapid development starting point", 5 | "keywords": [], 6 | "dependencies": { 7 | "bcryptjs": "^2.1.0", 8 | "bower": "^1.4.1", 9 | "domain": "0.0.1", 10 | "ejs": "~0.8.4", 11 | "fakeredis": "^0.3.4", 12 | "grunt": "0.4.2", 13 | "grunt-contrib-clean": "~0.5.0", 14 | "grunt-contrib-coffee": "~0.10.1", 15 | "grunt-contrib-concat": "~0.3.0", 16 | "grunt-contrib-copy": "~0.5.0", 17 | "grunt-contrib-cssmin": "~0.9.0", 18 | "grunt-contrib-jst": "~0.6.0", 19 | "grunt-contrib-less": "0.11.1", 20 | "grunt-contrib-sass": "^0.9.2", 21 | "grunt-contrib-uglify": "~0.4.0", 22 | "grunt-contrib-watch": "~0.5.3", 23 | "grunt-ejs": "^0.3.0", 24 | "grunt-html2js": "^0.3.3", 25 | "grunt-sails-linker": "~0.9.5", 26 | "grunt-svg-toolkit": "^0.1.1", 27 | "grunt-sync": "~0.0.4", 28 | "humpback-admin-hook": "^0.11.1", 29 | "humpback-cms-hook": "^0.11.2", 30 | "humpback-email-hook": "^0.11.0", 31 | "humpback-gui-hook": "^0.11.1", 32 | "humpback-hook": "^0.11.0", 33 | "humpback-redis-event": "^0.11.0", 34 | "humpback-validation-hook": "^0.11.0", 35 | "include-all": "~0.1.3", 36 | "kue": "^0.9.6", 37 | "lodash": "^3.9.3", 38 | "machine": "^9.1.1", 39 | "passport-http": "^0.3.0", 40 | "passport-local": "^1.0.0", 41 | "rc": "~0.5.0", 42 | "reds": "^0.2.5", 43 | "sails": "^0.11.0", 44 | "sails-disk": "^0.10.7", 45 | "sails-generate-humpback-api": "^0.11.3", 46 | "sails-generate-humpback-controller": "^0.11.1", 47 | "sails-generate-humpback-model": "^0.11.3", 48 | "sails-generate-humpback-view": "^0.11.7", 49 | "sails-hook-blueprint-count": "0.0.3", 50 | "sails-hook-machines": "^1.0.11", 51 | "sails-stripe": "0.0.5" 52 | }, 53 | "devDependencies": { 54 | "grunt-contrib-jshint": "^0.11.1", 55 | "grunt-mocha-test": "^0.12.7", 56 | "jshint-stylish": "^1.0.1", 57 | "mocha": "^2.1.0" 58 | }, 59 | "scripts": { 60 | "start": "node app.js", 61 | "debug": "node debug app.js", 62 | "postinstall": "./node_modules/.bin/bower install", 63 | "pretest": "npm link && npm link sails-hook-validation", 64 | "test": "grunt test" 65 | }, 66 | "main": "app.js", 67 | "repository": { 68 | "type": "git", 69 | "url": "git://github.com/CaliStyle/humpback.git" 70 | }, 71 | "author": "Scott B Wyatt", 72 | "license": "", 73 | "engines": { 74 | "node": ">= 0.10", 75 | "npm": ">= 2.3" 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /tasks/config/clean.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Clean files and folders. 3 | * 4 | * --------------------------------------------------------------- 5 | * 6 | * This grunt task is configured to clean out the contents in the .tmp/public of your 7 | * sails project. 8 | * 9 | * For usage docs see: 10 | * https://github.com/gruntjs/grunt-contrib-clean 11 | */ 12 | module.exports = function(grunt) { 13 | 14 | grunt.config.set('clean' 15 | , { dev: ['.tmp/public/**'] 16 | , build: ['www'] 17 | } 18 | ); 19 | 20 | grunt.loadNpmTasks('grunt-contrib-clean'); 21 | }; 22 | -------------------------------------------------------------------------------- /tasks/config/coffee.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Compile CoffeeScript files to JavaScript. 3 | * 4 | * --------------------------------------------------------------- 5 | * 6 | * Compiles coffeeScript files from `assest/js` into Javascript and places them into 7 | * `.tmp/public/js` directory. 8 | * 9 | * For usage docs see: 10 | * https://github.com/gruntjs/grunt-contrib-coffee 11 | */ 12 | module.exports = function(grunt) { 13 | 14 | grunt.config.set('coffee', { 15 | dev: { 16 | options: { 17 | bare: true, 18 | sourceMap: true, 19 | sourceRoot: './' 20 | }, 21 | files: [{ 22 | expand: true, 23 | cwd: 'assets/js/', 24 | src: ['**/*.coffee'], 25 | dest: '.tmp/public/js/', 26 | ext: '.js' 27 | }, 28 | { 29 | expand: true, 30 | cwd: 'assets/js/', 31 | src: ['**/*.coffee'], 32 | dest: '.tmp/public/js/', 33 | ext: '.js' 34 | }] 35 | } 36 | }); 37 | 38 | grunt.loadNpmTasks('grunt-contrib-coffee'); 39 | }; 40 | -------------------------------------------------------------------------------- /tasks/config/concat.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Concatenate files. 3 | * 4 | * --------------------------------------------------------------- 5 | * 6 | * Concatenates files javascript and css from a defined array. Creates concatenated files in 7 | * .tmp/public/contact directory 8 | * [concat](https://github.com/gruntjs/grunt-contrib-concat) 9 | * 10 | * For usage docs see: 11 | * https://github.com/gruntjs/grunt-contrib-concat 12 | */ 13 | module.exports = function(grunt) { 14 | 15 | grunt.config.set('concat', { 16 | js: { 17 | src: require('../pipeline').jsFilesToInject, 18 | dest: '.tmp/public/concat/production.js' 19 | }, 20 | css: { 21 | src: require('../pipeline').cssFilesToInject, 22 | dest: '.tmp/public/concat/production.css' 23 | } 24 | }); 25 | 26 | grunt.loadNpmTasks('grunt-contrib-concat'); 27 | }; 28 | -------------------------------------------------------------------------------- /tasks/config/copy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copy files and folders. 3 | * 4 | * --------------------------------------------------------------- 5 | * 6 | * # dev task config 7 | * Copies all directories and files, exept coffescript and less fiels, from the sails 8 | * assets folder into the .tmp/public directory. 9 | * 10 | * # build task config 11 | * Copies all directories nd files from the .tmp/public directory into a www directory. 12 | * 13 | * For usage docs see: 14 | * https://github.com/gruntjs/grunt-contrib-copy 15 | */ 16 | module.exports = function(grunt) { 17 | 18 | grunt.config.set('copy', { 19 | dev: { 20 | files: [ 21 | { 22 | expand: true, 23 | cwd: './assets', 24 | src: ['**/*.!(coffee|less)'], 25 | dest: '.tmp/public' 26 | }, 27 | { 28 | expand: true, 29 | cwd: './assets/styles/fonts', 30 | src: ['**/*'], 31 | dest: '.tmp/public/styles/fonts' 32 | }, 33 | { 34 | expand: true, 35 | cwd: './assets/bower_components/foundation-apps/iconic', 36 | src: ['**/*'], 37 | dest: '.tmp/public/assets/img/iconic' 38 | } 39 | ] 40 | }, 41 | build: { 42 | files: [{ 43 | expand: true, 44 | cwd: '.tmp/public', 45 | src: ['**/*'], 46 | dest: 'www' 47 | }] 48 | } 49 | }); 50 | 51 | grunt.loadNpmTasks('grunt-contrib-copy'); 52 | }; 53 | -------------------------------------------------------------------------------- /tasks/config/cssmin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Compress CSS files. 3 | * 4 | * --------------------------------------------------------------- 5 | * 6 | * Minifies css files and places them into .tmp/public/min directory. 7 | * 8 | * For usage docs see: 9 | * https://github.com/gruntjs/grunt-contrib-cssmin 10 | */ 11 | module.exports = function(grunt) { 12 | 13 | grunt.config.set('cssmin', { 14 | dist: { 15 | src: [ '.tmp/public/concat/production.css' ], 16 | dest: '.tmp/public/min/production.min.css' 17 | } 18 | }); 19 | grunt.loadNpmTasks('grunt-contrib-cssmin'); 20 | }; 21 | -------------------------------------------------------------------------------- /tasks/config/ejs.js: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * EJS is a Grunt plugin that takes all of your view files and * 3 | * converts them to HTML files inside of `assets/app/views` folder * 4 | ************************************************************************/ 5 | 6 | module.exports = function(grunt) { 7 | grunt.config.set('ejs', { 8 | humpbackViews: { 9 | src: ['views/**/*.ejs', '!views/**/layout*', '!views/emailTemplates/**/*.ejs'], 10 | dest: 'assets/app', 11 | expand: true, 12 | ext: '.html', 13 | }, 14 | }); 15 | 16 | grunt.loadNpmTasks('grunt-ejs'); 17 | } -------------------------------------------------------------------------------- /tasks/config/html2js.js: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * HTML2JS is a Grunt plugin that takes all of your view files and * 3 | * places them into JavaScript files as strings that are added to * 4 | * AngularJS's template cache. This means that the templates too become * 5 | * part of the initial payload as one JavaScript file. This requires * 6 | * `config/humpback.js` preload to be set to true * 7 | ************************************************************************/ 8 | 9 | var config = require('../../config/humpback').humpback; 10 | var preload = config.preload; 11 | 12 | 13 | module.exports = function(grunt) { 14 | 15 | var actions = { 16 | humpbackViews: { 17 | options: { 18 | base: 'assets/src/app', 19 | // changing the module name here will be set as the angular module name of for the template cache 20 | // So in this case, our code will use 'app-views' as the module name 21 | module: 'humpback.views.templates' 22 | }, 23 | files: { 24 | '.tmp/public/app/views/templates.js': require('../pipeline').templateFilesToInject 25 | } 26 | } 27 | }; 28 | if(!preload){ 29 | actions = { 30 | humpbackViews: {} 31 | }; 32 | } 33 | 34 | grunt.config.set('html2js', actions); 35 | 36 | grunt.loadNpmTasks('grunt-html2js'); 37 | }; -------------------------------------------------------------------------------- /tasks/config/jshint.js: -------------------------------------------------------------------------------- 1 | // tasks/config/jshint.js 2 | // -------------------------------- 3 | // jshint task configuration. 4 | 5 | module.exports = function(grunt) { 6 | 7 | // We use the grunt.config api's set method to configure an 8 | // object to the defined string. In this case the task 9 | // 'jshint' will be configured based on the object below. 10 | 11 | grunt.config.set('jshint', { 12 | jshint: { 13 | options: { 14 | reporter: require('jshint-stylish'), 15 | jshintrc: '.jshintrc' 16 | }, 17 | all: [ 18 | 'Gruntfile.js', 19 | //'index.js', 20 | //'lib/**/*.js', 21 | 'assets/app/**/*.js', 22 | 'api/**/*.js', 23 | 'test/**/*.js' 24 | ] 25 | } 26 | }); 27 | 28 | grunt.loadNpmTasks('grunt-contrib-jshint'); 29 | } -------------------------------------------------------------------------------- /tasks/config/jst.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Precompiles Underscore templates to a `.jst` file. 3 | * 4 | * --------------------------------------------------------------- 5 | * 6 | * (i.e. basically it takes HTML files and turns them into tiny little 7 | * javascript functions that you pass data to and return HTML. This can 8 | * speed up template rendering on the client, and reduce bandwidth usage.) 9 | * 10 | * For usage docs see: 11 | * https://github.com/gruntjs/grunt-contrib-jst 12 | * 13 | */ 14 | 15 | module.exports = function(grunt) { 16 | 17 | var templateFilesToInject = [ 'templates/**/*.html' ]; 18 | 19 | grunt.config.set('jst', { 20 | dev: { 21 | 22 | 23 | // To use other sorts of templates, specify a regexp like the example below: 24 | // options: { 25 | // templateSettings: { 26 | // interpolate: /\{\{(.+?)\}\}/g 27 | // } 28 | // }, 29 | 30 | // Note that the interpolate setting above is simply an example of overwriting lodash's 31 | // default interpolation. If you want to parse templates with the default _.template behavior 32 | // (i.e. using
), there's no need to overwrite `templateSettings.interpolate`. 33 | 34 | files: { 35 | 36 | // e.g. 37 | // 'relative/path/from/gruntfile/to/compiled/template/destination' : ['relative/path/to/sourcefiles/**/*.html'] 38 | '.tmp/public/jst.js': require('../pipeline').templateFilesToInject 39 | } 40 | } 41 | }); 42 | 43 | grunt.loadNpmTasks('grunt-contrib-jst'); 44 | }; 45 | -------------------------------------------------------------------------------- /tasks/config/mochaTest.js: -------------------------------------------------------------------------------- 1 | // tasks/config/mochaTest.js 2 | // -------------------------------- 3 | // mochaTest task configuration. 4 | 5 | module.exports = function(grunt) { 6 | 7 | // We use the grunt.config api's set method to configure an 8 | // object to the defined string. In this case the task 9 | // 'mochaTest' will be configured based on the object below. 10 | 11 | grunt.config.set('mochaTest', { 12 | mochaTest: { 13 | test: { 14 | options: { 15 | reporter: 'spec', 16 | timeout: 20000 17 | }, 18 | src: ['test/**/*.js'] 19 | } 20 | } 21 | }); 22 | 23 | grunt.loadNpmTasks('grunt-mocha-test'); 24 | 25 | } -------------------------------------------------------------------------------- /tasks/config/sass.js: -------------------------------------------------------------------------------- 1 | // tasks/config/sass.js 2 | // -------------------------------- 3 | // sass task configuration. 4 | 5 | module.exports = function(grunt) { 6 | 7 | // We use the grunt.config api's set method to configure an 8 | // object to the defined string. In this case the task 9 | // 'sass' will be configured based on the object below. 10 | 11 | grunt.config.set('sass', { 12 | dev: { 13 | options: { 14 | loadPath: ['./assets/bower_components/foundation-apps/scss'], 15 | style: 'expanded' 16 | }, 17 | files: [{ 18 | expand: true, 19 | cwd: 'assets/scss', 20 | src: ['*.scss'], 21 | dest: '.tmp/public/styles', 22 | ext: '.css' 23 | }] 24 | } 25 | }); 26 | // load npm module for handlebars. 27 | grunt.loadNpmTasks('grunt-contrib-sass'); 28 | }; -------------------------------------------------------------------------------- /tasks/config/svgtoolkit.js: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * svgtoolkit is a Grunt task that stylizes svgs and generates pngs * 3 | ************************************************************************/ 4 | 5 | module.exports = function(grunt) { 6 | 7 | grunt.config.set('svgtoolkit', { 8 | 9 | dev: { 10 | options: { 11 | generatePNGs: false, 12 | //style: '/assets/assets/css/themes/blue.css', 13 | //colorize: '#808000', 14 | debug: true 15 | }, 16 | files: [ 17 | { 18 | expand: true, 19 | cwd: './assets/images/svg', 20 | src: '*.svg', 21 | dest: 'assets/assets/img' 22 | } 23 | ] 24 | } 25 | 26 | }); 27 | 28 | grunt.loadNpmTasks('grunt-svg-toolkit'); 29 | }; -------------------------------------------------------------------------------- /tasks/config/sync.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A grunt task to keep directories in sync. It is very similar to grunt-contrib-copy 3 | * but tries to copy only those files that has actually changed. 4 | * 5 | * --------------------------------------------------------------- 6 | * 7 | * Synchronize files from the `assets` folder to `.tmp/public`, 8 | * smashing anything that's already there. 9 | * 10 | * For usage docs see: 11 | * https://github.com/tomusdrw/grunt-sync 12 | * 13 | */ 14 | module.exports = function(grunt) { 15 | 16 | grunt.config.set('sync', { 17 | dev: { 18 | files: [{ 19 | cwd: './assets', 20 | src: ['**/*.!(coffee)'], 21 | dest: '.tmp/public' 22 | }] 23 | } 24 | }); 25 | 26 | grunt.loadNpmTasks('grunt-sync'); 27 | }; 28 | -------------------------------------------------------------------------------- /tasks/config/uglify.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minify files with UglifyJS. 3 | * 4 | * --------------------------------------------------------------- 5 | * 6 | * Minifies client-side javascript `assets`. 7 | * 8 | * For usage docs see: 9 | * https://github.com/gruntjs/grunt-contrib-uglify 10 | * 11 | */ 12 | module.exports = function(grunt) { 13 | 14 | grunt.config.set('uglify', { 15 | dist: { 16 | src: ['.tmp/public/concat/production.js'], 17 | dest: '.tmp/public/min/production.min.js' 18 | }, 19 | options: { 20 | mangle: false 21 | } 22 | }); 23 | 24 | grunt.loadNpmTasks('grunt-contrib-uglify'); 25 | }; 26 | -------------------------------------------------------------------------------- /tasks/config/watch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Run predefined tasks whenever watched file patterns are added, changed or deleted. 3 | * 4 | * --------------------------------------------------------------- 5 | * 6 | * Watch for changes on 7 | * - files in the `assets` folder 8 | * - the `tasks/pipeline.js` file 9 | * and re-run the appropriate tasks. 10 | * 11 | * For usage docs see: 12 | * https://github.com/gruntjs/grunt-contrib-watch 13 | * 14 | */ 15 | module.exports = function(grunt) { 16 | 17 | grunt.config.set('watch', { 18 | // API files to watch: 19 | api: { 20 | files: [ 21 | 'api/**/*', 22 | '!**/node_modules/**' 23 | ] 24 | }, 25 | // Assets to watch: 26 | assets: { 27 | files: [ 28 | 'assets/**/*', 29 | 'views/**/*', 30 | 'tasks/pipeline.js', 31 | '!**/node_modules/**' 32 | ], 33 | 34 | // When assets are changed: 35 | tasks: [ 36 | 'humpback', 37 | 'syncAssets', 38 | 'linkAssets' 39 | ] 40 | }, 41 | 42 | //Livereload 43 | options: { 44 | livereload: 1338 45 | } 46 | }); 47 | 48 | grunt.loadNpmTasks('grunt-contrib-watch'); 49 | }; 50 | -------------------------------------------------------------------------------- /tasks/register/build.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('build', [ 3 | 'compileAssets', 4 | 'linkAssetsBuild', 5 | 'clean:build', 6 | 'copy:build' 7 | ]); 8 | }; 9 | -------------------------------------------------------------------------------- /tasks/register/buildProd.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('buildProd', [ 3 | 'compileAssets', 4 | 'concat', 5 | 'uglify', 6 | 'cssmin', 7 | 'linkAssetsBuildProd', 8 | 'clean:build', 9 | 'copy:build' 10 | ]); 11 | }; 12 | -------------------------------------------------------------------------------- /tasks/register/compileAssets.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('compileAssets', [ 3 | 'clean:dev', 4 | 'humpback', 5 | 'sass:dev', 6 | 'html2js:humpbackViews', 7 | 'svgtoolkit:dev', 8 | 'copy:dev', 9 | 'coffee:dev' 10 | ]); 11 | }; 12 | -------------------------------------------------------------------------------- /tasks/register/default.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('default',[ 3 | 'compileAssets', 4 | 'linkAssets', 5 | 'watch' 6 | ]); 7 | }; 8 | -------------------------------------------------------------------------------- /tasks/register/humpback.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('humpback', [ 3 | 'sails-linker:humpbackControllers', 4 | 'sails-linker:humpbackModels', 5 | 'sails-linker:humpbackHooks', 6 | 'sails-linker:humpbackPolicies', 7 | 'sails-linker:humpbackDirectives', 8 | 'sails-linker:humpbackFilters', 9 | 'sails-linker:humpbackServices', 10 | 'ejs:humpbackViews', 11 | 'sails-linker:humpbackViews' 12 | ]); 13 | }; -------------------------------------------------------------------------------- /tasks/register/linkAssets.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('linkAssets', [ 3 | 'sails-linker:devJs', 4 | 'sails-linker:devStyles', 5 | 'sails-linker:devTpl', 6 | 'sails-linker:devJsJade', 7 | 'sails-linker:devStylesJade', 8 | 'sails-linker:devTplJade' 9 | ]); 10 | }; 11 | -------------------------------------------------------------------------------- /tasks/register/linkAssetsBuild.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('linkAssetsBuild',[ 3 | 'sails-linker:devJsRelative', 4 | 'sails-linker:devStylesRelative', 5 | 'sails-linker:devTpl', 6 | 'sails-linker:devJsRelativeJade', 7 | 'sails-linker:devStylesRelativeJade', 8 | 'sails-linker:devTplJade' 9 | ]); 10 | }; 11 | -------------------------------------------------------------------------------- /tasks/register/linkAssetsBuildProd.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('linkAssetsBuildProd', [ 3 | 'sails-linker:prodJsRelative', 4 | 'sails-linker:prodStylesRelative', 5 | 'sails-linker:devTpl', 6 | 'sails-linker:prodJsRelativeJade', 7 | 'sails-linker:prodStylesRelativeJade', 8 | 'sails-linker:devTplJade' 9 | ]); 10 | }; 11 | -------------------------------------------------------------------------------- /tasks/register/prod.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('prod', [ 3 | 'compileAssets', 4 | 'concat', 5 | 'uglify', 6 | 'cssmin', 7 | 'sails-linker:prodJs', 8 | 'sails-linker:prodStyles', 9 | 'sails-linker:devTpl', 10 | 'sails-linker:prodJsJade', 11 | 'sails-linker:prodStylesJade', 12 | 'sails-linker:devTplJade' 13 | ]); 14 | }; 15 | -------------------------------------------------------------------------------- /tasks/register/syncAssets.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.registerTask('syncAssets',[ 3 | 'jst:dev', 4 | 'humpback', 5 | 'sass:dev', 6 | 'html2js:humpbackViews', 7 | 'svgtoolkit:dev', 8 | 'sync:dev', 9 | 'coffee:dev' 10 | ]); 11 | }; 12 | -------------------------------------------------------------------------------- /tasks/register/test.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | grunt.registerTask('test', [ 4 | 'jshint', 5 | 'mochaTest' 6 | ]); 7 | } -------------------------------------------------------------------------------- /test/bootstrap.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var sails = require('sails'); 4 | var ConfigOverrides = require('../config/env/testing'); 5 | 6 | describe('Bootstrap tests ::', function() { 7 | 8 | // Before running any tests, attempt to lift Sails 9 | before(function (done) { 10 | 11 | // Hook will timeout in 11 seconds 12 | this.timeout(11000); 13 | 14 | // Attempt to lift sails 15 | sails.lift( ConfigOverrides, function (err, sails) { 16 | if (err) { 17 | return done(err); 18 | } 19 | 20 | //var Client = require('../assets/js/dependencies/sails.io.js'); 21 | //global.io = new Client(require('socket.io-client')); 22 | //io.sails.url = 'http://localhost:1337/'; 23 | 24 | done(null, sails); 25 | 26 | }); 27 | }); 28 | 29 | // After tests are complete, lower Sails 30 | after(function (done) { 31 | 32 | // Lower Sails (if it successfully lifted) 33 | if (sails) { 34 | return sails.lower(done); 35 | } 36 | // Otherwise just return 37 | return done(); 38 | }); 39 | 40 | // Test that Sails can lift with the hook in place 41 | it ('sails does not crash', function() { 42 | return true; 43 | }); 44 | 45 | }); -------------------------------------------------------------------------------- /views/README.md: -------------------------------------------------------------------------------- 1 | ##VIEWS 2 | Views are SPA view states. You should edit the EJS files in this folder, 3 | and not edit the html files in the `app/views/` folder. This allows for the EJS files 4 | to still act like layout views which speeds up initial load time. 5 | 6 | ##Grunt 7 | Views .ejs files are converted to .html and included into the app via a grunt task. 8 | see `tasks/register/humpback.js` They can be all loaded into a single JS HTML template 9 | or loaded by module depending on your Apps size. 10 | 11 | To create a new View use the command 12 | ```sh 13 | $ sails generate humpback-view 14 | ```` 15 | 16 | Example: 17 | ```sh 18 | $ sails generate humpback-view profile/dashboard 19 | ``` -------------------------------------------------------------------------------- /views/admin/cms/categories/view/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 | 11 |
12 |

Loading...

13 |
14 | 15 |
16 |

Category: {{ thiscategory.name }}

17 | 18 | 19 | 25 | 26 |
27 | 28 |
34 |
35 |
36 |
37 |
38 | 39 |
40 | 41 |
42 |
-------------------------------------------------------------------------------- /views/admin/cms/categories/view/widgets.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 56 |
57 |

Pages: {{ thiscategory.name }}

58 | 63 |
64 | 65 |
-------------------------------------------------------------------------------- /views/admin/cms/view/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |

Loading...

12 |
13 | 14 |
15 | 16 | 22 |
25 | Slug: {{ thisroute.slug }} 26 |
27 |
31 | 32 | Parent: 33 | 40 | 41 | 42 |
43 |
46 | Permalink: {{ thisroute.uri }} 47 |
48 | 49 | 53 |
54 |
62 | 63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | 72 | 73 |
74 |
-------------------------------------------------------------------------------- /views/admin/cms/view/widgets.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 | 9 |
10 |

Loading...

11 |
12 | 13 |
14 |
15 |

Publish

16 |

17 | Status {{ thisroute.status || 'Draft' }} 18 |

19 |
20 | Visible 21 | 22 |
23 | 34 |
35 |
36 |

37 | Created {{ thisroute.createdAt | date : 'short' }} 38 |

39 |

40 | Updated {{ thisroute.updatedAt | date : 'short' }} 41 |

42 | 43 | 46 | Move to Trash 47 | 48 | 53 | {{ route.updating | iif : 'Publishing...' : 'Publish' }} 54 | 55 | 56 | 61 | {{ route.updating | iif : 'Publishing...' : 'Publish' }} 62 | 63 | 64 | 65 |

Attributes

66 | 67 | 71 | 72 | 73 | 79 | 80 |

Category

81 |
82 | 93 |
94 | 95 | Add New Category 96 | 97 | 98 |

Featured Image

99 | 105 | 109 |
110 |
-------------------------------------------------------------------------------- /views/admin/dashboard/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 |

Dashboard

11 |
12 |
13 |
14 |
18 | Welcome to Admin 19 |
20 |
21 |

Barnacles

22 |
23 | {{ key }}: {{ value }} 24 |
25 |
26 |
-------------------------------------------------------------------------------- /views/admin/data/view/view/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 | 10 |
11 |

Loading...

12 |
13 | 14 |
17 |
18 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 31 |
-------------------------------------------------------------------------------- /views/admin/data/view/view/widgets.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 |

Loading...

10 |
11 |
12 | 60 | 61 |

Attributes

62 | 63 |

64 | {{ key }} 65 | 66 | {{ value.type }} 67 | Model: {{ value.model }} 68 | {{ value.enum }} 69 | Collection: {{ value.collection }} 70 |

71 |
72 |
-------------------------------------------------------------------------------- /views/admin/data/view/widgets.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 |

Loading...

10 |
11 |
12 | 13 | 17 | New {{ thismodel.name }} 18 | 19 | 20 |

Attributes

21 | 22 |

23 | {{ key }} 24 | 25 | {{ value.type }} 26 | Model: {{ value.model }} 27 | {{ value.enum }} 28 | Collection: {{ value.collection }} 29 |

30 |
31 |
-------------------------------------------------------------------------------- /views/admin/email/view/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
13 |
14 | 15 |

{{ thisemail.email }}

16 | 17 |
20 |
21 | 22 |
28 |
29 |
30 | 31 | 35 |
36 |
44 | 45 |
46 |
47 |
48 |
49 | 50 |
51 |
52 | 53 |
54 |
55 |
56 |
57 | 58 |
59 |
-------------------------------------------------------------------------------- /views/admin/email/view/widgets.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /views/admin/header.ejs: -------------------------------------------------------------------------------- 1 |
2 | Admin Header 3 |
-------------------------------------------------------------------------------- /views/admin/login/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 |
11 |
12 |
18 |

Admin Login

19 |

20 | {{ loginerror.message }} 21 |

22 | 31 | 32 | 40 | 41 | 47 |
48 |
49 |
50 |
51 |
-------------------------------------------------------------------------------- /views/admin/role/view/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 | 11 |
12 |

Loading...

13 |
14 | 15 |
16 |

{{ thisrole.name }}

17 |
20 |
21 | 22 |
28 |
29 |
30 |
31 |
32 |
33 | 34 |
35 | 36 |
37 | 38 |
39 | 40 | -------------------------------------------------------------------------------- /views/admin/setting/view/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 |
8 |
9 |
10 |

11 | {{ thissetting.title || 'New Setting'}} 12 |

13 |

14 | {{ thissetting.description }} 15 |

16 |
17 | 18 |
24 |
25 |
26 |
27 |
28 |
29 | 30 |
31 |
-------------------------------------------------------------------------------- /views/admin/setting/view/widgets.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 | 59 |
-------------------------------------------------------------------------------- /views/admin/user/view/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
13 |
14 | 15 |

16 | 17 | {{ thisuser.username }} 18 |

19 | 20 |
23 |
24 | 25 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | 38 |
39 |
-------------------------------------------------------------------------------- /views/admin/user/view/password/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 |

Passports: {{ thisuser.username }}

11 |
15 | 16 |
17 | 18 |
22 | 25 | 31 | 36 |
37 | 38 |
39 | 40 |
41 | 42 | {{ passport.protocol }} 43 | Disconnect {{ passport.protocol }} 44 | 45 |
46 | 47 |
48 |
49 |
53 | 56 | 62 | 67 |
68 |
69 |
70 |
-------------------------------------------------------------------------------- /views/admin/user/view/widgets.ejs: -------------------------------------------------------------------------------- 1 |
2 | 50 | 51 |

Roles

52 |
53 | 64 |
65 | 66 | Add New Role 67 | 68 | 69 |

Passports

70 |
71 |

72 | 73 |

74 |
75 | 79 | Edit Passports 80 | 81 | 82 |
-------------------------------------------------------------------------------- /views/admin/webhook/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /views/emailTemplates/testEmail/html.ejs: -------------------------------------------------------------------------------- 1 |

Dear <%=recipientName%>,

2 |
3 |

This is a test email from Humpback.

4 |

Love,
<%=senderName%>

-------------------------------------------------------------------------------- /views/home/index.ejs: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |
9 |
10 |
14 | Welcome to your new Humpback App 15 |
16 |
17 |
--------------------------------------------------------------------------------