       userId: () ->
          Meteor.userId()
 
-   Template.nav.active = (pill) ->
-      return "active" if pill is "#{this}"
+   Template.nav.helpers
+      active: (pill) ->
+         return "active" if pill is "#{this}"
 
    fileTableHelpers =
       owner: () ->


   Template.gallery.helpers fileTableHelpers

   Template.gallery.dataEntries = () ->
      # Reactively populate the table
      this.find({'metadata.thumbOf': {$exists: false}}, {sort:{filename: 1}})

   Template.gallery.thumb = () ->
      "#{this.metadata.thumb}"

   Template.gallery.rendered = () ->
      # This assigns a file drop zone to the "file table"
      this.data.resumable.assignDrop $(".#{myData.root}DropZone")

   Template.fileControls.events
      'click .remove-files': (e, t) ->

         this.find({}).forEach ((d) -> this.remove(d._id)), this

   Template.fileTable.helpers fileTableHelpers

   Template.fileTable.helpers 
      dataEntries: () ->
         # Reactively populate the table
         this.find({}, {sort:{filename: 1}})

   Template.fileTable.events fileTableEvents

