2019-03-26 06:19:11 +00:00
|
|
|
from django.conf import settings
|
2018-02-03 08:09:23 +00:00
|
|
|
from django.urls import path
|
|
|
|
|
2016-01-07 07:44:57 +00:00
|
|
|
from todo import views
|
2019-03-11 07:04:19 +00:00
|
|
|
from todo.features import HAS_TASK_MERGE
|
2018-02-03 08:09:23 +00:00
|
|
|
|
2019-04-12 07:09:01 +00:00
|
|
|
app_name = "todo"
|
2018-03-16 06:16:33 +00:00
|
|
|
|
2019-03-11 07:04:19 +00:00
|
|
|
urlpatterns = [
|
2019-04-12 07:09:01 +00:00
|
|
|
path("", views.list_lists, name="lists"),
|
2018-03-16 06:16:33 +00:00
|
|
|
# View reorder_tasks is only called by JQuery for drag/drop task ordering.
|
2019-04-12 07:09:01 +00:00
|
|
|
path("reorder_tasks/", views.reorder_tasks, name="reorder_tasks"),
|
2018-03-16 06:16:33 +00:00
|
|
|
# Allow users to post tasks from outside django-todo (e.g. for filing tickets - see docs)
|
2019-04-12 07:09:01 +00:00
|
|
|
path("ticket/add/", views.external_add, name="external_add"),
|
2018-02-04 08:35:04 +00:00
|
|
|
# Three paths into `list_detail` view
|
2019-04-12 07:09:01 +00:00
|
|
|
path("mine/", views.list_detail, {"list_slug": "mine"}, name="mine"),
|
2018-02-10 08:26:19 +00:00
|
|
|
path(
|
2019-04-12 07:09:01 +00:00
|
|
|
"<int:list_id>/<str:list_slug>/completed/",
|
2018-02-10 08:26:19 +00:00
|
|
|
views.list_detail,
|
2019-04-12 07:09:01 +00:00
|
|
|
{"view_completed": True},
|
|
|
|
name="list_detail_completed",
|
|
|
|
),
|
|
|
|
path("<int:list_id>/<str:list_slug>/", views.list_detail, name="list_detail"),
|
|
|
|
path("<int:list_id>/<str:list_slug>/delete/", views.del_list, name="del_list"),
|
|
|
|
path("add_list/", views.add_list, name="add_list"),
|
|
|
|
path("task/<int:task_id>/", views.task_detail, name="task_detail"),
|
|
|
|
path(
|
|
|
|
"attachment/remove/<int:attachment_id>/", views.remove_attachment, name="remove_attachment"
|
|
|
|
),
|
2019-03-11 07:04:19 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
if HAS_TASK_MERGE:
|
2019-03-26 06:19:11 +00:00
|
|
|
# ensure mail tracker autocomplete is optional
|
2019-03-11 07:04:19 +00:00
|
|
|
from todo.views.task_autocomplete import TaskAutocomplete
|
2019-04-12 07:09:01 +00:00
|
|
|
|
2019-03-11 07:04:19 +00:00
|
|
|
urlpatterns.append(
|
|
|
|
path(
|
2019-04-12 07:09:01 +00:00
|
|
|
"task/<int:task_id>/autocomplete/", TaskAutocomplete.as_view(), name="task_autocomplete"
|
|
|
|
)
|
2019-03-11 07:04:19 +00:00
|
|
|
)
|
2018-02-04 08:35:04 +00:00
|
|
|
|
2019-04-12 07:09:01 +00:00
|
|
|
urlpatterns.extend(
|
|
|
|
[
|
|
|
|
path("toggle_done/<int:task_id>/", views.toggle_done, name="task_toggle_done"),
|
|
|
|
path("delete/<int:task_id>/", views.delete_task, name="delete_task"),
|
|
|
|
path("search/", views.search, name="search"),
|
|
|
|
path("import_csv/", views.import_csv, name="import_csv"),
|
|
|
|
]
|
|
|
|
)
|