<div class='page-header'><h1><tmpl_var name="list_head_txt"></h1></div>
<p><tmpl_var name="list_desc_txt"></p>

<div class="form-group">
	<label for="ca_list" class="col-sm-2 control-label">{tmpl_var name='ca_list_txt'}</label>
	<div class="col-sm-4"><select name="ca_list" id="ca_list" class="form-control">{tmpl_var name='ca_list'}</select></div>
</div>

<div class="wildcard form-group">
	<label class="col-sm-2 control-label">{tmpl_var name='ca_wildcard_txt'}</label>
	<div class="col-sm-4"> <input type="checkbox" id="allow_wildcard" name="allow_wildcard" {tmpl_var name='allow_wildcard'}/></div>
</div>

<!--
For future use.  At this time, CA’s do not recognize any other flag values as described in RFC 6844
<div class="critical form-group">
	<label class="col-sm-2 control-label">{tmpl_var name='ca_critical_txt'}</label>
	<div class="col-sm-4"> <input type="checkbox" id="allow_critical" name="allow_critical" {tmpl_var name='allow_critical'}/></div>
</div>
-->

<div class="form-group">
	<label for="name" class="col-sm-2 control-label">{tmpl_var name='ca_domain_txt'}</label>
	<div class="col-sm-4"><input disabled type="text" name="name" id="name" value="{tmpl_var name='name'}" class="form-control" /></div>
</div>

<div class="form-group">
	<label for="name" class="col-sm-2 control-label">{tmpl_var name='ca_hostname_txt'}</label>
	<div class="col-sm-4"><input type="text" name="additional" id="additional" value="{tmpl_var name='additional'}" class="form-control" <tmpl_if name="edit_disabled">readonly</tmpl_if> /> </div>
	<div class="input-sm">{tmpl_var name='ca_hostname_note_txt'}</div>
</div>

<div class="form-group">
	<label for="name" class="col-sm-2 control-label">{tmpl_var name='ca_options_txt'}</label>
	<div class="col-sm-4"><input type="text" name="options" id="options" value="{tmpl_var name='options'}" class="form-control" /></div>
	<div class="input-sm">{tmpl_var name='ca_options_note_txt'}</div>
</div>

<div class="form-group">
	<label for="ttl" class="col-sm-2 control-label">{tmpl_var name='ttl_txt'}</label>
	<div class="col-sm-4"><input type="text" name="ttl" id="ttl" value="{tmpl_var name='ttl'}" class="form-control" /></div>
</div>

<div class="form-group">
	<label class="col-sm-2 control-label">{tmpl_var name='active_txt'}</label>
	<div class="col-sm-4">{tmpl_var name='active'}</div>
</div>

<input type="hidden" name="id" value="{tmpl_var name='id'}">
<input type="hidden" name="zone" value="{tmpl_var name='zone'}" id="zone">
<input type="hidden" name="type" value="{tmpl_var name='type'}">
<input type="hidden" name="ca_issue" value="{tmpl_var name='ca_issue'}">
<input type="hidden" name="ca_critical" value="{tmpl_var name='ca_critical'}">

<div class="clear"><div class="right">
	<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="dns/dns_caa_edit.php">{tmpl_var name='btn_save_txt'}</button>
	<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="dns/dns_soa_edit.php?id={tmpl_var name='zone'}">{tmpl_var name='btn_cancel_txt'}</button>
</div></div>

<script language="JavaScript" type="text/javascript">
	$(document).ready(function() { reloadForm(); });
	jQuery('#ca_list').change(function(){ reloadForm(); });
	function reloadForm(){
		var caID = jQuery('#ca_list').val();
		jQuery.getJSON('dns/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {ca_id : caID, type : "ca_wildcard"}, function(data) {
			if(data.ca_wildcard == "Y"){ jQuery('.wildcard').show(); } else { jQuery('.wildcard').hide(); }
			if(data.ca_critical == "1"){ jQuery('.critical').show(); } else { jQuery('.critical').hide(); }
			$('input[name="ca_issue"]').val(data.ca_issue);
			$('input[name="ca_critical"]').val(data.ca_critical);
		});
	}
</script>


