<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<ul id="msgops">
			<li>${h.link_to(_('Domain Settings'), url('domain-settings', domainid=c.domain.id))}</li>
			<li>${h.link_to(_('Domain details'), url(controller='domains', action='detail', domainid=c.domain.id))}</li>
			% if len(c.domain.dkimkeys):
			<li>${h.link_to(_('Regenerate DKIM keys'), url('domain-dkim-generate', domainid=c.domain.id))}</li>
			<li>${h.link_to(_('Enable/Disable DKIM signing'), url('domain-dkim-enable', domainid=c.domain.id))}</li>
			% endif
		</ul>
	</div>
	<div class="span1 hidden-phone"></div>
</div>
<div class="space-6"></div>
<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<h3 class="head smaller lighter blue">${_('Domain DKIM settings')}</h3>
	</div>
	<div class="span1 hidden-phone"></div>
</div>
<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
	% if c.domain.dkimkeys:
	<%
	from baruwa.lib.crypto import remove_pub_pem_headers
	tmpslt = remove_pub_pem_headers(c.domain.dkimkeys[0].pub_key)
	tmpslt = tmpslt.split('\n')
	tmpslt = ["\"%s\"" % chunk for chunk in tmpslt]
	dkim_key = "\n".join(tmpslt)
	%>
		<div class="row-fluid">
			<div class="span12">${_('Add the following DNS record to the %s DNS zone') % c.domain.name}</div>
		</div>
		<div class="row-fluid">
			<div class="span6">${_('DNS record')}</div>
			<div class="span6">
				${config.get('baruwa.dkim.selector', 'baruwa')}._domainkey.${c.domain.name}. IN TXT ("v=DKIM1; g=*; k=rsa; p="
				${h.linebreaksbr(dkim_key)})
			</div>
		</div>
		% for alias in c.domain.aliases:
		<div class="row-fluid">
			<div class="span12">${_('Add the following DNS record to the %s DNS zone') % alias.name}</div>
		</div>
		<div class="row-fluid">
			<div class="span6">${_('DNS record')}</div>
			<div class="span6">
				${config.get('baruwa.dkim.selector', 'baruwa')}._domainkey.${alias.name}. IN TXT ("v=DKIM1; g=*; k=rsa; p="
				${h.linebreaksbr(dkim_key)})
			</div>
		</div>
		% endfor
		<div class="row-fluid">
			<div class="span6">${_('DKIM status')}</div>
			<div class="span6">${functions.item_status(c.domain.dkimkeys[0].enabled)}</div>
		</div>
		% else:
		<div class="row-fluid">
			<div class="span12">${_('DKIM keys not yet configured:  ')}&nbsp;${h.link_to(_('Generate DKIM keys'), url('domain-dkim-generate', domainid=c.domain.id))} </div>
		</div>
		% endif
	</div>
	<div class="span1 hidden-phone"></div>
</div>


<%def name="title()">
${_('Settings :: Domain DKIM settings :: %s') % c.domain.name}
</%def>

<%def name="heading()">
${_('Settings :: Domain DKIM settings :: %s') % c.domain.name}
</%def>

<%def name="headers()">
</%def>
<%def name="submenu()"></%def>
<%def name="localscripts()">
</%def>
<%namespace name="functions" file="../includes/functions.html"/>
<%inherit file="../base.html"/>
