 Handlebars.registerHelper 'timestampDuration', (timestamp) ->
     return '' if not timestamp
     moment.duration(timestamp).humanize()
+
 
 # 1234567890 => 1 Aug 1991 15:00
 Handlebars.registerHelper 'timestampFormatted', (timestamp) ->

Handlebars.registerHelper 'ifEqual', (v1, v2, options) ->
    if v1 is v2 then options.fn @ else options.inverse @

Handlebars.registerHelper 'ifLT', (v1, v2, options) ->
    if v1 < v2 then options.fn @ else options.inverse @

Handlebars.registerHelper 'ifGT', (v1, v2, options) ->
    if v1 > v2 then options.fn @ else options.inverse @

Handlebars.registerHelper 'ifInSubFilter', (needle, haystack, options) ->
    return options.fn @ if haystack is 'all'
    if haystack.indexOf(needle) isnt -1

        options.fn @
    else
        options.inverse @


Handlebars.registerHelper 'rename', (text,  options) ->
    text = text.trim()
    cases =
        'cooling down': 'cooling'
        'load balancer cleanup': 'LB cleanup'

    return cases[text] if cases[text]        
    text


# {{#withLast [1, 2, 3]}}
#     {{! this = 3 }}
