{% load i18n pages_tags %}

{% spaceless %}
{% url home as home_url %}
<ul>
	{% for page in page_branch %}
	{% if page.primary and forloop.first %}
	<li class="first{% ifequal request.path home_url %} active{% endifequal %}">
	    <a href="{% url home %}">{% trans "Home" %}</a>
	</li>
	{% endif %}
	{% if page.in_navigation %}
	<li class="{% if page.selected %}active{% endif %}
	    {% if forloop.first %} first{% endif %} 
	    {% if forloop.last %} last{% endif %}">
		<a href="{% url page page.slug %}">{{ page.title }}</a>
		{# remove this if tag to always show all nav items #}
		{% if PAGES_MENU_SHOW_ALL or page.selected %}
		{% tree_menu page %}
		{% endif %}
	</li>
    {% endif %}
	{% endfor %}
</ul>
{% endspaceless %}
