Created
June 16, 2014 12:00
-
-
Save pypetey/ead7822c4e5f3b88e2df to your computer and use it in GitHub Desktop.
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
HTML: | |
<div style="padding-left: {{(subItem.level -1) * 25}}px"> | |
<input type="checkbox" name="submissiongroup" ng-change="selectCheckbox(subItem.id)" ng-model="subItem.id" value="subItem.id"/> | |
{{subItem.name}} ({{subItem.submission_count}}) | |
</div> | |
JS: | |
var module = angular.module("submissionDashboard", ['ui.tree', 'ngCookies',]); | |
module.run(function run($http, $cookies) { | |
// For CSRF token compatibility with Django | |
$http.defaults.headers.post['X-CSRFToken'] = $cookies['csrftoken']; | |
}); | |
module.controller("SubmissionTreeController", function($scope, $http) { | |
var update_dashboard = function() { | |
var url = Django.url('submission:active_list_ajax', { | |
site : site | |
}); | |
$http.get(url).success(function(data) { | |
$scope.list = data.results; | |
}); | |
}; | |
update_dashboard(); | |
var timer = setInterval(function() { | |
$scope.$apply(update_dashboard); | |
}, 1000 * 60); | |
$scope.submit = function(item, event) {}; | |
$scope.toggle = function(scope) { | |
scope.toggle(); | |
}; | |
$scope.selected_items = {}; | |
$scope.subItem = {}; | |
$scope.selectCheckbox = function(scope) { | |
}; | |
$scope.toggle = function(scope) { | |
scope.toggle(); | |
}; | |
$scope.assignSubmission = function(scope) { | |
var url = Django.url('submission:assign', { | |
site : site | |
}); | |
$http.post(url, $.param($scope.subItem)).success(function(data) { | |
console.log('hello'); | |
}); | |
}; | |
$scope.sendSMS = function(scope) { | |
}; | |
$scope.getReport = function(scope) { | |
}; | |
$scope.closeTask = function(scope) { | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment