Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1606875806-practice
Commits
0fa3ea75
Commit
0fa3ea75
authored
Dec 23, 2019
by
Izzan Fakhril Islam
Browse files
implement delete todo on frontend
parent
d6d5d0f7
Pipeline
#28258
passed with stages
in 20 minutes and 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tutorial_7/templates/tutorial_7.html
View file @
0fa3ea75
...
...
@@ -52,11 +52,13 @@
<tr>
<th><h5><b>
Date/Time
</b></h5></th>
<th><h5><b>
Todo
</b></h5></th>
<th><h5><b>
Action
</b></h5></th>
</tr>
{% for todos in todos_dict %}
<tr>
<td>
{{ todos.date }}
</td>
<td>
{{ todos.todo_list }}
</td>
<td><button
class=
"btn-danger"
><a
id=
"id_logout"
style=
"color: white"
href=
"{% url 'tutorial-7:delete_todo' todos.id %}"
>
Delete
</a></button></td>
</tr>
{% endfor %}
</table>
...
...
tutorial_7/urls.py
View file @
0fa3ea75
from
django.conf.urls
import
url
from
.views
import
index
,
login
,
logout
,
add_todo
,
add_todo_commentary
,
send_login_email
from
.views
import
index
,
login
,
logout
,
add_todo
,
add_todo_commentary
,
send_login_email
,
delete_todo
urlpatterns
=
[
url
(
r
'^$'
,
index
,
name
=
'index'
),
...
...
@@ -7,6 +7,7 @@ urlpatterns = [
url
(
r
'add_todo_commentary/$'
,
add_todo_commentary
,
name
=
'add_todo_commentary'
),
url
(
r
'^send_email$'
,
send_login_email
,
name
=
'send_login_email'
),
url
(
r
'^login$'
,
login
,
name
=
'login'
),
url
(
r
'^logout$'
,
logout
,
name
=
'logout'
)
url
(
r
'^logout$'
,
logout
,
name
=
'logout'
),
url
(
r
'^(?P<id>[0-9]+)/delete/$'
,
delete_todo
,
name
=
'delete_todo'
),
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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