main page template + controller