Use portal_url for urls in templates and fix indentation