 
   constructor: (@$container, host) ->
     @$element = $(TEMPLATE)
-    title = host.split('.')[0]
-    @$element.find('.task-lights-title').text(title)
-    @insertSorted(@$element, title)
-
-  addCustomClass: (className) ->
-    @$element.addClass(className)
+    @$title = host.split('.')[0]
+    @$element.find('.task-lights-title').text(@$title)
+    @insertSorted(@$element, @$title)
 
   insertSorted: (toInsert, title) ->
     inserted = false

  appendTo: (@$container) ->

  createTask: (host) ->
    new ContainerView(@$container, host)

  getTask: (host) ->
    @tasks[host] ||= @createTask(host)

      else
        'neutral'
      $('<span>').addClass("task-lights-box box-#{status}").appendTo(boxes)
    boxes

  update: (attrs) ->
    $.extend(this, attrs)
    @$element.find('.task-lights-boxes').empty().append(@genBoxes())
    this

  fail: ->
    @$element.addClass('task-failed')

class JobServerRestartTaskView extends LightsTaskView
  constructor: (container, host) ->
    super container, host
    @$element.addClass("task-job-server")
    @statuses = []

  genBoxes: ->
    boxes = document.createDocumentFragment();
    for status in @statuses
      box = $('<span>').addClass("task-lights-box box-#{status[0]}")
      box.attr('title',status[1])
      box.appendTo(boxes)
    for i in [0...(@numLights-@statuses.length)]
      $('<span>').addClass("task-lights-box box-neutral").appendTo(boxes)
    boxes

  addStatus: (status, note) ->
    @statuses.push([status, note])




restartWidget = new ContainersRestartWidget()
