
<%--@elvariable id="allWorkflows" type="java.util.List<com.agnitas.emm.core.workflow.beans.Workflow>"--%>

<script id="own-workflow-expanding-modal" type="text/x-mustache-template">
    <div class="modal" tabindex="-1">
        <div class="modal-dialog modal-lg modal-dialog-centered">
            <div class="modal-content" data-initializer="own-workflow-expanding-modal">
                <div class="modal-header">
                    <h1 class="modal-title"><mvc:message code="workflow.ownCampaign"/></h1>
                    <button type="button" class="btn-close shadow-none js-confirm-negative" data-bs-dismiss="modal">
                        <span class="sr-only"><mvc:message code="button.Cancel"/></span>
                    </button>
                </div>

                <div class="modal-body">
                    <div>
                        <label class="form-label" for="workflow-select"><mvc:message code="Workflow"/></label>
                        <select id="workflow-select" class="form-control js-select">
                            <c:forEach var="workflow" items="${allWorkflows}">
                                <option value="${workflow.workflowId}">${fn:escapeXml(workflow.shortname)}</option>
                            </c:forEach>
                        </select>
                    </div>
                    <div class="mt-3">
                        <label for="copy-content" class="form-label"><mvc:message code="GWUA.transfer.method"/></label>
                        <select name="copyContent" id="copy-content" class="form-control">
                            <option value="true"><mvc:message code="workflow.ownWorkflow.withContent"/></option>
                            <option value="false"><mvc:message code="workflow.ownWorkflow.onlyWorkflow"/></option>
                        </select>
                    </div>
                </div>

                <div class="modal-footer">
                    <c:choose>
                        <c:when test="${fn:length(allWorkflows) > 0}">
                            <button type="button" class="btn btn-primary flex-grow-1" data-dismiss="modal" data-action="expand-own-workflow">
                                <i class="icon icon-check"></i>
                                <mvc:message code="button.Apply"/>
                            </button>
                        </c:when>
                        <c:otherwise>
                            <button type="button" class="btn btn-primary flex-grow-1 disabled" disabled="disabled">
                                <i class="icon icon-check"></i>
                                <mvc:message code="button.Apply"/>
                            </button>
                        </c:otherwise>
                    </c:choose>
                </div>
            </div>
        </div>
    </div>
</script>
