From 304f4c6d7e123483d66bf893df47a01c3440ac75 Mon Sep 17 00:00:00 2001 From: Mike Shoup Date: Thu, 11 Jul 2019 11:59:55 -0600 Subject: [PATCH] Add sort to fermentables --- src/humulus/templates/recipes/_macros.html | 2 +- src/humulus/templates/recipes/info.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/humulus/templates/recipes/_macros.html b/src/humulus/templates/recipes/_macros.html index 6b04beb..4214e74 100644 --- a/src/humulus/templates/recipes/_macros.html +++ b/src/humulus/templates/recipes/_macros.html @@ -51,7 +51,7 @@ function getSpecsURL() { -#}

Fermentables

- {% for fermentable in form.fermentables %} + {% for fermentable in form.fermentables|sort(attribute='amount.data', reverse=True) %}
diff --git a/src/humulus/templates/recipes/info.html b/src/humulus/templates/recipes/info.html index 368e282..c00ebf9 100644 --- a/src/humulus/templates/recipes/info.html +++ b/src/humulus/templates/recipes/info.html @@ -124,7 +124,7 @@ Color - {%- for fermentable in recipe.fermentables -%} + {%- for fermentable in recipe.fermentables|sort(attribute='amount', reverse=True) -%} {{ fermentable.name }} {{ fermentable.amount|float|round(2) }} lb.