{% extends "base.html" %} {% block title %}{{ area.name }} — Layout{% endblock %} {% block head %} {% endblock %} {% block content %}
{{ area.name }}
Tap a plant or inventory tile to select.
{# Grid. Three densities so layout has a clear sense of scale + a snap target for the press-and-drag placement gesture: - 6" (0.5 ft) snap grid — dotted - 1' grid — solid - 5' major grid — solid, slightly more opaque Iterates in half-foot steps; even indices = integer feet. Loop bound `(L * 2)|int + 1` covers fractional area sizes (e.g. a 4.5 ft area still gets a line at y=4.0). Earlier `(L|int) * 2` silently dropped the final lines when L wasn't an integer. #} {% for i in range(1, (L * 2)|int + 1) %} {%- set is_foot = (i % 2 == 0) -%} {%- set is_major = is_foot and ((i // 2) % 5 == 0) -%} {% endfor %} {% for j in range(1, (W * 2)|int + 1) %} {%- set is_foot = (j % 2 == 0) -%} {%- set is_major = is_foot and ((j // 2) % 5 == 0) -%} {% endfor %} {# Empty-canvas tap target — placement happens here #} {# Placed plant icons (axis-aligned; no inner rotation) #} {% for icon in placed_icons %} {% if icon.icon.type == 'emoji' %} {{ icon.icon.char }} {% else %} {% endif %} {% if icon.plant_count > 1 %} {{ icon.plant_count }} {% endif %} {% endfor %} {# Compass mini overlay — rotates by -(viewRotation) - compassRot so N always points to true north regardless of view rotation. #}
{# Pool: inventory (this area's attached plants) — placing pops from queue and updates positions only. Send-back pushes back onto the queue. #}
{% for tile in inventory_tiles %}
{% if tile.status in ('unplanted', 'idea') %} {% endif %}
{% else %}
No plant_groups in this area yet. Switch to Unplanted or Ideas to place from the global pool.
{% endfor %}
{# Pool: unplanted (global) — placing attaches the plant to this area (POST /api/plants/{id}/attach-to-area). #} {# Pool: idea (global) — same as unplanted but status='idea'. #}
{% endblock %} {% block scripts %} {% endblock %}