   allowDrop: (ev)->
     #console.log("allos drop")
     ev.preventDefault()
+
+  displayEmptyBlocks: ->
+    _.each $('.tpl-container'), (container)->
+      empty_message = $(container).find('.mojoMcContainerEmptyMessage')
+      if $(container).find(".tpl-block").length > 0
+        empty_message.hide()
+      else
+        empty_message.show()
 
   drop: (ev)->
     ev.preventDefault()


    @releaseBeforeItem()

  dropBlock: (container, tmpl)->
    #drop on before item or in tpl-container
    if $(".tpl-block.dojoDndItemBefore").length > 0
      container.find(".tpl-block.dojoDndItemBefore").before(tmpl)
    else
      container.find(".tpl-container").append(tmpl)
      container.find('.mojoMcContainerEmptyMessage').hide()

  releaseBeforeItem: ()->
    $(".tpl-block").removeClass("dojoDndItemBefore")

    #ev.target.appendChild(data);
    container = $(ev.currentTarget)

    if @dragged.attr('data-block')
      tmpl = @handleBlock @dragged.data('block')
      @dropBlock(container, tmpl)
