   return yes for mail in getUser().emails when mail.verified is yes; no
 
 # Common Helpers for the Templates
-UI.registerHelper "version", -> "1.1.1"
+UI.registerHelper "version", -> "1.1.2"
 UI.registerHelper "status", -> Meteor.status()
 UI.registerHelper "loading", -> Meteor.loggingIn() or !Meteor.status().connected
 UI.registerHelper "email", ->

    else @render()
  onBeforeAction: ->
    if getUser()
      if not amIValid() then Router.go 'verifyEmail' else Router.go 'home'

Router.map ->
  @route 'home',
    path: '/'
    template: 'homepage'
    action: -> @render 'homepage', to: 'outside'
    onBeforeAction: ->
      # Dispatch user to the right landing page based on his account status
      if getUser()

  @route 'verifyEmail',
    path: '/verify/:token?'
    template: 'verifyEmail'
    action: ->
      if Meteor.status().connected is no
        @render 'reconnect'
      else @render()
    onBeforeAction: ->
      if getUser()
        if amIValid() then Router.go 'home'
      else Router.go 'home'
      # Automatic verification
      if @params.token? and @params.token isnt ""
        @render 'loading'
        Accounts.verifyEmail @params.token, (err) ->
          if err
            errCallback err; Router.go 'verifyEmail', token: @params.token
          else
            showErr type:'success', msg:'Verification complete'
            Router.go 'home'
  @route 'homepage', action: -> @render '404'
  @route '404', path: '*'

# Client Templates

