ticket search + refactor js and template + pagination on + fixes