From fb90f430125cbad421ab26f6309b84eca734f59f Mon Sep 17 00:00:00 2001 From: Yash Karandikar Date: Sat, 9 Apr 2022 22:45:23 -0500 Subject: [PATCH] Refactor template to use macros --- templates/task.html | 37 +++++++++++++++++++------------------ templates/task_page.html | 3 ++- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/templates/task.html b/templates/task.html index fa1a013..4fd3e2f 100644 --- a/templates/task.html +++ b/templates/task.html @@ -1,20 +1,21 @@ -

{{task_title}}

-
- +{% macro task(task_title, task_date, status, assignee, description) %} +

{{task_title}}

+
+ -
-{{description}} -
- - - +
+ {{description}} +
+ + +{% endmacro task %} diff --git a/templates/task_page.html b/templates/task_page.html index 6caeee2..d7e4798 100644 --- a/templates/task_page.html +++ b/templates/task_page.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% import "task.html" as task_macro %} {% block content %} @@ -22,7 +23,7 @@ navbar
{% for task in tasks %} - {% include "task.html" %} + {{ task_macro::task(task_title="TODO", task_date="01-01-1970", status="TODO", assignee="TODO", description="description") }} {% endfor %} {% endblock content %} -- 2.37.1