Deduplicate code: lists/hosts.phtml VS lists/hosts-compact.phtml

fixes #6541