{% if proposal.project_summary %}
Project Summary
{{ proposal.project_summary|md }}
{% endif %}
{% if map_ctx %}
Map
{% if map_static_data_uri %}

{% elif map_ctx.image_url %}

{% else %}
{% endif %}
{% if map_ctx.caption %}Figure 1. {{ map_ctx.caption }}. {% endif %}Wu, Q. (2026). GeoLibre: A lightweight, cloud-native GIS platform for visualizing, exploring, and analyzing geospatial data. Zenodo. https://doi.org/10.5281/zenodo.20785400
{% endif %}
{% if proposal.scope %}
Scope
{{ proposal.scope|md }}
{% endif %}
{% if budget_items %}
Budget
| Item |
Cost/Unit |
Units |
Total |
{% 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 %}
| {{ task.name }} |
{{ ns.total|currency }} |
{% for item in budget_items %}
{% if item.task_id|string == task.id|string %}
| {{ item.name }} |
{{ item.cost_per_unit|currency }} |
{{ item.units|int }} |
{{ (item.cost_per_unit * item.units)|currency }} |
{% endif %}
{% endfor %}
{% endfor %}
| Subtotal |
{{ total_budget|currency }} |
{% if indirect_percent is defined and indirect_percent > 0 %}
| Indirect ({{ "%.1f"|format(indirect_percent) }}%) |
{{ indirect_amount|currency }} |
{% endif %}
| Total |
${{ total_with_indirect|currency }} |
{% if budget_by_year.years or budget_by_year.unscheduled %}
Budget by Year
| Year |
Amount |
% of Total |
{% for row in budget_by_year.years %}
| {{ row.year }} |
${{ row.amount|currency }} |
{% if total_budget > 0 %}{{ (row.amount / total_budget * 100)|round(1) }}%{% endif %} |
{% endfor %}
{% for u in budget_by_year.unscheduled %}
| Not scheduled |
${{ u.amount|currency }} |
{% if total_budget > 0 %}{{ (u.amount / total_budget * 100)|round(1) }}%{% endif %} |
{% endfor %}
{% endif %}
{% 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 %}