UI: Translate masthead mako code into js