Fakultas Ilmu Komputer UI

Commit 4ca9ffc5 authored by Syahrul Ardiansyah's avatar Syahrul Ardiansyah
Browse files

refactor templates to use a base template

parent a3f040e4
<html>
<head>
<title>To-Do lists</title>
</head>
<body>
<h1>{% block header_text %}{% endblock %}</h1>
<h2>{% block header2_text %}{% endblock %}</h2>
<h3>{% block header3_text %}{% endblock %}</h3>
<form method="POST" action="{% block form_action %}{% endblock %}">
<input
name="item_text"
id="id_new_item"
placeholder="Enter a to-do item"
/>
{% csrf_token %}
</form>
{% block table %} {% endblock %}
</body>
</html>
<html>
<head>
<title>To-Do lists</title>
</head>
<body>
<h1>Syahrul Findi Ardiansyah</h1>
<h2>1506757352</h2>
<h3>My To-Do Lists</h3>
<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">
{% for item in items %}
<tr>
<td>{{ forloop.counter }}: {{ item.text }}</td>
</tr>
{% endfor %}
</table>
{% extends 'base.html' %} {% block header_text %}Syahrul Findi Ardiansyah{%
endblock %} {% block header2_text %}1506757352{% endblock %} {% block
header3_text %}My To-Do Lists{% endblock %} {% block table %}
<table id="id_list_table">
{% for item in items %}
<tr>
<td>{{ forloop.counter }}: {{ item.text }}</td>
</tr>
{% endfor %}
</table>
{% if items|length > 5 %}
<p id="comment">oh tidak</p>
{% elif items|length > 0 %}
<p id="comment">sibuk tapi santai</p>
{% else %}
<p id="comment">yey, waktunya berlibur</p>
{% endif %}
</body>
</html>
{% if items|length > 5 %}
<p id="comment">oh tidak</p>
{% elif items|length > 0 %}
<p id="comment">sibuk tapi santai</p>
{% else %}
<p id="comment">yey, waktunya berlibur</p>
{% endif %} {% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment