templates: extract repeating HTML into a widget lib template