[ui] [listviews] indicators

This commit is contained in:
Rushabh Mehta
2015-01-06 18:08:44 +05:30
parent 50d7e8cf8f
commit 738d4ef5c8
30 changed files with 787 additions and 1011 deletions

View File

@@ -53,7 +53,7 @@
"fieldname": "customer_name",
"fieldtype": "Data",
"hidden": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Customer Name",
"permlevel": 0,
"read_only": 1
@@ -531,6 +531,7 @@
{
"fieldname": "grand_total_export",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
"no_copy": 0,
"oldfieldname": "grand_total_export",
@@ -1013,7 +1014,7 @@
"idx": 1,
"in_create": 0,
"is_submittable": 1,
"modified": "2015-01-05 15:51:31.663904",
"modified": "2015-01-06 17:34:32.623408",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",

View File

@@ -1,28 +0,0 @@
<div class="row" style="max-height: 30px;">
<div class="col-xs-8">
<div class="text-ellipsis">
{%= list.get_avatar_and_id(doc) %}
{% if(doc.transporter_name) { %}
<span style="margin-right: 8px;"
title="{%= doc.transporter_name %}" class="filterable"
data-filter="transporter_name,=,{%= doc.transporter_name %}">
<i class="icon-truck text-muted"></i>
</span>
{% } %}
</div>
</div>
<div class="col-sm-2 hidden-xs">
{% if(doc.docstatus===0) { %}
<span class="indicator red filterable"
data-filter="docstatus,=,0">{%= __("Draft") %}</span>
{% } else if(doc.docstatus===1) { %}
<span class="indicator blue filterable"
data-filter="docstatus,=,1">{%= __("Delivered") %}</span>
{% } %}
</div>
<div class="col-sm-2 hidden-xs text-right">
<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_export') %}">
{%= doc.get_formatted("grand_total_export") %}
</div>
</div>
</div>

View File

@@ -113,6 +113,7 @@
{
"fieldname": "requested_by",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Requested For",
"permlevel": 0
},
@@ -157,7 +158,7 @@
"fieldname": "status",
"fieldtype": "Select",
"in_filter": 1,
"in_list_view": 1,
"in_list_view": 0,
"label": "Status",
"no_copy": 1,
"oldfieldname": "status",
@@ -195,7 +196,7 @@
"description": "% of materials ordered against this Material Request",
"fieldname": "per_ordered",
"fieldtype": "Percent",
"in_list_view": 1,
"in_list_view": 0,
"label": "% Completed",
"no_copy": 1,
"oldfieldname": "per_ordered",
@@ -235,7 +236,7 @@
"icon": "icon-ticket",
"idx": 1,
"is_submittable": 1,
"modified": "2015-01-05 15:17:13.466750",
"modified": "2015-01-06 17:38:12.250644",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request",

View File

@@ -1,20 +0,0 @@
<div class="row" style="max-height: 30px;">
<div class="col-sm-10 col-xs-12 text-ellipsis">
{%= list.get_avatar_and_id(doc) %}
</div>
<div class="col-sm-2 hidden-xs">
{% if(doc.status=="Draft") { %}
<span class="indicator red filterable"
data-filter="status,=,{%= doc.status %}">{%= doc.status %}</span>
{% } else if(doc.status=="Submitted" && doc.per_ordered < 100) { %}
<span class="indicator orange filterable"
data-filter="per_ordered,<,100">{%= __("Pending") %}</span>
{% } else if(doc.status=="Submitted" && doc.per_ordered == 100) { %}
<span class="indicator blue filterable"
data-filter="per_ordered,=,100">{%= __("Completed") %}</span>
{% } else if(doc.status=="Stopped") { %}
<span class="indicator red filterable"
data-filter="status,=,Stopped">{%= __("Stopped") %}</span>
{% } %}
</div>
</div>

View File

@@ -1,4 +1,13 @@
frappe.listview_settings['Material Request'] = {
add_fields: ["material_request_type", "status", "per_ordered"],
filters: [["per_ordered", "<", 100]]
filters: [["per_ordered", "<", 100]],
get_status: function(doc) {
if(doc.status=="Stopped") {
return [__("Stopped"), "red", "status,=,Stopped"];
} if(doc.docstatus==1 && doc.per_ordered < 100) {
return [__("Pending"), "orange", "per_ordered,<,100"];
} else if(doc.status==1 && doc.per_ordered == 100) {
return [__("Completed"), "green", "per_ordered,=,100"];
}
}
};

View File

@@ -53,7 +53,7 @@
"fieldname": "supplier_name",
"fieldtype": "Data",
"hidden": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Supplier Name",
"permlevel": 0,
"read_only": 1
@@ -411,6 +411,7 @@
{
"fieldname": "grand_total_import",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
"oldfieldname": "grand_total_import",
"oldfieldtype": "Currency",
@@ -766,7 +767,7 @@
"icon": "icon-truck",
"idx": 1,
"is_submittable": 1,
"modified": "2014-12-24 14:31:25.348050",
"modified": "2015-01-06 17:40:23.838112",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
@@ -844,5 +845,6 @@
"read_only_onload": 1,
"search_fields": "status, posting_date, supplier",
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"title_field": "supplier_name"
}

View File

@@ -1,34 +0,0 @@
<div class="row" style="max-height: 30px;">
<div class="col-xs-10">
<div class="text-ellipsis">
{%= list.get_avatar_and_id(doc) %}
<span style="margin-right: 8px; display: inline-block">
<span class="filterable"
data-filter="supplier,=,{%= doc.supplier %}">
{%= doc.supplier_name %}</span></span>
{% if(cint(doc.is_subcontracted)) { %}
<span style="margin-right: 8px;"
title="{%= __("Subcontracted") %}" class="filterable"
data-filter="is_subcontracted,=,Yes">
<i class="icon-cog text-muted"></i>
</span>
{% } %}
{% if(doc.transporter_name) { %}
<span style="margin-right: 8px;"
title="{%= doc.transporter_name %}" class="filterable"
data-filter="transporter_name,=,{%= doc.transporter_name %}">
<i class="icon-truck text-muted"></i>
</span>
{% } %}
{% if(doc.docstatus===0) { %}
<span class="label label-danger filterable"
data-filter="docstatus,=,0">{%= __("Draft") %}</span>
{% } %}
</div>
</div>
<div class="col-xs-2 text-right">
<div class="text-ellipsis" title="{%= doc.get_formatted('grand_total_import') %}">
{%= doc.get_formatted("grand_total_import") %}
</div>
</div>
</div>