Port javascript + templates from le-new-teambox