{% block alert %} {% for category, message in get_flashed_messages(with_categories=true) %} diff --git a/src/humulus/templates/_macros.html b/src/humulus/templates/_macros.html index 889274f..8ce57ea 100644 --- a/src/humulus/templates/_macros.html +++ b/src/humulus/templates/_macros.html @@ -70,3 +70,10 @@ {% endmacro %} + +{# + Write javascript to use momentjs to display a timestamp. +#} +{% macro moment(timestamp, format="llll") %} + +{% endmacro %} diff --git a/src/humulus/templates/recipes/info.html b/src/humulus/templates/recipes/info.html index 0360891..2046416 100644 --- a/src/humulus/templates/recipes/info.html +++ b/src/humulus/templates/recipes/info.html @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. -#} -{% from "_macros.html" import render_field_with_errors, render_delete_button, render_delete_modal %} +{% from "_macros.html" import render_field_with_errors, render_delete_button, render_delete_modal, moment %} {% extends '_base.html' %} {% block title %}{{ recipe.name }}{% endblock %} @@ -25,14 +25,28 @@ Recipe Details -#}

Details

-
-
-
Batch Efficiency
-
{{ recipe.efficiency|int }}%
-
Batch Volume
-
{{ recipe.volume|float|round(1) }} gal.
-
-
+
+
+
+
Batch Efficiency
+
{{ recipe.efficiency|int }}%
+
Batch Volume
+
{{ recipe.volume|float|round(1) }} gal.
+
+
+
+
+ {% if 'created' in recipe %} +
Created
+
{{ moment(recipe.created) }}
+ {% endif %} + {% if 'updated' in recipe %} +
Updated
+
{{ moment(recipe.updated) }}
+ {% endif %} +
+
+
{#- Fermentables -#}