mirror of
https://github.com/ferdzo/serviceCRM.git
synced 2026-04-05 05:06:25 +00:00
a
This commit is contained in:
20
serviceCRM/templates/serviceCRM/Insert_list.html
Normal file
20
serviceCRM/templates/serviceCRM/Insert_list.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
<!-- Load dependencies -->
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
|
||||||
|
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
|
||||||
|
crossorigin="anonymous"></script>
|
||||||
|
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
|
||||||
|
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
|
||||||
|
|
||||||
|
<!-- Load js for initializing tables via their server-side options -->
|
||||||
|
<script type="text/javascript" charset="utf8" src="{% static 'js/datatableview.js' %}"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
datatableview.initialize($('.datatable'));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Render the table skeleton, includes the .datatable class for the on-ready initializer. -->
|
||||||
|
{{ datatable }}
|
||||||
@@ -26,5 +26,6 @@ urlpatterns = [
|
|||||||
path("nalog/<int:id>/", view.Nalog, name="nalog"),
|
path("nalog/<int:id>/", view.Nalog, name="nalog"),
|
||||||
path("delete/<int:id>/", view.Delete.Delete, name="delete"),
|
path("delete/<int:id>/", view.Delete.Delete, name="delete"),
|
||||||
path("done/", view.Done.as_view(), name="done"),
|
path("done/", view.Done.as_view(), name="done"),
|
||||||
path("done/<int:id>/", view.Done.done_by_id, name="done")
|
path("done/<int:id>/", view.Done.done_by_id, name="done"),
|
||||||
|
path("datatable/", view.DatatableView.as_view(), name="datatable"),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from .forms import InputForm
|
|||||||
from .models import Insert
|
from .models import Insert
|
||||||
from .tables import DoneInsertTable, InsertTable
|
from .tables import DoneInsertTable, InsertTable
|
||||||
from django_tables2 import SingleTableView
|
from django_tables2 import SingleTableView
|
||||||
|
from datatableview.views import DatatableView
|
||||||
|
|
||||||
class InsertListView(SingleTableView):
|
class InsertListView(SingleTableView):
|
||||||
model = Insert
|
model = Insert
|
||||||
@@ -62,3 +62,8 @@ class Delete():
|
|||||||
req = get_object_or_404(Insert, id=id)
|
req = get_object_or_404(Insert, id=id)
|
||||||
req.delete()
|
req.delete()
|
||||||
return HttpResponseRedirect("/")
|
return HttpResponseRedirect("/")
|
||||||
|
|
||||||
|
class DatatableView(DatatableView):
|
||||||
|
model = Insert
|
||||||
|
template_name = 'serviceCRM/Insert_list.html'
|
||||||
|
|
||||||
Reference in New Issue
Block a user