{{ proposal.title or "Proposal" }}

{% if proposal.client_name %}
Funder: {{ proposal.client_name }}
{% endif %} {% if proposal.subtitle %}
Program: {{ proposal.subtitle }}
{% endif %}
{{ proposal.updated_at[:10] if proposal.updated_at else "" }}
{% if proposal.project_summary %}

Project Summary

{{ proposal.project_summary|md }}
{% endif %} {% if proposal.scope %}

Scope

{{ proposal.scope|md }}
{% endif %} {% if budget_items %}

Budget

{% for task in tasks %} {% set ns = namespace(total=0) %} {% for item in budget_items %} {% if item.task_id|string == task.id|string %} {% set ns.total = ns.total + item.cost_per_unit * item.units %} {% endif %} {% endfor %} {% for item in budget_items %} {% if item.task_id|string == task.id|string %} {% endif %} {% endfor %} {% endfor %} {% if indirect_percent is defined and indirect_percent > 0 %} {% endif %}
Item Cost/Unit Units Total
{{ task.name }} {{ ns.total|currency }}
{{ item.name }} {{ item.cost_per_unit|currency }} {{ item.units|int }} {{ (item.cost_per_unit * item.units)|currency }}
Subtotal {{ total_budget|currency }}
Indirect ({{ "%.1f"|format(indirect_percent) }}%) {{ indirect_amount|currency }}
Total ${{ total_with_indirect|currency }}
{% endif %} {% if proposal.qualifications %}

Qualifications

{{ proposal.qualifications|md }}
{% endif %} {% if proposal.custom_sections %} {% for section in proposal.custom_sections | sort(attribute='order') %}

{{ section.title }}

{{ section.content | md }}
{% endfor %} {% endif %} {% if tasks %}

Timeline

{% set proj_start_month = proposal.start_date[5:7]|int if proposal.start_date and proposal.start_date|length >= 7 else 1 %} {% set proj_start_year = proposal.start_date[:4]|int if proposal.start_date and proposal.start_date|length >= 4 else 2025 %} {% set month_names = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'] %} {% set quarter_names = ['Q1','Q2','Q3','Q4'] %} {% if proposal.end_date and proposal.end_date|length >= 7 %} {% set proj_end_month = proposal.end_date[5:7]|int %} {% set proj_end_year = proposal.end_date[:4]|int %} {% set total_project_months = [(proj_end_year - proj_start_year) * 12 + (proj_end_month - proj_start_month) + 1, 1]|max %} {% else %} {% set max_end = 0 %} {% for r in all_rows %} {% for bar in r.bars %} {% set row_end = bar.offset + bar.duration %} {% if row_end > max_end %}{% set max_end = row_end %}{% endif %} {% endfor %} {% endfor %} {% set total_project_months = [max_end, 1]|max %} {% endif %}
{% set years_in_proj = ((proj_start_month - 1 + total_project_months - 1) // 12) + 1 %}
{% for y in range(years_in_proj) %} {% set abs_y = proj_start_year + y %} {% set year_start_m = [(abs_y - proj_start_year) * 12 - (proj_start_month - 1), 0]|max %} {% set year_end_m = [(y + 1) * 12 - (proj_start_month - 1), total_project_months]|min %} {% set year_span = year_end_m - year_start_m %} {% if year_span > 0 %}
{{ abs_y }}
{% endif %} {% endfor %}
{% for m_offset in range(total_project_months) %} {% set abs_m = proj_start_month + m_offset - 1 %} {% set abs_m_1based = (abs_m % 12) + 1 %} {% set is_year_start = (abs_m_1based == 1) %}
{{ month_names[abs_m_1based - 1] }}
{% endfor %}
{% for r in all_rows %}
{{ r.name }}
{% for bar in r.bars %} {% set left_pct = (bar.offset / total_project_months * 100)|round(1) if total_project_months > 0 else 0 %} {% set width_pct = (bar.duration / total_project_months * 100)|round(1) if total_project_months > 0 else 100 %}
{% endfor %}
{% endfor %}
{% endif %}