Use path() method to genrate url in view && clean JS code

Fix terms of use paths