<form name="ruleForm" class="form-horizontal compliance-form confirm-before-leave" style="overflow:visible" novalidate>
    <div class="control-group required" ng-class="{error:alertEdit.$dirty && (ruleForm.name.$invalid || ruleForm.name.$error.required)}">
        <label class="control-label">
            <span>Name</span>
        </label>

        <div class="controls">
            <input ng-readonly="alertData.ruleid" type="text" name="name" ng-model="ruleData.name" maxlength="100" required>
            <span class="help-block" ng-hide="alertEdit.$dirty && (ruleForm.name.$invalid || ruleForm.name.$error.required)">Unique name for the condition.</span>
            <span class="help-block error" ng-show="alertEdit.$dirty && (ruleForm.name.$invalid || ruleForm.name.$error.required)">You must name the condition.</span>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" >
            <span>Description</span>
        </label>

        <div class="controls">
            <textarea ng-readonly="alertData.ruleid" ng-model="ruleData.description" maxlength="300"></textarea>
            <span class="help-block"></span>
        </div>
    </div>

    <!-- OPTIONS LEVEL 1 -->
    <div class="control-group required">
        <label class="control-label" name="">
            <span>Type</span>
        </label>

        <div class="controls">
            <select
                required
                data-placeholder="Select condition type"
                chozen
                ng-model="ruleData.type"
                watch="DCA.RuleTypes_dropDown"
                ng-options="item.value as item.label for item in DCA.RuleTypes_dropDown"
                disable="ruleData.id"
                >
            </select>
            <span class="help-block"></span>
        </div>
    </div>

    <?php
        // object-dependent views
        $this->load->view('dashboard/partials/rules/policy.php');
        $this->load->view('dashboard/partials/rules/ports.php');
        $this->load->view('dashboard/partials/rules/softwareupdate.php');
        $this->load->view('dashboard/partials/rules/filechanged.php');
        $this->load->view('dashboard/partials/rules/inventory.php');
        $this->load->view('dashboard/partials/rules/custom.php');
    ?>
</form>
<script>
    setTimeout(processPageBeforeLeave, 1000);
</script>
