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

{% block title %}Corporate Membership{% endblock %}

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

{% block body %}
<div class="t">
	{% corpmemb_nav request.user %}
	<div class="corp-index">
		<h1>{% trans "Corporate Memberships" %}</h1>
	     <h2>{% trans "Applications:" %}</h2>
	     {% if corp_apps %}
	     	<ol>
	     	{% for corp_app in corp_apps %}
	     		<li>
		     		<a href="{% url corp_memb.add corp_app.slug %}">{{ corp_app.name }}</a> 
		     		(<a href="{% url admin:corporate_memberships_corpmembershipapp_change corp_app.id %}">{% trans "Edit" %}</a>)
		     		--------------->>
		     		{% trans "Individual Member App: " %}
		     		{% if corp_app.memb_app %}
		     		<a href="{% url membership.application_detail_default corp_app.memb_app.slug %}">{{ corp_app.memb_app.name }}</a>
		     		(<a href="{% url admin:memberships_app_change corp_app.memb_app.id %}">{% trans "Edit" %}</a>)
		     		{% else %}
		     			<a href="{% url admin:memberships_app_add %}?use_for_corp=1">{% trans "Create it" %}</a>
		     		{% endif %}
		     		
		     		<h2>{% trans "Types:" %}</h2>
			     	<table width="90%">
			     	<tr>
			     		<td class="header" width="50%">{% trans "Corporate Member Type" %}</td>
			     		<td class="header" width="50%">{% trans "Individual Member Type" %}</td>
			     	</tr>
			     	{% for cm_type in corp_app.corp_memb_type.all %}
			     		<tr>
			     		<td><a href="{% url admin:corporate_memberships_corporatemembershiptype_change cm_type.id %}">{{ cm_type.name }}</a></td>
			     		<td><a href="{% url admin:memberships_membershiptype_change cm_type.membership_type.id %}">{{ cm_type.membership_type.name }}</a></td>
			     		
			     		</tr>
			     	{% endfor %}
			     	</table>
			     	<br />
	     		
	     		</li>
	     		
	     	{% endfor %}
	     	</ol>
	     	
	     	<h2>{% trans "Other links:" %}</h2>
	     	<ol>
	     	<li><a href="{% url corp_memb.search %}">{% trans "Search Corporate Memberships" %}</a></li>
	     	</ol>
	     {% else %}
	    	{% trans "No applications available. " %}<a href="{% url admin:corporate_memberships_corpapp_add %}">{% trans "Add one" %}</a>.
		 {% endif %}
	</div>
</div>
{% endblock %}
