Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add style modification in rows in datatable

  • Loading branch information...
commit 6817350b6577139cb611153492b4327a4aaef541 1 parent 153fece
predatell predatell authored
8 src/ets/static/css/changes.css
View
@@ -72,4 +72,12 @@ dl.warehouse-list dd {
.paging_two_button a:hover {
cursor: pointer;
+}
+
+.red {
+ color: red;
+}
+
+.row-negative-units {
+ opacity: 0.2;
}
11 src/ets/templates/stock/stocklist.html
View
@@ -40,7 +40,16 @@
"aaSorting": [[ 4, "desc" ]],
"bProcessing": true,
"bServerSide": true,
- "sAjaxSource": "{% url table_stock_items param_name='wh_id' %}?wh_id="+$(this).attr("id")
+ "sAjaxSource": "{% url table_stock_items param_name='wh_id' %}?wh_id="+$(this).attr("id"),
+ "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
+ if ( aData[3] != "{{ good_quality }}" ) {
+ nRow.className +=' red';
+ };
+ if ( aData[4] <= 0 ) {
+ nRow.className +=' row-negative-units';
+ }
+ return nRow;
+ },
});
});
});
3  src/ets/views.py
View
@@ -447,7 +447,8 @@ def stock_items(request, template_name, queryset):
"""Listing of stock items splitted by warehouses."""
if not request.user.has_perm("ets.stockitem_api_full_access"):
queryset = queryset.filter(Q(persons__pk=request.user.pk) | Q(compas__officers=request.user))
- return object_list(request, queryset, paginate_by=5, template_name=template_name)
+ return object_list(request, queryset, paginate_by=5, template_name=template_name,
+ extra_context={ "good_quality": "Good" })
def table_stock_items(request, param_name):
warehouse_pk = request.GET.get(param_name)
Please sign in to comment.
Something went wrong with that request. Please try again.