<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<ul id="msgops">
			<li>${h.link_to(_('Add Rule'), url('add-rule', policy_id=c.policy_id))}</li>
		</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">
		<table class="table table-bordered">
		<thead>
		<tr>
			<th>${h.checkbox('checkall')}</th>
			<th class="hidden-phone">${_('Rule Pattern')}</th>
			<th>${_('Rule Description')}</th>
			<th>${_('Rule Action')}</th>
			<th class="hidden-phone">${_('Rule Options')}</th>
			<th class="hidden-phone">${_('Enabled')}</th>
			<th colspan="4">${_('Actions')}</th>
		</tr>
		</thead>
		<tbody>
		% if not c.rules:
		<tr><td colspan="10" class="text-center">${_('The policy does not have any rules yet.')}</td></tr>
		% endif
		% for rule in c.rules:
		<tr>
			<td>${h.checkbox('ruleid', value=rule.id, class_='selector')}</td>
			<td class="hidden-phone">${h.literal('<em>') if not rule.enabled else ''}${rule.expression}${h.literal('</em>') if not rule.enabled else ''}</td>
			<td>${h.literal('<em>') if not rule.enabled else ''}${rule.description}${h.literal('</em>') if not rule.enabled else ''}</td>
			<td>${h.literal('<em>') if not rule.enabled else ''}${rule.action}${h.literal('</em>') if not rule.enabled else ''}</td>
			<td class="hidden-phone">${h.literal('<em>') if not rule.enabled else ''}${rule.options}${h.literal('</em>') if not rule.enabled else ''}</td>
			<td class="hidden-phone">
				${functions.item_status(rule.enabled)}
			</td>
			<td>
				% if rule.first:
				&nbsp;
				% else:
				${h.link_to(h.literal('<i class="icon-arrow-up blue"></i>'), url('move-rule', rule_id=rule.id, direc=1), title=_("Move Up"))}
				% endif
			</td>
			<td>
				% if rule.last:
				&nbsp;
				% else:
				${h.link_to(h.literal('<i class="icon-arrow-down blue"></i>'), url('move-rule', rule_id=rule.id, direc=0), title=_("Move Down"))}
				% endif
			</td>
			<td>${h.link_to(h.literal('<i class="icon-edit blue"></i>'), url('edit-rule', rule_id=rule.id), title=_("Edit Rule"))}</td>
			<td>${h.link_to(h.literal('<i class="icon-remove red"></i>'), url('delete-rule', rule_id=rule.id), title=_("Delete Rule"))}</td>
		</tr>
		% endfor
		</tbody>
		</table>
	</div>
	<div class="span1 hidden-phone"></div>
</div>

<%def name="title()">
${_('Settings :: Content Protection :: %(policy)s :: %(name)s :: Rules') % dict(policy=c.policy_name, name=c.policy)}
</%def>

<%def name="heading()">
${_('Settings :: Content Protection :: %(policy)s :: %(name)s :: Rules') % dict(policy=c.policy_name, name=c.policy)}
</%def>

<%def name="headers()">
</%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(_('Content Protection'), url('settings-rulesets'))}</li>
                <li class="nav_item">${h.link_to(c.policy_name, url(c.POLICY_URL_MAP[str(c.policy_type)]))}</li>
            </ul>
        </div>
    </div>
</div>
</%def>

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

