Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lymanlai committed Aug 15, 2015
2 parents 00ddb1f + d1ea1ad commit 96a400d
Show file tree
Hide file tree
Showing 350 changed files with 31,117 additions and 4,587 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ npm-debug.log
*.swp
*.swo
client/app/config.js
.env
lyman/
server/public/sampleapps/ionic-client/www/lib
server/public/sampleapps/nodejs-backend/app.json
server/public/sampleapps/nodejs-backend/node_modules
.env
1 change: 1 addition & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client/app/components/hljs/*
10 changes: 8 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
// JASMINE
"describe": false,
"it": false,
"saveAs": false,
"FileReader": false,
"Blob": false,
"before": false,
"beforeEach": false,
"after": false,
Expand All @@ -51,9 +54,12 @@
"_": false,
// sinon
"sinon": false,
// Jquery
"$": false,
// Browser
"document": false,
"console": false
"console": false,
"window": false
},
//relaxing options
"globalstrict": true,
Expand All @@ -62,4 +68,4 @@
"devel": true //'console' is not defined.

//"jasmine": true
}
}
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,23 @@ gulp serve # start client at http://localhost:3000/
exports.users = [{
provider: 'local',
role: 'admin',
name: '15801213126',
password: 'auth4fun',
userId: 'dave',
name: 'dave1',
password: 'dave1',
userId: 'dave1',
active: true
}, {
provider: 'local',
role: 'admin',
name: 'dave2',
password: 'dave2',
userId: 'dave2',
active: true
}, {
provider: 'local',
role: 'root',
name: 'Root',
name: 'root',
userId: 'root',
password: 'auth4fun',
password: 'root',
active: true
}];
```
7 changes: 5 additions & 2 deletions bin/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

'use strict';

var app = require('../server/austack-server');
var app = require('../server/app');

// start sockets for this instance and start server
app.startServer().listen(app.get('port'), app.get('ip'), function serverStarted() {
console.log('austack started server on ip %s on port %d, in %s mode',
console.log('> austack started server on ip %s on port %d, in %s mode',
app.get('ip'), app.get('port'), app.get('env'));
console.log('+ + + + + + + + + + +');
console.log('+ IN CODE, WE TRUST +');
console.log('+ + + + + + + + + + +');
});

// expose app
Expand Down
14 changes: 11 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@
"angular-ui-router": "latest",
"material-design-icons": ">=1.0.1",
"lodash": "~2.4.1",
"angular-material": "0.10.0",
"angular-material": "0.10.1",
"angular-socket-io": "~0.6.0",
"angular-i18n": "~1.3.14",
"angular-moment": "~0.9.0",
"angular-loading-bar": "~0.7.1",
"jQuery": "~2.1.4",
"angular-breadcrumb": "~0.4.0"
"angular-breadcrumb": "~0.4.0",
"angular-timer": "~1.3.3",
"cal-heatmap": "~3.5.2",
"file-saver.js": "~1.20150507.2",
"angular-ui-ace": "bower",
"angular-material-data-table": "~0.8.0",
"angular-drag-and-drop-lists": "~1.2.0",
"animate.css": "~3.3.1",
"geopattern": "~1.2.3",
"ngImgCrop": "~0.3.2"
},
"devDependencies": {
"angular-mocks": ">=1.2.*",
Expand Down
8 changes: 5 additions & 3 deletions client/app/account/account.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<section id="user-content" layout="column" layout-fill flex>
<div ui-view layout="row" layout-fill flex></div>
</section>
<div id="account-content" flex layout="column">
<section flex layout="row" layout-align="center center">
<div ui-view flex layout="column"></div>
</section>
</div>
6 changes: 4 additions & 2 deletions client/app/account/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
angular
.module('austackApp.account', [
'ui.router',
'ngMaterial'
'timer',
'ngMaterial',
'austackApp.account.settings'
])
.config(configAccountRoute);

Expand All @@ -25,7 +27,7 @@
function configAccountRoute($stateProvider) {
var accountState = {
name: 'account',
url: '/acount',
abstract: true,
templateUrl: 'app/account/account.html',
controller: 'AccountController',
controllerAs: 'account'
Expand Down
21 changes: 20 additions & 1 deletion client/app/account/account.scss
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
#account-items-content {}
#account-content {
background-color: $as-primary;
margin-bottom: 8%;
.text-center {
color: #fff;
}
.captcha {
margin-top: 20px;
height: 30px;
cursor: pointer;
}
md-card {
width: 100%;
max-width: 360px;
border-radius: 8px;
.md-button {
min-width: inherit;
}
}
}
37 changes: 3 additions & 34 deletions client/app/account/login/login.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,24 @@
* @param {Service} $state The state service to use
* @returns {Service} {@link austackApp.account.controller:AccountLoginController AccountLoginController}
*/

