Work on admin web interface

This commit is contained in:
nemunaire 2016-01-13 01:22:54 +01:00
parent d635420a9f
commit 181953a9f0
16 changed files with 729 additions and 0 deletions

33
admin/static/js/app.js Normal file
View file

@ -0,0 +1,33 @@
angular.module("FICApp", ["ngRoute", "ngResource"])
.config(function($routeProvider, $locationProvider) {
$routeProvider
.when("/teams", {
controller: "TeamsListController",
templateUrl: "views/team-list.html"
})
.when("/teams/new", {
controller: "TeamNewController",
templateUrl: "views/team-new.html"
});
$locationProvider.html5Mode(true);
})
.run(function($rootScope) {
$rootScope.message = "Hello Angular!";
});
angular.module("FICApp")
.factory("Team", function($resource) {
return $resource("/api/teams/:id", { id: '@id' }, {
'update': { method: "PATCH" }
})
});
angular.module("FICApp")
.controller("TeamsListController", function($scope, Team, $location) {
$scope.teams = Team.query();
$scope.fields = ["id", "name"];
$scope.show = function(id) {
$location.url("/teams/" + id);
};
});