Skip to content

Commit

Permalink
Merge pull request #11 from OZ-United/canary
Browse files Browse the repository at this point in the history
Dashboard
  • Loading branch information
janantala committed Oct 27, 2013
2 parents 55dd3db + 90ce463 commit 4bd1557
Show file tree
Hide file tree
Showing 84 changed files with 2,778 additions and 287 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
bower_components

*.log
65 changes: 35 additions & 30 deletions admin/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->


<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="bower_components/bootstrap-sass/bootstrap-2.3.2.min.css">
<link rel="stylesheet" href="/bower_components/bootstrap-sass/bootstrap-2.3.2.min.css">
<link rel="stylesheet" href="/assets/styles/layout.css">

<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/ddupload.css">
<!-- endbuild -->
Expand Down Expand Up @@ -43,12 +46,12 @@

<h4 ng-show="user.name" ng-click="signout()">
<p ng-bind="user.name"></p>
<i class="icon-signout"></i>
<i class="icon-power-off"></i>
<a href="#"><span>Odhlásiť sa</span></a>
</h4>

<h4 ng-hide="user.name">
<i class="icon-signin"></i>
<i class="icon-sign-in"></i>
<a href="#/auth"><span>Prihlásiť sa</span></a>
</h4>

Expand All @@ -67,53 +70,55 @@ <h4 ng-hide="user.name">
</script>

<script src="scripts/config.js"></script>
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="/bower_components/jquery/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script>

<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/bower_components/font-awesome/css/font-awesome.min.css">

<!-- build:js scripts/plugins.js -->
<script src="bower_components/bootstrap-sass/js/bootstrap-affix.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-alert.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-dropdown.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-tooltip.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-modal.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-transition.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-button.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-popover.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-typeahead.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-carousel.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-scrollspy.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-collapse.js"></script>
<script src="bower_components/bootstrap-sass/js/bootstrap-tab.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-affix.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-alert.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-dropdown.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-tooltip.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-modal.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-transition.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-button.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-popover.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-typeahead.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-carousel.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-scrollspy.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-collapse.js"></script>
<script src="/bower_components/bootstrap-sass/js/bootstrap-tab.js"></script>
<!-- endbuild -->

<!-- build:js scripts/modules.js -->
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-route.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular-resource.min.js"></script>
<script src="bower_components/angular-isbn/src/angular-isbn.js"></script>
<script src="bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js"></script>
<script src="/bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js"></script>
<!-- endbuild -->

<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/services/Auth.js"></script>
<script src="scripts/services/Users.js"></script>
<script src="scripts/services/Books.js"></script>
<script src="scripts/services/Rents.js"></script>
<script src="scripts/services/Search.js"></script>

<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/users.js"></script>
<script src="scripts/controllers/books.js"></script>
<script src="scripts/services/Books.js"></script>
<script src="scripts/directives/draganddrop.js"></script>
<script src="scripts/controllers/rents.js"></script>
<script src="scripts/services/Rents.js"></script>
<script src="scripts/controllers/books/bookId.js"></script>
<script src="scripts/controllers/users/userId.js"></script>
<script src="scripts/controllers/rents/rentId.js"></script>
<script src="scripts/directives/infiniteScroll.js"></script>
<script src="scripts/controllers/search.js"></script>
<script src="scripts/services/Search.js"></script>
<script src="scripts/services/Auth.js"></script>
<script src="scripts/controllers/auth.js"></script>

<script src="scripts/directives/draganddrop.js"></script>
<script src="scripts/directives/infiniteScroll.js"></script>

<!-- endbuild -->
</body>
</html>
2 changes: 1 addition & 1 deletion admin/app/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

angular.module('adminApp', ['ngResource', 'ja.isbn', 'ui.bootstrap'])
angular.module('adminApp', ['ngRoute', 'ngResource', 'ja.isbn', 'ui.bootstrap'])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
Expand Down
6 changes: 6 additions & 0 deletions admin/app/scripts/services/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ angular.module('adminApp')

return deferred.promise;
},
getCradentials: function() {
return {
'userId': $rootScope.user.userId,
'hash': $rootScope.user.hash
};
},
getUser: function() {
return $rootScope.user;
},
Expand Down
18 changes: 9 additions & 9 deletions admin/app/scripts/services/Books.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use strict';

