Fix messages on task view page

Fix the flash messages that had a reversed order. Add flash
messaging to publish button. Fixes #597