AccountLoginController.$inject = ['$state', 'Auth', 'Toast'];
/* @ngInject */
function AccountLoginController($state, Auth) {
function AccountLoginController($state, Auth, Toast) {
var vm = this;

// view model bindings
/**
* @ngdoc property
* @name user
* @propertyOf austackApp.account.controller:AccountLoginController
* @description
* The user data to use as login
*
* @returns {User} The user data
*/
vm.user = {};

/**
* @ngdoc property
* @name error
* @propertyOf austackApp.account.controller:AccountLoginController
* @description
* Error flag
* @returns {Boolean} True if there is an error
*/
vm.error = false;

// Login function (documented below)
vm.login = login;

/**
* @ngdoc function
* @name login
* @methodOf austackApp.account.controller:AccountLoginController
* @description
* Function to use as submit for the login form
* @param {form} form The form to fetch the data from
*/
function login(form) {
if (form.$valid) {
Auth.login({
name: vm.user.name,
password: vm.user.password
}).then(function () {
// Logged in, redirect to home
// $location.path('/');
$state.go('dashboard');
}).catch(function (err) {
vm.error = err;
Toast.show('用户名或密码错误');
});
}
}
Expand Down
8 changes: 3 additions & 5 deletions client/app/account/login/login.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<section id="login-content" layout="column" flex layout-align="center center">
<img src="assets/images/logo.png">
<h1 class="text-center">登入 Austack 账户</h1>
<section id="login-content" layout="column" layout-fill layout-align="center center">
<h1 class="text-center">登入 Austack</h1>
<md-card>
<md-card-content>
<p ng-show="login.error" class="md-warn">{{login.error.message}}</p>
<form class="card" name="loginForm" layout="column" layout-fill layout-align="space-between" ng-submit="login.login(loginForm)">
<md-input-container md-is-error="loginForm.name.$error.required && loginForm.name.$dirty">
<label>用户ID / 手机号</label>
Expand All @@ -22,7 +20,7 @@ <h1 class="text-center">登入 Austack 账户</h1>
<md-button class="md-primary md-raised" ng-disabled="!loginForm.$valid" type="submit">登录</md-button>
<div class="md-actions" layout="row" layout-align="space-between center">
<md-button class="md-accent" ui-sref="account.signup">注册</md-button>
<md-button ui-sref="account.resetPassword">重置密码</md-button>
<md-button ui-sref="account.reset">重置密码</md-button>
</div>
</form>
</md-card-content>
Expand Down
9 changes: 4 additions & 5 deletions client/app/account/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,27 @@
.config(configAccountLogin);

// inject configAccountLogin dependencies
configAccountLogin.$inject = ['$stateProvider', 'mainMenuProvider'];
configAccountLogin.$inject = ['$stateProvider'];

/**
* Route configuration function configuring the passed $stateProvider.
* Register the user.login state with the list template for the
* 'login' view paired with the UserMainController as 'login'.
*
* @param {$stateProvider} $stateProvider - The state provider to configure
* @param {mainMenuProvider} mainMenuProvider - The service to pass navigation information to
*/
function configAccountLogin($stateProvider, mainMenuProvider) {
function configAccountLogin($stateProvider) {
// The login state configuration
var loginState = {
name: 'account.login',
url: '^/login',
url: '/login',
authenticate: false,
// role: 'anonymous',
templateUrl: 'app/account/login/login.html',
controller: 'AccountLoginController',
controllerAs: 'login',
ncyBreadcrumb: {
label: 'Login'
skip: true
}
};

Expand Down
7 changes: 1 addition & 6 deletions client/app/account/login/login.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
#login-content {
background-color: #eee;
md-card {
min-width: 360px;
}
}
#login-content {}
2 changes: 1 addition & 1 deletion client/app/account/logout/logout.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
.module('austackApp.account')
.controller('AccountLogoutController', AccountLogoutController);


/**
* @ngdoc function
* @name austackApp.account.provider:AccountLogoutController
Expand All @@ -25,6 +24,7 @@
* @returns {Service} {@link austackApp.account.controller:AccountLogoutController AccountLogoutController}
*/

AccountLogoutController.$inject = 'Auth';
/** @ngInject */
function AccountLogoutController(Auth) {
Auth.logout();
Expand Down
18 changes: 4 additions & 14 deletions client/app/account/logout/logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,28 @@
.config(configAccountLogout);

// inject configAccountLogout dependencies
configAccountLogout.$inject = ['$stateProvider', 'mainMenuProvider'];
configAccountLogout.$inject = ['$stateProvider'];

/**
* Route configuration function configuring the passed $stateProvider.
* Register the user.logout state with the list template for the
* 'logout' view paired with the UserMainController as 'logout'.
*
* @param {$stateProvider} $stateProvider - The state provider to configure
* @param {mainMenuProvider} mainMenuProvider - The service to pass navigation information to
*/
function configAccountLogout($stateProvider, mainMenuProvider) {
function configAccountLogout($stateProvider) {
// The logout state configuration
var logoutState = {
name: 'account.logout',
url: '^/logout',
url: '/logout',
authenticate: false,
role: 'user',
templateUrl: 'app/account/logout/logout.html',
controller: 'AccountLogoutController',
controllerAs: 'logout',
ncyBreadcrumb: {
label: 'Logout'
}
controllerAs: 'logout'
};

$stateProvider.state(logoutState);

// mainMenuProvider.addMenuItem({
// name: 'Logout',
// state: logoutState.name,
// role: logoutState.role
// });
}

})();
23 changes: 14 additions & 9 deletions client/app/account/profile/profile.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@
.module('austackApp.account')
.controller('ProfileController', ProfileController);

ProfileController.$inject = ['$mdDialog'];
ProfileController.$inject = ['$state', '$mdDialog', 'Auth'];

function ProfileController($mdDialog) {
function ProfileController($state, $mdDialog, Auth) {
var vm = this;

vm.hide = function () {
vm.user = Auth.getCurrentUser();
console.log(vm.user);
vm.gotoSettings = gotoSettings;

function gotoSettings() {
$state.go('settings');
$mdDialog.hide();
}

vm.user.avatar = vm.user.avatar || 'assets/images/profile.png';

vm.close = function () {
$mdDialog.hide();
};
vm.cancel = function () {
$mdDialog.cancel();
};
vm.answer = function (answer) {
$mdDialog.hide(answer);
};
}

Expand Down
Loading

0 comments on commit 96a400d

Please sign in to comment.