mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 01:25:42 -05:00
Contact button opens Intercom for teachers
This commit is contained in:
parent
f1b1cdbdcc
commit
062990851a
8 changed files with 18 additions and 7 deletions
|
@ -130,7 +130,7 @@ mixin accountLinks
|
||||||
li
|
li
|
||||||
strong(data-i18n="nav.support")
|
strong(data-i18n="nav.support")
|
||||||
li
|
li
|
||||||
a(tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact")
|
a.contact-modal(tabindex=-1, data-i18n="nav.contact")
|
||||||
li
|
li
|
||||||
a(href="https://www.facebook.com/codecombat", data-i18n="nav.facebook")
|
a(href="https://www.facebook.com/codecombat", data-i18n="nav.facebook")
|
||||||
li
|
li
|
||||||
|
|
|
@ -63,7 +63,7 @@ block footer
|
||||||
|
|
||||||
#footer-links
|
#footer-links
|
||||||
a(href="/about", data-i18n="nav.about")
|
a(href="/about", data-i18n="nav.about")
|
||||||
a(tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact")
|
a.contact-modal(tabindex=-1, data-i18n="nav.contact")
|
||||||
a(href='http://blog.codecombat.com/', data-i18n="nav.blog")
|
a(href='http://blog.codecombat.com/', data-i18n="nav.blog")
|
||||||
a(href='https://jobs.lever.co/codecombat', tabindex=-1, data-i18n="nav.careers")
|
a(href='https://jobs.lever.co/codecombat', tabindex=-1, data-i18n="nav.careers")
|
||||||
a(href='/legal', tabindex=-1, data-i18n="nav.legal")
|
a(href='/legal', tabindex=-1, data-i18n="nav.legal")
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
li
|
li
|
||||||
a(href=view.forumLink(), data-i18n="nav.forum")
|
a(href=view.forumLink(), data-i18n="nav.forum")
|
||||||
li
|
li
|
||||||
a(tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact")
|
a.contact-modal(tabindex=-1, data-i18n="nav.contact")
|
||||||
li
|
li
|
||||||
a(href='/community', data-i18n="nav.community")
|
a(href='/community', data-i18n="nav.community")
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ block header
|
||||||
li
|
li
|
||||||
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum", target="_blank") Forum
|
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum", target="_blank") Forum
|
||||||
li
|
li
|
||||||
a(data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Email
|
a.contact-modal(data-i18n="nav.contact")
|
||||||
|
|
||||||
block outer_content
|
block outer_content
|
||||||
.outer-content
|
.outer-content
|
||||||
|
|
|
@ -71,7 +71,7 @@ block header
|
||||||
li
|
li
|
||||||
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum", target="_blank") Forum
|
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum", target="_blank") Forum
|
||||||
li
|
li
|
||||||
a(data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Email
|
a.contact-modal(data-i18n="nav.contact")
|
||||||
|
|
||||||
block outer_content
|
block outer_content
|
||||||
.outer-content
|
.outer-content
|
||||||
|
|
|
@ -37,7 +37,7 @@ block header
|
||||||
li
|
li
|
||||||
a(href='http://discourse.codecombat.com/category/diplomat', data-i18n="nav.forum", target="_blank") Forum
|
a(href='http://discourse.codecombat.com/category/diplomat', data-i18n="nav.forum", target="_blank") Forum
|
||||||
li
|
li
|
||||||
a(data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Email
|
a.contact-modal(data-i18n="nav.contact")
|
||||||
|
|
||||||
block outer_content
|
block outer_content
|
||||||
.outer-content.container-fluid
|
.outer-content.container-fluid
|
||||||
|
|
|
@ -70,5 +70,5 @@ if view.showAds()
|
||||||
if !me.get('anonymous')
|
if !me.get('anonymous')
|
||||||
#play-footer(class=me.isPremium() ? "premium" : "")
|
#play-footer(class=me.isPremium() ? "premium" : "")
|
||||||
p(class='footer-link-text').picoctf-hide
|
p(class='footer-link-text').picoctf-hide
|
||||||
a.contact-link(title='Send CodeCombat a message', tabindex=-1, data-i18n="nav.contact") Contact
|
a.contact-link(title='Send CodeCombat a message', tabindex=-1, data-i18n="nav.contact")
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ module.exports = class CocoView extends Backbone.View
|
||||||
'click #loading-error .login-btn': 'onClickLoadingErrorLoginButton'
|
'click #loading-error .login-btn': 'onClickLoadingErrorLoginButton'
|
||||||
'click #loading-error #create-account-btn': 'onClickLoadingErrorCreateAccountButton'
|
'click #loading-error #create-account-btn': 'onClickLoadingErrorCreateAccountButton'
|
||||||
'click #loading-error #logout-btn': 'onClickLoadingErrorLogoutButton'
|
'click #loading-error #logout-btn': 'onClickLoadingErrorLogoutButton'
|
||||||
|
'click .contact-modal': 'onClickContactModal'
|
||||||
|
|
||||||
subscriptions: {}
|
subscriptions: {}
|
||||||
shortcuts: {}
|
shortcuts: {}
|
||||||
|
@ -176,6 +177,16 @@ module.exports = class CocoView extends Backbone.View
|
||||||
msg = $.i18n.t 'loading_error.connection_failure', defaultValue: 'Connection failed.'
|
msg = $.i18n.t 'loading_error.connection_failure', defaultValue: 'Connection failed.'
|
||||||
noty text: msg, layout: 'center', type: 'error', killer: true, timeout: 3000
|
noty text: msg, layout: 'center', type: 'error', killer: true, timeout: 3000
|
||||||
|
|
||||||
|
onClickContactModal: (e) ->
|
||||||
|
if me.isTeacher()
|
||||||
|
if application.isProduction()
|
||||||
|
window.Intercom?('show')
|
||||||
|
else
|
||||||
|
alert('Teachers, Intercom widget only available in production.')
|
||||||
|
else
|
||||||
|
ContactModal = require 'views/core/ContactModal'
|
||||||
|
@openModalView(new ContactModal())
|
||||||
|
|
||||||
onClickLoadingErrorLoginButton: (e) ->
|
onClickLoadingErrorLoginButton: (e) ->
|
||||||
e.stopPropagation() # Backbone subviews and superviews will handle this call repeatedly otherwise
|
e.stopPropagation() # Backbone subviews and superviews will handle this call repeatedly otherwise
|
||||||
AuthModal = require 'views/core/AuthModal'
|
AuthModal = require 'views/core/AuthModal'
|
||||||
|
|
Loading…
Reference in a new issue