
    <g:form controller="taskDetailed">
        <input type="hidden" name="id" value="${taskInstance?.id}" />

        <g:if test="${taskInstance.trash}" >
            <span class="button">
                <g:actionSubmit class="restore" onclick="return confirm('Are you sure?');" value="Restore"/>
            </span>
        </g:if>
        <g:else>

            <g:if test="${taskInstance.taskStatus.id != 3}" >

                <g:if test="${taskInstance.attentionFlag}" >
                    <span class="button"><g:actionSubmit class="flag" value="Clear" action="clearAttentionFlag"/></span>
                </g:if>
                <g:else>
                    <span class="button"><g:actionSubmit class="flag" value="Unresolved" action="setAttentionFlag"/></span>
                    <custom:helpBalloon code="task.status.unresolved" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />

                </g:else>

                <span class="button">
                    <g:if test="${taskInstance.attentionFlag}" >
                        <g:actionSubmit class="complete"
                                                value="Resolved"
                                                onclick="return confirm('${message(code:'task.clear.attention.flag.on.completion.confirm')}');"
                                                action="complete"/>
                    </g:if>
                    <g:else>
                        <g:actionSubmit class="complete" value="Resolved" action="complete"/>
                    </g:else>
                </span>
                <custom:helpBalloon code="task.status.resolved" iconSrc="${resource(plugin:'help-balloons', dir:'images', file:'balloon-icon.gif')}" />


                <g:if test="${taskInstance.approved}" >
                    <span class="button"><g:actionSubmit class="renegeApproval" value="Renege Approval" action="renegeApproval" /></span>
                </g:if>
                <g:else>
                    <span class="button"><g:actionSubmit class="approve" value="Approve" /></span>
                </g:else>

                <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
                <span class="button">
                    <g:actionSubmit class="trash"
                                                onclick="return confirm('${message(code:'task.trash.confirm')}');"
                                                value="Trash" />
                </span>

            </g:if>
            <g:else>
                <span class="button"><g:actionSubmit class="reopen" value="Reopen" /></span>
            </g:else>

        </g:else>
    </g:form>