move jquery into template