Skip to content

Commit

Permalink
fix: more fields in datatables
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Mar 11, 2024
1 parent 31c5cf5 commit ee7987a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
26 changes: 22 additions & 4 deletions good_delivery/templates/datatables/datatable_script.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,45 @@
targets: [0],
visible: false,
} ,
{
targets: [ 1 ],
className: "min-mobile-p",
orderable: true,
},
{
targets: [ 2 ],
className: "min-mobile-p",
orderable: true,
render: function ( data, type, row ) {
return data||"-";
}
},
{

targets: [ 1 ],
targets: [ 3 ],
orderable: false,
className: "min-mobile-p",
render: function ( data, type, row ) {
return "<a href='"+ back_url + row[0] +"'><span style='word-break: break-word;'>"+escapeHtml(data)+"</span></a>";
}
} ,
{
targets: [ 2 ],
targets: [ 4 ],
className: "desktop",
orderable: false,
},
{
targets: [ 3 ],
targets: [ 5 ],
className: "desktop",
orderable: false,
},
{
targets: [ 4 ],
targets: [ 6 ],
className: "desktop",
visible: false,
},
{
targets: [ 7 ],
className: "desktop",
orderable: false,
},
Expand Down
5 changes: 4 additions & 1 deletion good_delivery/templates/datatables/table_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
{% load static %}

<form method="post">
<div>
<div class="table-responsive">
<table class="table table-striped table-hover datatable-responsive-serverside">
<!--id="ticketTable"-->
<thead>
<tr>
<th></th>
<th>{% trans "Data inserimento" %}</th>
<th>{% trans "Data di consegna" %}</th>
<th>{% trans "Utente" %}</th>
<th>{% trans "Punto di consegna scelto" %}</th>
<th>{% trans "Punto di consegna" %}</th>
<th></th>
<th>{% trans "Stato" %}</th>
</tr>
</thead>
Expand Down
5 changes: 3 additions & 2 deletions good_delivery/views_datatables.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
from good_delivery.models import *


_columns = ['pk', 'delivered_to', 'choosen_delivery_point', 'delivery_point',
'state']
_columns = ['pk', 'create', 'delivery_date', 'delivered_to',
'choosen_delivery_point', 'delivery_point',
'notes','state']


class UsersDeliveryPointDTD(DjangoDatatablesServerProc):
Expand Down

0 comments on commit ee7987a

Please sign in to comment.