${s.searchbox(url(controller='organizations'))}
<div class="clear"></div>
<div class="sp10"></div>
<div class="alpos">
	<div class="toolbar">${self.paging(h.do_pagination(c.page), 'sorgstop')}</div>
</div>
<div id="content">
<table class="orgs">
<thead>
<tr class="grid">
	<th class="org_heading_name">${_('Organization name')}</th>
	<th class="org_heading_domains cl">${_('List domains')}</th>
	<th class="org_heading_accounts cl">${_('List accounts')}</th>
	<th class="org_heading_adddomains cl">${_('Add domain')}</th>
	<th class="org_heading_importdomains cl">${_('Import domains')}</th>
	<th class="org_heading_edit cl">${_('Edit')}</th>
	<th class="org_heading_delete cl">${_('Delete')}</th>
</tr>
</thead>
<tbody>
% if not c.page.items:
<tr><td class="spanrow" colspan="6">${_('No organizations found')}</td></tr>
% endif
% for i, org in enumerate(c.page.items):
<tr class="orgrows">
	<td class="org_name">${h.link_to(org.name, url('org-detail', orgid=org.id))}</td>
	<td class="org_domains cl">${h.link_to(h.portable_img('imgs/domains.png', _('List domains')), url('domains-byorg', orgid=org.id))}</td>
	<td class="org_accounts cl">${h.link_to(h.portable_img('imgs/user.png', _('List accounts')), url('accounts-byorg', orgid=org.id))}</td>
	<td class="org_adddomains cl">${h.link_to(h.portable_img('imgs/add.png', _('Add domains')), url('domain-add-byorg', orgid=org.id))}</td>
	<td class="org_importdomains cl">${h.link_to(h.portable_img('imgs/import.png', _('import domains')), url('orgs-import-domains', orgid=org.id))}</td>
	<td class="org_edit cl">${h.link_to(h.portable_img('imgs/edit.png', _('Edit')), url('orgs-edit', orgid=org.id))}</td>
	<td class="org_delete cl">${h.link_to(h.portable_img('imgs/action_delete.png', _('Delete')), url('orgs-delete', orgid=org.id))}</td>
</tr>
% endfor
</tbody>
</table>
</div>
<div class="alpos">
	<div class="toolbar">${self.paging(h.do_pagination(c.page), 'sorgsbottom')}</div>
</div>
<div class="clear"></div>
<div class="sp10"></div>
<%def name="paging(page_nums, fieldname)">
% if c.page.page_count != 0:
<%
kwd = {}
if hasattr(c, 'q') and c.q:
	kwd['q'] = c.q
%>
<p>${_('Showing items %(i)d to %(l)d of %(count)d') % dict(i=c.page.first_item, l=c.page.last_item, count=c.page.item_count)}.</p>
<div class="limiter">
${_('Show items:')}
${h.pager_select(fieldname, str(c.page.items_per_page))}
${_('per page')}
</div>
<div class="pages">
% if c.page.page_count == 1:
-
% endif
% else:
<p>${_('No items found')}</p>
% endif
% if c.page.next_page != c.page.first_page and c.page.page != c.page.first_page:
<span>
	${h.link_to(h.pager_img('first'),  url('orgs-pages', page=c.page.first_page, **kwd))}
</span>
<span>...</span>
% endif
% if c.page.previous_page:
<span>
	${h.link_to(h.pager_img('previous'), url('orgs-pages', page=c.page.previous_page, **kwd))}
</span>
% endif
% for linkpage in page_nums:
% 	if linkpage == c.page.page:
<span><b>${linkpage}</b></span>
% 	else:
<span>
	${h.link_to(h.literal(linkpage), url('orgs-pages', page=linkpage, **kwd))}
</span>
% 	endif
% endfor
% if c.page.next_page:
<span>
	${h.link_to(h.pager_img('next'), url('orgs-pages', page=c.page.next_page, **kwd))}
</span>
% endif
% if c.page.next_page != c.page.page_count and c.page.page != c.page.page_count and c.page.page_count != 0:
<span>...</span>
<span>
	${h.link_to(h.pager_img('last'), url('orgs-pages', page=c.page.page_count, **kwd))}
</span>
% endif
% if c.page.page_count != 0:
</div>
% else:
<div class="pages">-</div>
% endif
</%def>
<%def name="title()">
${_('Organizations :: Showing page %(page)d of %(count)d pages.') % dict(page=c.page.page, count=c.page.page_count)}
</%def>

<%def name="heading()">
% if c.page.page_count != 0:
${_('Organizations :: Showing page %(page)d of %(count)d pages.') % dict(page=c.page.page, count=c.page.page_count)}
% else:
${_('Organizations ::')}
% endif
</%def>

<%def name="headers()">
</%def>
<%def name="localscripts()">
<script type="text/javascript">
var setitems_url = "${url(controller='organizations', action='setnum')}";
</script>
${h.javascript_link(h.media_url() + 'js/jquery.address-1.4.min.js',
h.media_url() + 'js/baruwa/organizations.js')}
</%def>
<%namespace name="s" file="/includes/search.html"/>
<%inherit file="/base.html"/>