PLD: consolidate URL generation to helper function and us in views and t...

...emplates