What I would change: don’t use server-side rendering (Jinja). Send the data and the relevant java-script to the client (browser) and let the browser do the rendering. Especially if you want to support mobile devices, this is the way to go. Portrait or landscape mode, smartphone or tablet, different screen sizes and so on are so much easier.
Added bonus: you greatly reduce the load on the server.