mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-22 16:20:44 +01:00
ea0245b550
- Complete more UI work - Show events on dashboard & project dashboard - Show list of tasks
25 lines
697 B
JavaScript
25 lines
697 B
JavaScript
define(['controllers/projects/edit'], function () {
|
|
app.registerController('DashboardCtrl', ['$scope', '$http', '$uibModal', function ($scope, $http, $modal) {
|
|
$scope.projects = [];
|
|
|
|
$http.get('/projects').success(function (projects) {
|
|
$scope.projects = projects;
|
|
});
|
|
|
|
$http.get('/events').success(function (events) {
|
|
$scope.events = events;
|
|
});
|
|
|
|
$scope.addProject = function () {
|
|
$modal.open({
|
|
templateUrl: '/tpl/projects/add.html'
|
|
}).result.then(function (project) {
|
|
$http.post('/projects', project)
|
|
.success(function () {
|
|
}).error(function (data, status) {
|
|
swal('Error', 'Could not create project: ' + status, 'error');
|
|
});
|
|
});
|
|
}
|
|
}]);
|
|
}); |