Simplify the logic for the workflow button footer

This change splits the logic and the presentation, which allows
to remove an ugly conditional in the partial.
Refactor partial to use local vars