The dynamics of long frontal waves in the shallow-water equations