TASKMAN-18: Improve task edit for Flamingo

This pull request is based on https://github.com/xwiki-contrib/application-task/pull/12 and inspired by https://github.com/xwiki-contrib/application-task/pull/5 from @maximaker.