moved long script form base.html to own file