From d65de5e8ce6168e4ff7b4bdb1561abf92253b269 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 11 Mar 2026 18:29:25 -0500 Subject: [PATCH 1/3] fix: include LogQuantity changes when viewing Log revision --- src/wuttafarm/web/views/logs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wuttafarm/web/views/logs.py b/src/wuttafarm/web/views/logs.py index 3d91ba1..2a4e6e0 100644 --- a/src/wuttafarm/web/views/logs.py +++ b/src/wuttafarm/web/views/logs.py @@ -491,6 +491,7 @@ class LogMasterView(WuttaFarmMasterView): return super().get_version_joins() + [ model.Log, (model.LogAsset, "log_uuid", "uuid"), + (model.LogQuantity, "log_uuid", "uuid"), ] From eee2a1df65ffc6d4b46c63322924b91fdd8719a3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 14 Mar 2026 22:38:30 -0500 Subject: [PATCH 2/3] feat: show basic map for "fixed" assets this is just to get our foot in the door so to speak. not sure yet how sophisticated this map needs to be etc. but thought it would be nice to at least show something..since the data is available --- .../web/templates/assets/master/view.mako | 71 ++++++++++++++++++- src/wuttafarm/web/templates/base.mako | 10 +++ src/wuttafarm/web/views/assets.py | 31 ++++++++ 3 files changed, 111 insertions(+), 1 deletion(-) diff --git a/src/wuttafarm/web/templates/assets/master/view.mako b/src/wuttafarm/web/templates/assets/master/view.mako index dac5a1c..5b7b822 100644 --- a/src/wuttafarm/web/templates/assets/master/view.mako +++ b/src/wuttafarm/web/templates/assets/master/view.mako @@ -10,5 +10,74 @@ % endif - ${parent.page_content()} +
+ + ## main form +
+ ${parent.page_content()} +
+ + ## location map + % if map_polygon: +
+ % endif + +
+ + + +<%def name="modify_vue_vars()"> + ${parent.modify_vue_vars()} + % if map_polygon: + + % endif diff --git a/src/wuttafarm/web/templates/base.mako b/src/wuttafarm/web/templates/base.mako index b28b52f..caa5c67 100644 --- a/src/wuttafarm/web/templates/base.mako +++ b/src/wuttafarm/web/templates/base.mako @@ -1,6 +1,16 @@ <%inherit file="wuttaweb:templates/base.mako" /> <%namespace file="/wuttafarm-components.mako" import="make_wuttafarm_components" /> +<%def name="head_tags()"> + ${parent.head_tags()} + + ## TODO: this likely does not belong in the base template, and should be + ## included per template where actually needed. but this is easier for now. + + + + + <%def name="index_title_controls()"> ${parent.index_title_controls()} diff --git a/src/wuttafarm/web/views/assets.py b/src/wuttafarm/web/views/assets.py index 64f4dbc..35c3b21 100644 --- a/src/wuttafarm/web/views/assets.py +++ b/src/wuttafarm/web/views/assets.py @@ -23,6 +23,7 @@ Master view for Assets """ +import re from collections import OrderedDict from webhelpers2.html import tags @@ -359,6 +360,36 @@ class AssetMasterView(WuttaFarmMasterView): return buttons + def get_template_context(self, context): + context = super().get_template_context(context) + + if self.viewing: + asset = context["instance"] + + # add location geometry if applicable + if asset.is_fixed and asset.farmos_uuid and not self.app.is_standalone(): + + # TODO: eventually sync GIS data, avoid this API call? + client = get_farmos_client_for_user(self.request) + result = client.asset.get_id(asset.asset_type, asset.farmos_uuid) + geometry = result["data"]["attributes"]["intrinsic_geometry"] + + context["map_center"] = [geometry["lon"], geometry["lat"]] + + context["map_bounds"] = [ + [geometry["left"], geometry["bottom"]], + [geometry["right"], geometry["top"]], + ] + + if match := re.match( + r"^POLYGON \(\((?P[^\)]+)\)\)$", geometry["value"] + ): + points = match.group("points").split(", ") + points = [[float(pt) for pt in pair.split(" ")] for pair in points] + context["map_polygon"] = [points] + + return context + def get_version_joins(self): """ We override this to declare the relationship between the From f9d9923acf34de92c957d6be895a484175c96bfb Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 15 Mar 2026 10:08:27 -0500 Subject: [PATCH 3/3] =?UTF-8?q?bump:=20version=200.10.0=20=E2=86=92=200.11?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ++++++++++ pyproject.toml | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c85559..4ee6b10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to WuttaFarm will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## v0.11.0 (2026-03-15) + +### Feat + +- show basic map for "fixed" assets + +### Fix + +- include LogQuantity changes when viewing Log revision + ## v0.10.0 (2026-03-11) ### Feat diff --git a/pyproject.toml b/pyproject.toml index 7fdd859..c1a5cc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "WuttaFarm" -version = "0.10.0" +version = "0.11.0" description = "Web app to integrate with and extend farmOS" readme = "README.md" authors = [ @@ -34,7 +34,7 @@ dependencies = [ "pyramid_exclog", "uvicorn[standard]", "WuttaSync", - "WuttaWeb[continuum]>=0.29.2", + "WuttaWeb[continuum]>=0.29.3", ]