{% extends "corporate_memberships/base.html" %}
{% load pagination_tags %}
{% load base_filters %}
{% load perm_tags %}
{% load corporate_memberships_tags %}
{% load i18n %}

{% block title %}{{ block.super }}{% trans "Corporate Membership Search" %}{% endblock %}

{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}css/corporate_memberships.css">
{% endblock %}

{% block body %}
<div class="t">
<div class="t-search">
 {# corpmemb_nav request.user #}
 
<h1>{% trans "Corporate Membership Search" %}</h1>
{% corp_memb_search %}
{% autopaginate corp_members 10 %}
<div class="corpmembers-wrap">
    {% for corp_memb in corp_members %}
	    {% with corp_memb|get_object as corporate_membership %}
			{% include 'corporate_memberships/search-result.html' %}
		{% endwith %}	
	{% empty %}
		<div>{% trans "0 Results Found" %}</div>
	{% endfor %}
</div>


 {% paginate %}
 
 </div>
</div>

{% endblock %}

{% block extra_body %}
 <script type="text/javascript">
	$(document).ready(function(){

		// delete confirmation
		$('.delete').click(function(){
			var delete_corp_memb = confirm('Permenantly delete {% firstof MODULE_CORPORATEMEMBERSHIPS_LABEL 'Corporate Membership' %}?');	// confirm
			if(delete_corp_memb) $(this).parents('.wrap-search-item').find('form[name="corp-memb-delete"]').submit(); // delete: if OK
			return false;	// cancel
		});
	});
   </script>
<script>
	var filename = "{{ STATIC_URL }}js/global/dropdown.js";
	
	if (typeof dropdown == "undefined")
	{
		var fileref=document.createElement('script');
		fileref.setAttribute("type","text/javascript");
		fileref.setAttribute("src", filename);
		var head = document.getElementsByTagName('head')[0];
		head.appendChild(fileref);
	}
</script>

<script type="text/javascript">
var iconrow = new dropdown({
	container:	'more-options-wrap',
	trigger:	'more-options-trigger',
	target:		'more-options-target'
});
</script>


	
{% endblock %}
