From f06bfa6ce485392a4bba5e66e6472630dcc6683b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 3 Jan 2022 11:03:21 +0300 Subject: Include template to get rid of repetitive template code Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * The generation of input elements that relate to the traits is very similar, therefore this commit pulls it out into a separate template that can be included where needed. --- .../wqflask/templates/partial_correlations.html | 30 ++++------------------ wqflask/wqflask/templates/with-trait-items.html | 18 +++++++++++++ 2 files changed, 23 insertions(+), 25 deletions(-) create mode 100644 wqflask/wqflask/templates/with-trait-items.html diff --git a/wqflask/wqflask/templates/partial_correlations.html b/wqflask/wqflask/templates/partial_correlations.html index 800222ba..c565d4bf 100644 --- a/wqflask/wqflask/templates/partial_correlations.html +++ b/wqflask/wqflask/templates/partial_correlations.html @@ -24,18 +24,8 @@ {%if step == "select-primary":%}

Please select the primary trait (X)

- {%for trait in traits_list:%} -
- - -
- {%endfor%} + {%include "with-trait-items.html" %} + @@ -46,20 +36,10 @@ {%if step == "select-controls":%}

Select a maximum of three (3) control traits (Z)

- {%for trait in traits_list:%} -
- - -
- {%endfor%} + {%include "with-trait-items.html" %} + {%endif%} diff --git a/wqflask/wqflask/templates/with-trait-items.html b/wqflask/wqflask/templates/with-trait-items.html new file mode 100644 index 00000000..66d6fd22 --- /dev/null +++ b/wqflask/wqflask/templates/with-trait-items.html @@ -0,0 +1,18 @@ +{%for trait in traits_list:%} +
+ + +
+{%endfor%} -- cgit v1.2.3