Added pages for team view. Removed some repeated javascript from leaf templates