     input.focus()
     input.select()
 
-Template.contents.showEverything = ->
-    return true if Meteor.userId()?
-    return true if !online
-    return false
+Template.contents.helpers
+    showEverything: ->
+        return true if Meteor.userId()?
+        return true if !online
+        return false
 
 # Classes #
 


# New Assignment Box #

Template.new_assignment_box.sample = ->
    rand = (min, max) -> Math.floor(Math.random() * (max - min + 1) + min)

    types = [
        -> "today"
        -> "tomorrow"
        -> "#{DateOMatic.getMonthName(rand(0, 11))} #{rand(1, 28)}"
        -> "#{DateOMatic.getMonthName(rand(0, 11))} #{rand(1, 28)}, #{new Date().getFullYear()+1}"
        -> "#{DateOMatic.getDowName(rand(0, 6))}"
        -> "#{DateOMatic.getDowName(rand(0, 6)).slice(0, 3)}"
        -> "#{rand(1, 10)} days from now"
    ]
    task = "read chapter #{rand(1, 15)} due #{_.sample(types)()}"
    if Session.equals("class_id", "")
        "#{_(Offline.smart.classes().find().fetch()).chain().pluck(_.shuffle(['name','abbr'])[0]).shuffle().value()[0]} #{task}"
    else
        "#{task}"

# Assignments #


                Offline.save()
        evt.target.value = ""

Template.classes.helpers
    active: ->
        if Session.equals("class_id", this._id)
            "active"
        else
            ""

# Class Editing #

Template.edit_class_modal.helpers
    name: -> Offline.smart.classes().findOne(Session.get("editing_class"))?.name
    abbr: -> Offline.smart.classes().findOne(Session.get("editing_class"))?.abbr
    class_color: -> Offline.smart.classes().findOne(Session.get("editing_class"))?.color
do ->
    ecmHelpers = {}
    for dow, n in (DateOMatic.getDowName(n).toLowerCase() for n in [0..6])
        do (dow, n) ->
            ecmHelpers["#{dow}Checked"] = ->
                if Offline.smart.classes().findOne(Session.get("editing_class"))?.schedule?[n]?.enabled then "checked" else ""
            ecmHelpers["#{dow}Time"] = ->
                Offline.smart.classes().findOne(Session.get("editing_class"))?.schedule?[n]?.time
    Template.edit_class_modal.helpers ecmHelpers

Template.edit_class_modal.events
    "click .delete": ->
