{% extends "base.html" %} {% from '_comments.html' import render_comments %} {% from '_species.html' import species_pill %} {% from '_picker.html' import area_drilldown_picker %} {% from '_featured_image.html' import featured_image_block, featured_image_thumb %} {% from '_archive.html' import archive_button, archived_chip %} {% block content %} {%- set status_qs = '?status=' ~ status_filter if status_filter and status_filter != 'planted' else '' -%} {%- set has_sketch = (area.length_ft and area.width_ft) -%}
{{ featured_image_block('area', area.id, area.featured_image_path, area.name) }} {% if has_sketch %} {%- set L = area.length_ft -%} {%- set W = area.width_ft -%} {%- set rot = ((area.sketch_rotation or 0) | int) % 360 -%} {%- set g = sketch_geometry(L, W, rot) -%}
Edit layout →
{% if sketch_children %}
Click an area to select; drag the selected one to reposition.
{% endif %}
{# 1ft grid spans the natural rect; rotates with it. #} {% for i in range(1, (L|int) + 1) %} {% endfor %} {% for j in range(1, (W|int) + 1) %} {% endfor %} {% for c in sketch_children %} {%- set c_L = c.length_ft -%} {%- set c_W = c.width_ft -%} {%- set c_rot = ((c.sketch_rotation or 0) | int) % 360 -%} {# Inner rotation cancels parent rotation, leaving child at its own absolute compass orientation when nested. #} {%- set inner_rot = (c_rot - rot) % 360 -%} {{ c.name }} — {{ c_L }}×{{ c_W }} ft. Click to select, then drag to reposition. {{ c.name }} {% endfor %} {% for p in sketch_plants if p.positions_resolved %} {%- set icon = species_icon(p.species_name) -%} {% for pos in p.positions_resolved %} {%- set px, py, plant_count, sqft = pos -%} {%- set side = (sqft ** 0.5) -%} {%- set tooltip_text = (plant_count|string) ~ '× ' ~ (p.species_name or '?') ~ (' / ' ~ p.variety_name if p.variety_name else '') ~ (' (' ~ p.quantity ~ ' in this group)' if p.quantity and (plant_count|int) != (p.quantity|int) else '') -%} {{ tooltip_text }} {% if icon.type == 'emoji' %} {{ icon.char }} {% else %} {% endif %} {% if plant_count > 1 %} {{ plant_count }} {% endif %} {% endfor %} {% endfor %}
West (pm) Sun intensity stops — not set yet East (am)
{{ L|round(2) }} ft long {{ W|round(2) }} ft wide {% if area.garden_area_sqft %}{{ area.garden_area_sqft|round(1) }} sq ft{% endif %} {{ rot }}°
{% endif %}

{{ area.name }}

Short name: {{ area.short_name or '— add —' }} {% if current_dims %}{{ current_dims }}{% endif %} {% if current_total %}{{ current_total }} plant{{ '' if current_total == 1 else 's' }}{% endif %} {% if enriched_children %}{{ enriched_children|length }} sub-area{{ '' if enriched_children|length == 1 else 's' }}{% endif %}
{% for key, label in [('planted', 'Planted'), ('active', '+ Planned'), ('all', 'All')] %} {{ label }} {% endfor %}
+ Planting here
+ Sub-area {{ archive_button('area', area.id, area.is_archived, '/areas/' ~ area.id) }}
{% if current_summary %}
{% for s in current_summary %}{{ species_pill(s.name, s.count) }}{% endfor %}
{% endif %} {% if plants %}

Plants in this area

{%- set ns = namespace(prev_pid=-1) -%} {% for p in plants %} {%- set pl = planting_map.get(p.planting_id) -%} {%- set group_label = (pl.name if pl else '—') -%} {%- set qty_int = p.quantity|int(default=0) -%} {%- set form_id = 'plant-form-' ~ p.id -%} {%- set this_pid = p.planting_id if p.planting_id is not none else 0 -%} {%- if this_pid != ns.prev_pid -%} {%- set ns.prev_pid = this_pid -%} {%- endif -%} {% endfor %}
Species Variety Plant group Qty Actions
{% if pl %} Planting: {{ pl.name }}{% if pl.year_value %} ({{ pl.year_value }}){% endif %} {% if pl.status and pl.status != 'planted' %}{{ pl.status }}{% endif %} {% else %} Not attached to a planting {% endif %}
{% if pl %} {{ group_label }}{% if pl.year_value %} ({{ pl.year_value }}){% endif %} {% else %}—{% endif %} {% if p.status %}{{ p.status }}{% endif %} {% if qty_int > 0 %} {% else %} {% endif %} 💬
{% for p in plants %}
{% endfor %}
{% endif %} {% if enriched_children %}

Sub-areas

{% endif %}

Overview history

{{ area.notes or '+ add overview' }}
L: {{ area.length_ft|round(2)|int if (area.length_ft and area.length_ft == area.length_ft|int) else (area.length_ft or 0) }} ft W: {{ area.width_ft|round(2)|int if (area.width_ft and area.width_ft == area.width_ft|int) else (area.width_ft or 0) }} ft Garden: {{ area.garden_area_sqft|round(2)|int if (area.garden_area_sqft and area.garden_area_sqft == area.garden_area_sqft|int) else (area.garden_area_sqft or 0) }} sq ft

Structure & features

{{ area.structure_features or '+ add' }}

Sunlight

{{ area.sunlight or '+ add' }}

Soil & environment

{{ area.soil_environment or '+ add' }}
{% if summary.total_qty %}
{{ summary.total_qty }} plant{{ '' if summary.total_qty == 1 else 's' }} {% if summary.variety_count %}{{ summary.variety_count }} variet{{ 'y' if summary.variety_count == 1 else 'ies' }}{% endif %} {% if summary.species_count %}{{ summary.species_count }} species{% endif %} {% if summary.planting_count %}{{ summary.planting_count }} planting{{ '' if summary.planting_count == 1 else 's' }}{% endif %}
{% endif %} {% if stations %}

Watering stations serving this area

{% endif %} {% if summary.plant_list and enriched_children %}

Plants (all sub-areas)

{% for p in summary.plant_list %} {% endfor %}
Species Variety Qty
{{ p.species }} {{ p.variety }} {{ p.qty }}
Total {{ summary.total_qty }}
{% endif %} {% if not enriched_children and not summary.total_qty and not stations %}

This area is empty. Add a sub-area or attach a watering station.

{% endif %} {{ render_comments(area_comments, 'area', area.id, '/areas/' ~ area.id, include_children=include_children, include_related=include_related, supports_children=supports_children) }} {% if plants %}

Move plants

Moving a partial amount splits the plant group. The planting stays the same.

{% endif %}
{% endblock %} {% block scripts %} {% if plants %} {% endif %} {% endblock %}