created template for locations and added js function to handle locations