<div class="contentWrapper" id="alertEdit" ng-form="alertEdit">

<?php
    $this->load->view('/partials/alerts/editalertheader.php');
?>

<div><?php $this->load->view('/partials/_notification'); ?></div>

<div class="border-bottom">
<?php
    $this->load->view('/partials/alerts/editalert.php');
?>
</div>

<div class="border-bottom" id="alertRule">
<h3>Condition <p class="margin-left-small help-block inline">Set the condition that will trigger this alert</p></h3>

 	<div class="form-horizontal margin-top">
	 	<div ng-show="rulesList.length" class="control-group">

	 		<div class="controls">
                <select
                    required
                    data-placeholder="{{conditionsPlaceholder}}"
                    chozen
                    conditions="false"
                    ng-model="ruleData"
                    ng-change="alertData.ruleid=ruleData.id;showRuleEdit=true"
                    watch="rulesList"
                    ng-options="rule as rule.name group by rule.type | DCA_ValueToString:'RuleTypes_dropDown' for rule in rulesList track by rule.id"
                    ng-init="conditionsPlaceholder='Select a condition'"
                    >
                </select>
                <div class="margin-top">
                    <span class="help-block inline">Or</span>
                    <a ng-click="alertData.ruleid='';ruleData={};alertData.rule={};showRuleEdit=true;prefillRuleName(alertData.name);" class="margin-left-small createCondition">create new condition</a>
                </div>
	 		</div>
	 	</div>
	</div>

	<div class="unfaded" ng-class="{'faded':!showRuleEdit&&isEmptyObj(ruleData)}">
		<?php
    		$this->load->view('/partials/rules/editrule.php');
		?>
	</div>
</div>

<?php
    $this->load->view('/partials/rules/hostfilter.php');
?>

</div>

<h3>Notifications</h3>
<?php // object-dependent views
    $this->load->view('/partials/notifications.php');
?>


<?php // object-dependent views
    $this->load->view('/partials/alerts/buttonarea.php');
?>
</div>
