Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1506757352-practice
Commits
4ca9ffc5
Commit
4ca9ffc5
authored
Oct 09, 2019
by
Syahrul Ardiansyah
Browse files
refactor templates to use a base template
parent
a3f040e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
latihan2/templates/base.html
0 → 100644
View file @
4ca9ffc5
<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>
latihan2/templates/home.html
View file @
4ca9ffc5
<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 %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment