% if request.is_xhr:
<div class="row-fluid" id="ajaxformoverlay">
	<!-- <div class="span2 hidden-phone"></div> -->
	<div class="span12">
		<div class="row-fluid" id="ajaxformheading">
			<div class="span11">
				${_('Add Sender to a list')}
			</div>
			<div class="span1">
				<button class="close" data-dismiss="ajaxformoverlay" type="button">
					<i class="icon-remove"></i>
				</button>
			</div>
		</div>
		<%
		alertmap = {'error': 'error', 'success': 'success', 'notice': 'info'} 
		iconmap = {'error': 'remove', 'success': 'ok', 'notice': 'ok'}
		messages = h.flash.pop_messages()
		if not messages and hasattr(c, 'form') and 'csrf_token' in c.form.errors:
			message = c.form.errors.pop('csrf_token')[0]
			msg = h.Msg('error', message)
			messages.append(msg)
		%>
		% if messages:
		<div class="row-fluid">
			<div class="span12">
				<div class="alert alert-${alertmap[messages[0].category]}">
					<button class="close" data-dismiss="alert" type="button">
						<i class="icon-remove"></i>
					</button>
					<strong><i class="icon-${iconmap[messages[0].category]}"></i></strong> ${messages[0]}
				</div>
			</div>
		</div>
		% endif
		${h.form(url(controller='lists', action='new'), id="list-form", method='post')}
		<%include file="../forms/ajaxformbase.html"/>
		<div class="row-fluid">
		    <div class="span3">${h.checkbox('iptoggle', label=_('Use IP address'))}</div>
		    <div class="span3">${h.checkbox('domaintoggle', label=_('Use Domain'))}</div>
		    <div class="span6"><button id="ajaxsubmit" class="btn btn-small btn-success"><i class="icon-cog"></i> ${_('Add to list')}</button></div>
		</div>
		${h.end_form()}
	</div>
	<!-- <div class="span2 hidden-phone"></div> -->
</div>
% else:
<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<h3 class="head smaller lighter blue">${_('Add sender to a list')}</h3>
	</div>
	<div class="span1 hidden-phone"></div>
</div>
<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		${h.form(url(controller='lists', action='new'), id="list-form", method='post')}
		<%include file="../forms/base.html"/>
		<div class="form-actions">
			<button id="reset-button" class="btn btn-small btn-success" type="reset"><i class="icon-undo"></i> ${_('Reset')}</button>
			<button id="submit-button" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_('Add to list')}</button>
		</div>
		${h.end_form()}
	</div>
	<div class="span1 hidden-phone"></div>
</div>
% endif

<%def name="title()">
${_('Lists :: Add to list')}
</%def>

<%def name="heading()">
${_('Lists :: Add to List')} 
</%def>

<%def name="submenu()">
<div class="navbar navbar-static-top">
    <div class="navbar-inner">
        <div class="nav-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="nav_item">${h.link_to(_('Approved senders'), url('lists-index', list_type=1))}</li>
                <li class="nav_item">${h.link_to(_('Banned senders'), url('lists-index', list_type=2))}</li>
                <li class="nav_item">${h.link_to(_('Add to List'), url('lists-add'), id='list-add')}</li>
            </ul>
        </div>
    </div>
</div>
</%def>

<%def name="headers()">
</%def>
<%def name="localscripts()">
<script type="text/javascript">
$(function() {
	$('.settings-popover').popover();
});
</script>
</%def>
<%inherit file="${None if context.get('c').is_ajax else '../base.html'}"/>
