{% load i18n cosinnus_tags %}

{% comment %} {{current_page}} is one of: grouplist, addgroup {% endcomment %}

{% if current_page == "grouplist" %}
    {% captureas is_grouplist %}True{% endcaptureas %}
{% elif current_page == "grouplist__society" %}
    {% captureas is_grouplist__society %}True{% endcaptureas %}
{% elif current_page == "userlist" %}
    {% captureas is_userlist %}True{% endcaptureas %}
{% elif current_page == "portaladminlist" %}
    {% captureas is_portaladminlist %}True{% endcaptureas %}
{% elif current_page == "addgroup" %}
    {% captureas is_addgroup %}True{% endcaptureas %}
{% elif current_page == "addsociety" %}
    {% captureas is_addsociety %}True{% endcaptureas %}
{% endif %}

{% if current_page == "grouplist" or current_page == "addgroup" %}
	{% captureas href %}{% url 'cosinnus:group-list' %}{% endcaptureas %}
	{% captureas label %}{% trans "All projects" %}{% endcaptureas %}
	{% include "cosinnus/leftnav_button.html" with active=is_grouplist extra_classes="regular-space" icon="fa-group" label=label href=href  %}
	
	{% if user|can_create_groups %}
	    {% captureas href %}{% url 'cosinnus:group-add' %}{% endcaptureas %}
	    {% captureas label %}{% trans "Create Project" %}{% endcaptureas %}
	    {% include "cosinnus/leftnav_button.html" with active=is_addgroup icon="fa-plus" extra_classes="regular-space" label=label href=href  %}
	{% endif %}
{% endif %}

{% if current_page == "grouplist__society" or current_page == "addsociety" %}
	{% captureas href %}{% url 'cosinnus:group__group-list' %}{% endcaptureas %}
	{% captureas label %}{% trans "All groups" %}{% endcaptureas %}
	{% include "cosinnus/leftnav_button.html" with active=is_grouplist__society extra_classes="regular-space" icon="fa-group" label=label href=href  %}
	
	{% if user|can_create_groups %}
	    {% captureas href %}{% url 'cosinnus:group__group-add' %}{% endcaptureas %}
	    {% captureas label %}{% trans "Create Group" %}{% endcaptureas %}
	    {% include "cosinnus/leftnav_button.html" with active=is_addsociety icon="fa-plus" label=label href=href  %}
	{% endif %}
{% endif %}

{% if current_page == "portaladminlist" or current_page == "userlist" %}
	{% if not SETTINGS.COSINNUS_IS_INTEGRATED_PORTAL %}
	    {% captureas href %}{% url 'cosinnus:user-list' %}{% endcaptureas %}
	    {% captureas label %}{% trans "All users" %}{% endcaptureas %}
	    {% include "cosinnus/leftnav_button.html" with active=is_userlist extra_classes="fine-space" icon="fa-user" label=label href=href  %}
    {% endif %}
    
    {% captureas href %}{% url 'cosinnus:portal-admin-list' %}{% endcaptureas %}
    {% captureas label %}{% trans "Portal Administrators" %}{% endcaptureas %}
    {% include "cosinnus/leftnav_button.html" with active=is_portaladminlist extra_classes="regular-space" icon="fa-user" label=label href=href  %}
{% endif %}

{% if current_page == "all" %}
    {% captureas href %}{% url 'cosinnus:group__group-list' %}{% endcaptureas %}
    {% captureas label %}{% trans "All societies" %}{% endcaptureas %}
    {% include "cosinnus/leftnav_button.html" with active=is_grouplist__society extra_classes="regular-space" icon="fa-group" label=label href=href  %}
    
    {% captureas href %}{% url 'cosinnus:group-list' %}{% endcaptureas %}
    {% captureas label %}{% trans "All projects" %}{% endcaptureas %}
    {% include "cosinnus/leftnav_button.html" with active=is_grouplist extra_classes="regular-space" icon="fa-group" label=label href=href  %}
{% endif %}