app.controller('home', ['$scope', '$cookies', '$interval', 'repos', 'deployments', function($scope, $cookies, $interval, repos, deployments) {
	$scope.repos = repos

	$scope.deploy_status_for = function(deploy) {
		classes = ["glyphicon"]

		classes.push(deploy.state)

		switch (deploy.state) {
			case "success":
				classes.push("glyphicon-ok")
				break
			case "pending":
				classes.push("glyphicon-time")
				break
			case "failure":
			case "error":
				classes.push("glyphicon-remove")
				break
			case "unknown":
				classes.push("glyphicon-question-sign")
				break	
		}

		return classes
	}
}])
