Update clan analytics

This commit is contained in:
Matt Lott 2015-04-20 14:16:44 -07:00
parent f80a73ae9b
commit 38cdb3d057
2 changed files with 9 additions and 3 deletions

View file

@ -178,7 +178,10 @@ module.exports = class ClanDetailsView extends RootView
onJoinClan: (e) ->
return @openModalView(new AuthModal()) if me.isAnonymous()
return unless @clan.loaded
return @openModalView new SubscribeModal() if @clan.get('type') is 'private' and not me.isPremium()
if @clan.get('type') is 'private' and not me.isPremium()
@openModalView new SubscribeModal()
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'join clan'
return
options =
url: "/db/clan/#{@clanID}/join"
method: 'PUT'

View file

@ -91,9 +91,12 @@ module.exports = class MainAdminView extends RootView
)
onClickCreateClan: (e) ->
return @openModalView(new AuthModal()) if me.isAnonymous()
return @openModalView new AuthModal() if me.isAnonymous()
clanType = if $('.private-clan-checkbox').prop('checked') then 'private' else 'public'
return @openModalView new SubscribeModal() if clanType is 'private' and not me.isPremium()
if clanType is 'private' and not me.isPremium()
@openModalView new SubscribeModal()
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'create clan'
return
if name = $('.create-clan-name').val()
clan = new Clan()
clan.set 'type', clanType