{% load rules %} {% load projectroles_tags %} {% load projectroles_common_tags %} {% sodar_constant 'PROJECT_TYPE_PROJECT' as PROJECT_TYPE_PROJECT %} {% sodar_constant 'PROJECT_TYPE_CATEGORY' as PROJECT_TYPE_CATEGORY %} {% allow_project_creation as allow_creation %} {% get_django_setting 'PROJECTROLES_DISABLE_CATEGORIES' as disable_categories %} {% get_display_name 'PROJECT' title=True as project_display %} {% get_display_name 'CATEGORY' title=True as category_display %} {# Project nav #} {% if project %} {% has_perm 'projectroles.view_project' request.user project as can_view_project %} {% has_perm 'projectroles.view_project_roles' request.user project as can_view_roles %} {% has_perm 'projectroles.update_project' request.user project as can_update_project %} {# Overview #} {# App plugins #} {% for plugin in app_plugins %} {% is_app_visible plugin project request.user as app_link_visible %} {% if app_link_visible %} {% get_sidebar_app_legend plugin.title as app_legend %} {% endif %} {% endfor %} {# Role and project editing #} {% if can_view_roles %} {% endif %} {% if can_update_project %} {% endif %} {% endif %} {# Project and Category Creation #} {% if project and project.type == 'CATEGORY' %} {% has_perm 'projectroles.create_project' request.user project as can_create_project %} {% if allow_creation and can_create_project and not project.is_remote %} {% endif %} {% elif disable_categories and request.user.is_superuser %} {# Allow project creation under root #} {% elif request.resolver_match.url_name == 'home' or request.resolver_match.app_name == 'projectroles' and not project %} {% has_perm 'projectroles.create_project' request.user as can_create_project %} {% if allow_creation and can_create_project %} {% endif %} {% endif %}