overleaf/services/web/public/coffee/main/universties-site.coffee
2016-02-01 15:22:22 +00:00

24 lines
633 B
CoffeeScript

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