2016-02-01 09:33:32 -05:00
|
|
|
define [
|
|
|
|
"base"
|
|
|
|
], (App) ->
|
|
|
|
|
|
|
|
App.controller 'UniverstiesContactController', ($scope, $modal) ->
|
|
|
|
|
|
|
|
$scope.form = {}
|
2016-02-01 10:22:22 -05:00
|
|
|
$scope.sent = false
|
|
|
|
$scope.sending = false
|
2016-02-01 09:33:32 -05:00
|
|
|
$scope.contactUs = ->
|
2016-02-01 10:22:22 -05:00
|
|
|
if !$scope.form.email?
|
|
|
|
console.log "email not set"
|
|
|
|
return
|
|
|
|
$scope.sending = true
|
2016-02-01 09:33:32 -05:00
|
|
|
params =
|
|
|
|
name: $scope.form.name || $scope.form.email
|
|
|
|
email: $scope.form.email
|
2016-02-01 10:22:22 -05:00
|
|
|
labels: $scope.form.source
|
2016-02-01 09:33:32 -05:00
|
|
|
message: "Please contact me with more details"
|
|
|
|
subject: $scope.form.subject
|
2016-02-01 10:22:22 -05:00
|
|
|
about : "#{$scope.form.position || ''} #{$scope.form.university || ''}"
|
2016-02-01 09:33:32 -05:00
|
|
|
|
|
|
|
Groove.createTicket params, (err, json)->
|
2016-02-01 10:22:22 -05:00
|
|
|
$scope.sent = true
|
2016-02-01 10:41:43 -05:00
|
|
|
$scope.$apply()
|