The deputy prime minister Barnaby Joyce has resigned more than 16 days after news broke of his relationship with a former employee. Here’s how it unfolded