{% load i18n %}
<div class="sprites menu">
	<ul id="nav">
		<li class="nav_li {% if module == 'index' %} current {% endif %}">
			<a href="{% url "nitrate-index" %}">{% trans "HOME" %}</a>
		</li>
		<li class="sprites menuline"></li>
		<li class="nav_li{% if module == 'testplans' %} current{% endif %}">
			<a href="{% url "plans-all" %}?is_active=on">{% trans "PLANNING" %}</a>
			<ul class="nav_sub sub_plan" style="display: none;">
				<li {% if sub_module == 'plans' %} class="subcurrent"{% endif %} >
					<a href="{% url "plans-all" %}?is_active=on">Search Plans</a>
				</li>
				{% if user.is_authenticated %}
				<li {% if sub_module == 'my_plans' %} class="subcurrent"{% endif %} >
					<a href="{% url "plans-all" %}?author__email__startswith={{ user.email|urlencode }}&is_active=on">My Plans</a>
				</li>
				{% endif %}
				{% if perms.testplans.add_testplan %}
				<li {% if sub_module == 'new_plan' %} class="subcurrent"{% endif %} >
					<a href="{% url "plans-new" %}">New Plan</a>
				</li>
				{% endif %}
			</ul>
		</li>
		<li class="sprites menuline"></li>
		<li class="nav_li{% if module == 'testruns' %} current{% endif %}">
			<a href="{% url "runs-all" %}">{% trans "TESTING" %}</a>
			<ul id="submenu_test" class="nav_sub" style="display:none;">
				<li {% if sub_module == 'runs' %} class="subcurrent"{% endif %} >
					<a href="{% url "runs-all" %}">Search Runs</a>
				</li>
				<li {% if sub_module == 'cases' %} class="subcurrent"{% endif %} >
					<a href="{% url "cases-search" %}">Search Cases</a>
				</li>
				{% if user.is_authenticated %}
				<li {% if sub_module == 'my_runs' %} class="subcurrent"{% endif %} >
					<a href="{% url "runs-all" %}?people={{ user.email }}">My Runs</a>
				</li>
				{% endif %}
				{% if perms.testcases.add_testcase %}
				<li>
					<a href="{% url "cases-new" %}">New Case</a>
				</li>
				{% endif %}
			</ul>
		</li>
		<li class="sprites menuline"></li>
		<li class="nav_li{% if module == 'env' %} current{% endif %}">
			<a href="{% url "management-env-groups" %}">{% trans "ENVIRONMENT" %}</a>
			<ul	 id="submenu_environment" class="nav_sub" style="display:none;">
				<li>
					<a href="{% url "management-env-groups" %}">Groups</a>
				</li>
				<li>
					<a href="{% url "management-env-properties" %}">Properties</a>
				</li>
			</ul>
		</li>
		<li class="sprites menuline"></li>
		<li class="nav_li {% if module == 'report' %} current{% endif %}">
		<a href="{% url "report-overall" %}">{% trans "REPORTING" %}</a>
			<ul	 id="submenu_report" class="nav_sub" style="display:none;">
				<li>
					<a href="{% url "report-overall" %}">Overall</a>
				</li>
				<li>
					<a href="{% url "report-custom" %}">Custom</a>
				</li>
				<li>
					<a href="{% url "testing-report" %}">Testing Report</a>
				</li>
			</ul>
		</li>
		<li class="sprites menuline"></li>
		{% if user.is_staff %}
		<li class="nav_li{% if not module %} current{% endif %}">
			<a href="{% url "admin:index" %}">{% trans "ADMIN" %}</a>
			<ul id="submenu_admin" class="nav_sub" style="display:none;">
				{% if perms.auth.change_user %}
				<li {% if sub_module == 'products' %}class="subcurrent"{% endif %}>
					<a href="{% url "admin:app_list" "auth" %}">Auth</a>
				</li>
				{% endif %}
				{% if perms.management %}
				<li {% if sub_module == 'environments' %}class="subcurrent"{% endif %}>
					<a href="{% url "admin:app_list" "management" %}">Management</a>
				</li>
				{% endif %}
				{% if perms.testplans.change_testplantype %}
				<li {% if sub_module == 'testplans' %}class="subcurrent"{% endif %}>
					<a href="{% url "admin:app_list" "testplans" %}">Test plans</a>
				</li>
				{% endif %}
				{% if perms.testcases %}
				<li {% if sub_module == 'testcases' %}class="subcurrent"{% endif %}>
					<a href="{% url "admin:app_list" "testcases" %}">Test cases</a>
				</li>
				{% endif %}
			</ul>
		</li>
		<li class="sprites menuline"></li>
		{% endif %}
	</ul>
	<div class="right-action">
		<form action="{% url "nitrate-search" %}" method="get">
			<span>
				<select id="search_type" name="search_type">
					<option value="plans"{% if module == 'testplans' %} selected{% endif %}>Test Plan</option>
					<option value="runs"{% if module == 'testruns' %} selected{% endif %}>Test Run</option>
					<option value="cases"{% if module == 'testcases' %} selected{% endif %}>Test Case</option>
				</select>
				<input id="search_content" name="search_content" type="text" value="{{ REQUEST_CONTENTS.search }}" size="15" />
				<input type="button" value="Go" id="js-execute-search" />
			</span>
			<label class="linkAdvancedSearch">&nbsp;&nbsp;<a href="{% url "advanced-search" %}">Advanced Search</a></label>
		</form>

	</div>
</div>
