This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*global TemplateDashboard, $*/ | |
| // on close logic | |
| Backbone.View.prototype.close = function(){ | |
| this.remove(); | |
| this.unbind(); | |
| } | |
| window.TemplateDashboard = { | |
| data:{}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def update_myself | |
| @user = current_user | |
| role = Role.find(params[:user][:role_ids]) unless params[:user][:role_ids].nil? | |
| params[:user] = params[:user].except(:role_ids) | |
| if @user.update_attributes(params[:user]) | |
| @user.update_plan(role) unless role.nil? | |
| render :json => {success:true} | |
| else | |
| render :json => {success:false} | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(function(require){ | |
| var runFilters = function(computedFilters){ | |
| var result = _.every(computedFilters,function(filter){ | |
| return filter(); | |
| }); | |
| return result; | |
| }; | |
| var getFilters = function(filters){ | |
| var _ = require('underscore'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(function(require){ | |
| var runFilters = function(filters){ | |
| var _ = require('underscore'); | |
| var computedFilters = getFilters(filters); | |
| var result = _.every(computedFilters,function(filter){ | |
| return filter(); | |
| }); | |
| return result; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var bcrypt = require('bcrypt'), | |
| SALT_WORK_FACTOR = 10, | |
| crypto = require('crypto'), | |
| validate = require('mongoose-validator').validate; | |
| var Schema = new mongoose.Schema({ | |
| name: {type:String,required:true,validate:[validate('len',1,20),validate('regex',/^[A-Za-z ]+$/)]}, | |
| password: {type:String,required:true,validate:[validate('len',6,20)]}, | |
| username: {type:String,required:true,unique:true,index:true,validate:[validate('len',6,20),validate('regex',/^[a-z A-Z][a-zA-Z0-9_\-]+[a-zA-Z0-9]+$/)]}, | |
| email: {type:String,required:true,unique:true,index:true,validate:[validate('isEmail')]}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Folder | |
| | Public | |
| | | Js | |
| | | | app | |
| | | | | views | |
| | | | | | topbar.js | |
| | | | | pages | |
| | | | | | main.js | |
| | | | libs | |
| | | | | backbone.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var app = express(); | |
| var stylus = require('stylus'); | |
| var nib = require('nib'); | |
| var documentspath = 'src/dcouments' | |
| var docpadInstanceConfiguration = {}; | |
| var docpadInstance = require('docpad').createInstance(docpadInstanceConfiguration, function(err,docpadInstance){ | |
| if (err) return console.log(err.stack); | |
| // ... | |
| }); |
NewerOlder