-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from OZ-United/canary
0.1.0-rc.4
- Loading branch information
Showing
32 changed files
with
458 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
angular.module('adminApp') | ||
.controller('ReservationsCtrl', function ($scope, Rents, $location, $routeParams, Auth, reservations) { | ||
|
||
$scope.reservations = reservations; | ||
|
||
$scope.query = function(){ | ||
if (!$scope.mayQuery) { | ||
return false; | ||
} | ||
|
||
var query = {page: $scope.page + 1}; | ||
query = angular.extend(query, $routeParams, {status: 'reserved'}); | ||
console.log(query); | ||
Rents.query(query, | ||
function(reservations){ | ||
if (!reservations.length) { | ||
$scope.mayQuery = false; | ||
} | ||
$scope.reservations = $scope.reservations.concat(reservations); | ||
$scope.page += 1; | ||
}, | ||
function(error){ | ||
|
||
}); | ||
}; | ||
|
||
$scope.page = 1; | ||
$scope.mayQuery = true; | ||
}); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<section> | ||
<h4 class="content-header">Zoznam rezervácií</h4> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Obal</th> | ||
<th>Názov</th> | ||
<th>Autor</th> | ||
<th>Používateľ</th> | ||
<th>Od</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
|
||
<tr ng-repeat="rent in reservations" ng-class="getStyle(rent)"> | ||
<td> | ||
<a ng-href="#/books/{{rent.book.bookId}}" class="btn btn-link"> | ||
<img ng-src="{{rent.book.cover}}" alt="" style="height: 50px; width: auto; line-height: 50px;"></td> | ||
</a> | ||
<td style="line-height: 50px;"><a ng-href="#/books/{{rent.book.bookId}}">{{rent.book.title}}</a></td> | ||
<td style="line-height: 50px;"><a ng-href="#/books?author={{rent.book.author}}">{{rent.book.author}}</a></td> | ||
<td style="line-height: 50px;"><a ng-href="#/users/{{rent.user.userId}}">{{rent.user.name}}</a></td> | ||
<td style="line-height: 50px;"><a ng-href="#/rents/{{rent.rentId}}">{{rent.reservation.reservationDate | date}}</a></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<button class="btn btn-block" ng-click="query()" ng-show="mayQuery"><i class="icon-repeat"></i> Ďalšie</button> | ||
</section> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
describe('Controller: ReservationsCtrl', function () { | ||
|
||
// load the controller's module | ||
beforeEach(module('adminApp')); | ||
|
||
var ReservationsCtrl, | ||
scope; | ||
|
||
// Initialize the controller and a mock scope | ||
beforeEach(inject(function ($controller, $rootScope) { | ||
scope = $rootScope.$new(); | ||
ReservationsCtrl = $controller('ReservationsCtrl', { | ||
$scope: scope | ||
}); | ||
})); | ||
|
||
it('should attach a list of awesomeThings to the scope', function () { | ||
expect(scope.awesomeThings.length).toBe(3); | ||
}); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
angular.module('dashboardApp') | ||
.controller('RegisterCtrl', function ($scope, Auth, $location) { | ||
|
||
$scope.auth = function(user) { | ||
Auth.register(user).then(function(user){ | ||
console.log(user); | ||
$location.path('/'); | ||
}, | ||
function(){ | ||
$scope.error = 'Nepodarilo sa zaregistrovať'; | ||
}); | ||
}; | ||
}); |
This file contains 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
Oops, something went wrong.