Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
improved top menu dropdown content; updated years in license banners
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Vuyka committed Jan 11, 2014
1 parent edc198d commit 6483e85
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 32 deletions.
12 changes: 10 additions & 2 deletions collabjs.web.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ module.exports = function (context) {
context.once('app.init.routes', function (app) {

app.post('/api/auth/login', passport.authenticate('local'), function (req, res) {
res.send({ name: req.user.name });
res.send({
account: req.user.account,
name: req.user.name,
pictureUrl: config.env.avatarServer + '/avatar/' + req.user.pictureId
});
});

app.get('/api/auth/check', function(req, res) {
res.send(req.isAuthenticated() ? { name: req.user.name } : '0');
res.send(req.isAuthenticated() ? {
account: req.user.account,
name: req.user.name,
pictureUrl: config.env.avatarServer + '/avatar/' + req.user.pictureId
} : '0');
});

app.post('/api/auth/logout', function (req, res) {
Expand Down
6 changes: 3 additions & 3 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function (grunt) {
options: {
banner: '/*!\n' +
'* <%= pkg.name %> v<%= pkg.version %>\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
'* Copyright (c) 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
'* License: MIT\n' +
'* http://www.opensource.org/licenses/mit-license.php\n' +
'*/\n'
Expand All @@ -21,7 +21,7 @@ module.exports = function (grunt) {
options: {
banner: '/*!\n' +
'* <%= pkg.name %> v<%= pkg.version %>\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
'* Copyright (c) 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
'* License: MIT\n' +
'* http://www.opensource.org/licenses/mit-license.php\n' +
'*/\n'
Expand All @@ -48,7 +48,7 @@ module.exports = function (grunt) {
mangle: false,
banner: '/*!\n' +
'* <%= pkg.name %> v<%= pkg.version %>\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
'* Copyright (c) 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
'* License: MIT\n' +
'* http://www.opensource.org/licenses/mit-license.php\n' +
'*/\n'
Expand Down
20 changes: 20 additions & 0 deletions public/css/collabjs.css
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,26 @@ a.comments-button {
.menu-actions > li.active {
border-bottom: 1px blue solid;
}
.settings-menu-item {
text-align: center;
margin-top: 15px;
margin-bottom: 15px;
}
.settings-menu-item img.user-avatar {
display: inline-block;
border: 4px solid #fff;
max-width: 100px;
max-height: 100px;
border-radius: 50%;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}
.settings-menu-item .user-account {
display: block;
color: #9EA1AA;
margin-top: 15px;
text-shadow: 0 1px white;
font-size: 16px;
}
/* Login */
.login-box,
.register-box {
Expand Down
23 changes: 23 additions & 0 deletions public/css/collabjs.less
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,29 @@ a.comments-button {
border-bottom: 1px blue solid;
}

.settings-menu-item {
text-align: center;
margin-top: 15px;
margin-bottom: 15px;

img.user-avatar {
display: inline-block;
border: 4px solid #fff;
max-width: 100px;
max-height: 100px;
border-radius: 50%;
box-shadow: 0 1px 3px 0 rgba(0,0,0,0.3);
}

.user-account {
display: block;
color: #9EA1AA;
margin-top: 15px;
text-shadow: 0 1px white;
font-size: 16px;
}
}

/* Login */

.login-box,
Expand Down
4 changes: 2 additions & 2 deletions public/css/collabjs.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/collabjs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions public/js/controllers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* collab.js v0.4.0
* Copyright (c) 2013 Denis Vuyka
* Copyright (c) 2013-2014 Denis Vuyka
* License: MIT
* http://www.opensource.org/licenses/mit-license.php
*/
Expand Down Expand Up @@ -253,8 +253,6 @@ angular.module('collabjs.controllers')
'use strict';

$scope.error = false;
$scope.dismissError = function () { $scope.error = false; };

$scope.username = '';
$scope.password = '';

Expand Down Expand Up @@ -335,6 +333,8 @@ angular.module('collabjs.controllers')
if (user) {
$scope.isAuthenticated = true;
$scope.userName = user.name;
$scope.userPictureUrl = user.pictureUrl;
$scope.userAccount = user.account;

// TODO: optimize (called on every route change)
searchService.getLists().then(
Expand Down Expand Up @@ -528,8 +528,6 @@ angular.module('collabjs.controllers')
'use strict';

$scope.error = false;
$scope.dismissError = function () { $scope.error = false; };

$scope.account = '';
$scope.name = '';
$scope.email = '';
Expand Down
4 changes: 2 additions & 2 deletions public/js/controllers.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/js/controllers/MenuController.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ angular.module('collabjs.controllers')
if (user) {
$scope.isAuthenticated = true;
$scope.userName = user.name;
$scope.userPictureUrl = user.pictureUrl;
$scope.userAccount = user.account;

// TODO: optimize (called on every route change)
searchService.getLists().then(
Expand Down
2 changes: 1 addition & 1 deletion public/js/directives.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* collab.js v0.4.0
* Copyright (c) 2013 Denis Vuyka
* Copyright (c) 2013-2014 Denis Vuyka
* License: MIT
* http://www.opensource.org/licenses/mit-license.php
*/
Expand Down
2 changes: 1 addition & 1 deletion public/js/directives.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/filters.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* collab.js v0.4.0
* Copyright (c) 2013 Denis Vuyka
* Copyright (c) 2013-2014 Denis Vuyka
* License: MIT
* http://www.opensource.org/licenses/mit-license.php
*/
Expand Down
2 changes: 1 addition & 1 deletion public/js/filters.min.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* collab.js v0.4.0
* Copyright (c) 2013 Denis Vuyka
* Copyright (c) 2013-2014 Denis Vuyka
* License: MIT
* http://www.opensource.org/licenses/mit-license.php
*/
Expand Down
3 changes: 1 addition & 2 deletions public/js/services.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* collab.js v0.4.0
* Copyright (c) 2013 Denis Vuyka
* Copyright (c) 2013-2014 Denis Vuyka
* License: MIT
* http://www.opensource.org/licenses/mit-license.php
*/
Expand Down Expand Up @@ -64,7 +64,6 @@ angular.module('collabjs.services')
deferred.resolve(_user);
})
.error(function (data, status) {
// status === 401 (Unauthorized)
_user = false;
deferred.reject(null);
});
Expand Down
2 changes: 1 addition & 1 deletion public/js/services.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion public/js/services/AuthService.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ angular.module('collabjs.services')
deferred.resolve(_user);
})
.error(function (data, status) {
// status === 401 (Unauthorized)
_user = false;
deferred.reject(null);
});
Expand Down
15 changes: 7 additions & 8 deletions views/core/shared/menu.jade
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ div.navbar.navbar-default.navbar-fixed-top(role='navigation', ng-controller='Men
span {{userName}}
b.caret
ul.dropdown-menu
li.settings-menu-item
div
img.user-avatar(ng-src='{{userPictureUrl}}')
span.user-account {{userAccount}}
li.divider
li
a(href='/#/account')
i.fa.fa-user.fa-fw
| &nbsp;Edit profile
li.divider
| &nbsp;Profile
li
a(href='/#/help')
i.fa.fa-flag.fa-fw
| &nbsp;Help
li
a(href='/#/about')
i.fa.fa-question-circle.fa-fw
| &nbsp;About
li.divider
li(ng-controller='LoginController')
a(href='', ng-click='logout()')
i.fa.fa-sign-out.fa-fw
i.fa.fa-power-off.fa-fw
| &nbsp;Logout

ul.nav.navbar-nav.menu-actions.ng-cloak(menubar='active', data-subpaths='true')
Expand Down

0 comments on commit 6483e85

Please sign in to comment.