Move product association related javascript into the corresponding template