Moved javascript from twig to js file