
    <g:if test="${!taskRecurringScheduleExits}">
        <br />
        No Recurring Schedule.
        <br />
        <br />
        <g:form controller="taskRecurringScheduleDetailed" >
            <g:hiddenField name="task.id" value="${taskInstance.id}" />

            <div class="buttons">
                <span class="button">
                    <g:actionSubmit value="Add" action="create" class="add" />
                </span>
            </div>

        </g:form>

    </g:if>
    <g:else>

    <div class="dialog">
            <table>
                <tbody>
                    <tr class="prop">
                        <td valign="top" class="name">Recurring Schedule:</td>

                        <td valign="top" class="value">${taskRecurringScheduleInstance.encodeAsHTML()}</td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">Enabled:</td>

                        <td valign="top" class="value">${fieldValue(bean:taskRecurringScheduleInstance, field:'enabled')}</td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">Next Generation Date:</td>

                        <td valign="top" class="value">
                            <g:formatDate date="${taskRecurringScheduleInstance.nextGenerationDate}" format="EEE, dd-MMM-yyyy"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">Generate Ahead:</td>

                        <td valign="top" class="value">
                            ${taskRecurringScheduleInstance?.generateAhead} ${Period.get(1).encodeAsHTML()}
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">Next Target Start Date:</td>

                        <td valign="top" class="value">
                            <g:formatDate date="${taskRecurringScheduleInstance.nextTargetStartDate}" format="EEE, dd-MMM-yyyy"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">Task Duration:</td>

                        <td valign="top" class="value">
                            ${taskRecurringScheduleInstance?.taskDuration} ${taskRecurringScheduleInstance?.taskDurationPeriod}
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">Next Target Completion Date:</td>

                        <td valign="top" class="value">
                            <g:formatDate date="${taskRecurringScheduleInstance.nextTargetCompletionDate}" format="EEE, dd-MMM-yyyy"/>
                        </td>
                    </tr>

                </tbody>
            </table>
        </div>
        <div class="buttons">
            <g:form controller="taskRecurringScheduleDetailed">
                <input type="hidden" name="id" value="${taskRecurringScheduleInstance?.id}" />
                <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
                <span class="button"><g:actionSubmit class="go" value="Show" /></span>
            </g:form>
        </div>

    </g:else>
