working framework. not happy with groove. Can't set mailbox

This commit is contained in:
Henry Oswald 2016-03-18 12:55:35 +00:00
parent 7e216391b7
commit 882297c353
7 changed files with 106 additions and 41 deletions

View file

@ -0,0 +1,31 @@
script(type='text/ng-template', id='supportModalTemplate')
.modal-header
button.close(
type="button"
data-dismiss="modal"
ng-click="close()"
) ×
h3 Contact Us
.modal-body
span(ng-show="sent == false")
.form-group
label
| Subject
.form-group
input.field.text.medium.span8.form-control(ng-model="form.subject", maxlength='255', tabindex='1', onkeyup='')
label.desc
| Email
.form-group
input.field.text.medium.span8.form-control(ng-model="form.email", type='email', spellcheck='false', value='', maxlength='255', tabindex='2')
label#title12.desc
| Project URL (optional)
.form-group
input.field.text.medium.span8.form-control(ng-model="form.project_url", tabindex='3', onkeyup='')
label.desc
| Message
.form-group
textarea.field.text.medium.span8.form-control(ng-model="form.message",type='text', value='', maxlength='255', tabindex='4', onkeyup='')
.form-group.text-center
input.btn-success.btn.btn-lg(type='submit', ng-disabled="sending", ng-click="contactUs()" value='Get in Touch')
span(ng-show="sent")
p Request Sent, Thank you.

View file

@ -65,10 +65,6 @@ html(itemscope, itemtype='http://schema.org/Product')
window.ab = {};
window.user_id = '#{getLoggedInUserId()}';
//- script.
//- (function() {var s=document.createElement('script'); s.type='text/javascript';s.async=true; s.src=('https:'==document.location.protocol?'https':'http') + '://sharelatex-accounts.groovehq.com/widgets/f5ad3b09-7d99-431b-8af5-c5725e3760ce/ticket.js'; var q = document.getElementsByTagName('script')[0];q.parentNode.insertBefore(s, q);})();
- if (typeof(settings.algolia) != "undefined")
script.
window.sharelatex.algolia = {
@ -86,6 +82,9 @@ html(itemscope, itemtype='http://schema.org/Product')
}
body
div(ng-controller="ContactModal")
a(ng-click="contactUsModal()") contact us
- if(typeof(suppressSystemMessages) == "undefined")
.system-messages(
ng-cloak
@ -131,5 +130,12 @@ html(itemscope, itemtype='http://schema.org/Product')
src=jsPath+'libs/require.js?fingerprint='+fingerprint(jsPath + 'libs/require.js')
)
script(type='text/javascript').
(function() {var s=document.createElement('script'); s.type='text/javascript';s.async=true;
s.src=('https:'==document.location.protocol?'https':'http') + '://sharelatex-accounts.groovehq.com/widgets/f5ad3b09-7d99-431b-8af5-c5725e3760ce/ticket/api.js';
var q = document.getElementsByTagName('script')[0];q.parentNode.insertBefore(s, q);})();
include contact-us-modal

View file

@ -27,7 +27,7 @@ nav.navbar.navbar-default
a.dropdown-toggle(href, dropdown-toggle)
| !{translate(item.text)}
b.caret
ul.dropdown-menu(ng-controller="NavController")
ul.dropdown-menu
each child in item.dropdown
if child.divider
li.divider

View file

@ -24,13 +24,4 @@ define [
client_id: window.user_id
})
App.controller "NavController", ($scope) ->
$scope.toggleGroove = ->
$scope['is-open'] = false
$scope['isOpen'] = false
GrooveWidget.toggle()
return App

View file

@ -15,7 +15,7 @@ define [
"main/annual-upgrade"
"main/register-users"
"main/subscription/group-subscription-invite-controller"
"main/universties-site"
"main/contact-us"
"analytics/AbTestingManager"
"directives/asyncForm"
"directives/stopPropagation"

View file

@ -0,0 +1,63 @@
define [
"base"
], (App) ->
App.controller 'ContactModal', ($scope, $modal) ->
$scope.contactUsModal = () ->
modalInstance = $modal.open(
templateUrl: "supportModalTemplate"
controller: "SupportModalController"
)
App.controller 'SupportModalController', ($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
ticketNumber = Math.floor((1 + Math.random()) * 0x10000).toString(32)
params =
email: $scope.form.email
message: $scope.form.message
subject: $scope.form.subject + " - [#{ticketNumber}]"
about : $scope.form.project_url
Groove.createTicket params, (err, json)->
$scope.sent = true
$scope.$apply()
$scope.close = () ->
$modalInstance.close()
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
ticketNumber = Math.floor((1 + Math.random()) * 0x10000).toString(32)
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 + " - [#{ticketNumber}]"
about : "#{$scope.form.position || ''} #{$scope.form.university || ''}"
to: "support@sharelatex.com"
Groove.createTicket params, (err, json)->
$scope.sent = true
$scope.$apply()

View file

@ -1,26 +0,0 @@
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
ticketNumber = Math.floor((1 + Math.random()) * 0x10000).toString(32)
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 + " - [#{ticketNumber}]"
about : "#{$scope.form.position || ''} #{$scope.form.university || ''}"
Groove.createTicket params, (err, json)->
$scope.sent = true
$scope.$apply()