On Ertel's vorticity theorem