Script was dependent on variables added by Django. Revert "moved long script form base.html to own file"

This reverts commit 73a568dbac8f995767a128ec73355413b907d36e.
added a few minor things