   @autorun ->
     setTitle()
 
+Template.group.helpers
+  topMessageCount: ->
+    pluralize(Messages.find
+      group: @group
+      root: null
+    .count(), 'root message')
+
 Template.postButtons.helpers
   disableClass: ->
     if canPost @group

          0
      msgs.reverse() if sort.reverse
    msgs
  topMessageCount: ->
    pluralize(Messages.find
      group: @group
      root: null
    .count(), 'root message')

Template.messageShort.onRendered ->
  mathjax()

        else
          console.error "messageNew did not return problem -- not authorized?"

Template.importButtons.events
  'click .importButton': (e, t) ->
    e.preventDefault()
    e.stopPropagation()
    t.find(".importInput[data-format='#{e.target.getAttribute('data-format')}']").click()
  'change .importInput': (e, t) ->
    importFiles e.target.getAttribute('data-format'), t.data.group, e.target.files
    e.target.value = ''
  'dragenter .importButton': (e) ->
    e.preventDefault()
