From df46967fd6357b5cfc75f3ac965b98603b26d4fe Mon Sep 17 00:00:00 2001 From: Dwi Nanda Susanto <dwi.nanda@ui.ac.id> Date: Wed, 25 Sep 2019 20:25:02 +0700 Subject: [PATCH] adding custom comement when the to do list items such in several condition --- lists/templates/home.html | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/lists/templates/home.html b/lists/templates/home.html index b9997fb..66831d5 100644 --- a/lists/templates/home.html +++ b/lists/templates/home.html @@ -1,18 +1,28 @@ <html> - <head> - <title>To-Do lists</title> - </head> - <body> - <h1>Your To-Do list</h1> - <form method="POST"> - <input name="item_text" id="id_new_item" placeholder="Enter a to-do item" /> - {% csrf_token %} - </form> + <head> + <title>To-Do</title> + </head> + <body> + <h1>Dwi Nanda Susanto - 1506722720 - To-Do List</h1> + <form method="POST"> + <input name="item_text" id="id_new_item" placeholder="Enter a to-do item" /> + {% csrf_token %} + </form> - <table id="id_list_table"> + <table id="id_list_table"> {% for item in items %} - <tr><td>{{ forloop.counter }}: {{ item.text }}</td></tr> + <tr> + <td>{{ forloop.counter }}: {{ item.text }}</td> + </tr> {% endfor %} - </table> - </body> + </table> + + {% if items|length < 1 %} + <h3 style="color:green;">yey, waktunya berlibur</h3> + {% elif items|length > 0 and items|length < 5 %} + <h3 style="color:blue;">sibuk tapi santai</h3> + {% else %} + <h3 style="color:red;">oh tidak</h3> + {% endif %} + </body> </html> -- GitLab