Add room size input in meters alongside centimeters

The floor plan form and the designer accept a room size like "4 x 3"
(meters), show dimensions in meters on the plan edges, in the table,
detail page and tooltips, and display the floor area.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-11-04 12:37:15 +01:00
1 parent 53ffda1773
commit ab8ab7ed61
10 files changed
+152 -14

No files matched your search

+6 -1
View File
@@ -11,6 +11,7 @@ from . import filtersets, forms, tables
from .choices import ItemTypeChoices
from .models import FloorPlan
from .strings import get_js_strings
from .utils import format_meters, format_room_size
def floorplans_queryset():
@@ -66,7 +67,11 @@ class FloorPlanView(generic.ObjectView):
queryset = floorplans_queryset()
def get_extra_context(self, request, instance):
return {'designer_config': designer_config(request, instance, 'view')}
return {
'designer_config': designer_config(request, instance, 'view'),
'room_size': format_room_size(instance.width, instance.depth),
'floor_area': format_meters(instance.width * instance.depth / 100),
}
@register_model_view(FloorPlan, 'designer', path='designer')