 # Globals variables.
 # Get the domains definition as globals.
 domains_definition = require('./domains')
-metadaBuilder = require('./metadata_builder').metadataBuilder
+
+metadaBuilder = Fmk.Helpers.metadataBuilder# require('./metadata_builder').metadataBuilder
 
 Handlebars.registerHelper 'pick', (val, options) ->
   return options.hash[val]

  #<span class='glyphicon glyphicon-#{opt.icon}'></span>
    if opt.icon? then "<span class='input-group-addon'><i class='fa fa-#{opt.icon} fa-fw'></i> </span>" else ""
    #if opt.icon? then "<span class='input-group-addon'> <span class='glyphicon glyphicon-#{opt.icon}'></span></span>" else ""
  isAddOnInput = opt.icon? or (opt.isRequired || metadata.required) is true
   #Deal with the label
  label = ()=>
    if not opt.isNoLabel?

      if metadata.format?
        propValue =  metadata.format(propValue)
      if metadata.symbol?
        propValue = propValue + " " + i18n.t(metadata.symbol)
      if dataType is "checkbox"
         iconChecked = if this[property] then "-check" else ""
         return "<i class='fa fa#{iconChecked}-square-o'></i>"
      if dataType is "date" and this[property] isnt ""
        return "<div class='#{metadataClass}'>#{propValue}</div>"
      else return "<div class='#{metadataClass}'>#{_.escape(propValue)}</div>"
    return ""
  html = "<div class='form-group'>