angular.module('adminApp')
.factory('Books', function ($resource) {
.factory('Books', function ($resource, Auth) {
return $resource((window.host || '') + '/books/:bookId:action', { }, {
'create' : { method: 'POST', params: { } },
'query' : { method: 'GET', params: { }, isArray: true },
'topRented': { method: 'GET', params: { 'action': 'topRented' }, isArray: true },
'get' : { method: 'GET', params: { bookId: '@bookId' } },
'update' : { method: 'PUT', params: { bookId: '@bookId' } },
'remove' : { method: 'DELETE', params: { bookId: '@bookId' } },
'delete' : { method: 'DELETE', params: { bookId: '@bookId' } },
'rent' : { method: 'POST', params: { bookId: '@bookId', 'action': 'rent'} },
'create' : { method: 'POST', params: { }, headers: Auth.getCradentials() },
'query' : { method: 'GET', params: { }, headers: Auth.getCradentials(), isArray: true },
'topRented': { method: 'GET', params: { 'action': 'topRented' }, headers: Auth.getCradentials(), isArray: true },
'get' : { method: 'GET', params: { bookId: '@bookId' }, headers: Auth.getCradentials() },
'update' : { method: 'PUT', params: { bookId: '@bookId' }, headers: Auth.getCradentials() },
'remove' : { method: 'DELETE', params: { bookId: '@bookId' }, headers: Auth.getCradentials() },
'delete' : { method: 'DELETE', params: { bookId: '@bookId' }, headers: Auth.getCradentials() },
'rent' : { method: 'POST', params: { bookId: '@bookId', 'action': 'rent'}, headers: Auth.getCradentials() },
});
});
15 changes: 8 additions & 7 deletions admin/app/scripts/services/Rents.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use strict';

angular.module('adminApp')
.factory('Rents', function ($resource) {
.factory('Rents', function ($resource, Auth) {
return $resource((window.host || '') + '/rents/:rentId/:action', { rentId: '@rentId' }, {
'create' : { method: 'POST', params: { } },
'update' : { method: 'PUT', params: { } },
'returnBook' : { method: 'POST', params: { action: 'returnBook' } },
'query' : { method: 'GET', params: { }, isArray: true },
'remove' : { method: 'DELETE', params: { } },
'delete' : { method: 'DELETE', params: { } }
'get' : { method: 'GET', params: { }, headers: Auth.getCradentials() },
'create' : { method: 'POST', params: { }, headers: Auth.getCradentials() },
'update' : { method: 'PUT', params: { }, headers: Auth.getCradentials() },
'returnBook' : { method: 'POST', params: { action: 'returnBook' }, headers: Auth.getCradentials() },
'query' : { method: 'GET', params: { }, headers: Auth.getCradentials(), isArray: true },
'remove' : { method: 'DELETE', params: { }, headers: Auth.getCradentials() },
'delete' : { method: 'DELETE', params: { }, headers: Auth.getCradentials() }
});
});
4 changes: 2 additions & 2 deletions admin/app/scripts/services/Search.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

angular.module('adminApp')
.factory('Search', function ($resource) {
.factory('Search', function ($resource, Auth) {
return $resource((window.host || '') + '/search', { q: '@q' }, {
'query' : { method: 'GET', params: { }, isArray: true },
'query' : { method: 'GET', params: { }, headers: Auth.getCradentials(), isArray: true },
});
});
15 changes: 8 additions & 7 deletions admin/app/scripts/services/Users.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use strict';

angular.module('adminApp')
.factory('Users', function ($resource) {
.factory('Users', function ($resource, Auth) {
return $resource((window.host || '') + '/users/:userId', { userId: '@userId' }, {
'create' : { method: 'POST', params: { } },
'query' : { method: 'GET', params: { }, isArray: true },
'update' : { method: 'PUT', params: { } },
'setPassword' : { method: 'PUT', params: { } },
'remove' : { method: 'DELETE', params: { } },
'delete' : { method: 'DELETE', params: { } }
'get' : { method: 'GET', params: { }, headers: Auth.getCradentials() },
'create' : { method: 'POST', params: { }, headers: Auth.getCradentials() },
'query' : { method: 'GET', params: { }, headers: Auth.getCradentials(), isArray: true },
'update' : { method: 'PUT', params: { }, headers: Auth.getCradentials() },
'setPassword' : { method: 'PUT', params: { }, headers: Auth.getCradentials() },
'remove' : { method: 'DELETE', params: { }, headers: Auth.getCradentials() },
'delete' : { method: 'DELETE', params: { }, headers: Auth.getCradentials() }
});
});
73 changes: 73 additions & 0 deletions admin/app/styles/layout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
$iconSpritePath: "../images/glyphicons-halflings.png";
$iconWhiteSpritePath: "../images/glyphicons-halflings-white.png";

@import "bootstrap-sass/lib/_mixins";


* {
@include box-sizing(border-box);
}

html, body {
margin: 20px;
}

body {
background: #fafafa;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #333;
position: relative;
}

.container {
width: 100%;
padding: 5px;
padding-left: 250px;
}

.modal-body {
height: 500px;
}

.nav {
width: 200px;
position: fixed;
}

.nav-link {
display: block;
line-height: 30px;
}

.nav-search {
margin-top: 20px;
}

.nav-logo {
display: block;
width: 100%;
height: 200px;
background: url("../images/logoSmall.png") no-repeat center center;
@include background-size(contain);
}

input.input-field {
height: 30px;
padding: 0 6px;
text-align: left;
font-size: 12px;
@include box-sizing(border-box);
}

input.input-search {
width: 150px;
}

.input-field.ng-invalid:focus {
color: #b94a48;
border-color: #ee5f5b;
&:focus {
border-color: darken(#ee5f5b, 10%);
@include box-shadow(0 0 6px lighten(#ee5f5b, 20%));
}
}
Loading

0 comments on commit 4bd1557

Please sign in to comment.