{% extends "deliver_grant_funding/base.html" %}

{% set cspNonce = csp_nonce() %}

{% set nav_items = [] %}
{%
  do nav_items.append({
      "text": "Grant details",
      "key": "grant_details",
      "href": url_for("deliver_grant_funding.grant_details", grant_id=grant.id),
      "current": active_item_identifier == "details"
  })
%}
{% if feature_flags.PRE_AWARD.is_enabled %}
  {%
    do nav_items.append({
        "text": "Pre-award",
        "key": "pre_award",
        "href": url_for("deliver_grant_funding.list_pre_award_forms", grant_id=grant.id),
        "current": active_item_identifier == "pre_award"
    })
  %}
{% endif %}
{%
  do nav_items.extend([
      {
          "text": "Reports",
          "key": "reports",
          "href": url_for("deliver_grant_funding.list_reports", grant_id=grant.id),
          "current": active_item_identifier == "reports"
      },
      {
          "text": "Team",
          "key": "grant_users",
          "href": url_for("deliver_grant_funding.list_users_for_grant", grant_id=grant.id),
          "current": active_item_identifier == "grant_team"
      },
  ])
%}

{% set right_nav_items = [] %}

{% if authorisation_helper.is_deliver_org_member(current_user) or current_user.deliver_grants | length > 1 %}
  {%
    do right_nav_items.append({
        "text": "See all grants",
        "href": url_for("deliver_grant_funding.list_grants"),
        "current": false
    })
  %}
{% endif %}
