refactor: Replace darkgray indicator with gray indicator
This commit is contained in:
		
							parent
							
								
									744169833c
								
							
						
					
					
						commit
						b6ebcd7559
					
				| @ -2,7 +2,7 @@ frappe.listview_settings['Payment Request'] = { | ||||
| 	add_fields: ["status"], | ||||
| 	get_indicator: function(doc) { | ||||
| 		if(doc.status == "Draft") { | ||||
| 			return [__("Draft"), "darkgray", "status,=,Draft"]; | ||||
| 			return [__("Draft"), "gray", "status,=,Draft"]; | ||||
| 		} | ||||
| 		if(doc.status == "Requested") { | ||||
| 			return [__("Requested"), "green", "status,=,Requested"]; | ||||
|  | ||||
| @ -7,19 +7,19 @@ frappe.listview_settings['Purchase Invoice'] = { | ||||
| 		"currency", "is_return", "release_date", "on_hold"], | ||||
| 	get_indicator: function(doc) { | ||||
| 		if( (flt(doc.outstanding_amount) <= 0) && doc.docstatus == 1 &&  doc.status == 'Debit Note Issued') { | ||||
| 			return [__("Debit Note Issued"), "darkgray", "outstanding_amount,<=,0"]; | ||||
| 			return [__("Debit Note Issued"), "gray", "outstanding_amount,<=,0"]; | ||||
| 		} else if(flt(doc.outstanding_amount) > 0 && doc.docstatus==1) { | ||||
| 			if(cint(doc.on_hold) && !doc.release_date) { | ||||
| 				return [__("On Hold"), "darkgray"]; | ||||
| 				return [__("On Hold"), "gray"]; | ||||
| 			} else if(cint(doc.on_hold) && doc.release_date && frappe.datetime.get_diff(doc.release_date, frappe.datetime.nowdate()) > 0) { | ||||
| 				return [__("Temporarily on Hold"), "darkgray"]; | ||||
| 				return [__("Temporarily on Hold"), "gray"]; | ||||
| 			} else if(frappe.datetime.get_diff(doc.due_date) < 0) { | ||||
| 				return [__("Overdue"), "red", "outstanding_amount,>,0|due_date,<,Today"]; | ||||
| 			} else { | ||||
| 				return [__("Unpaid"), "orange", "outstanding_amount,>,0|due_date,>=,Today"]; | ||||
| 			} | ||||
| 		} else if(cint(doc.is_return)) { | ||||
| 			return [__("Return"), "darkgray", "is_return,=,Yes"]; | ||||
| 			return [__("Return"), "gray", "is_return,=,Yes"]; | ||||
| 		} else if(flt(doc.outstanding_amount)==0 && doc.docstatus==1) { | ||||
| 			return [__("Paid"), "green", "outstanding_amount,=,0"]; | ||||
| 		} | ||||
|  | ||||
| @ -53,7 +53,7 @@ class SalesInvoice(SellingController): | ||||
| 		"""Set indicator for portal""" | ||||
| 		if self.outstanding_amount < 0: | ||||
| 			self.indicator_title = _("Credit Note Issued") | ||||
| 			self.indicator_color = "darkgray" | ||||
| 			self.indicator_color = "gray" | ||||
| 		elif self.outstanding_amount > 0 and getdate(self.due_date) >= getdate(nowdate()): | ||||
| 			self.indicator_color = "orange" | ||||
| 			self.indicator_title = _("Unpaid") | ||||
| @ -62,7 +62,7 @@ class SalesInvoice(SellingController): | ||||
| 			self.indicator_title = _("Overdue") | ||||
| 		elif cint(self.is_return) == 1: | ||||
| 			self.indicator_title = _("Return") | ||||
| 			self.indicator_color = "darkgray" | ||||
| 			self.indicator_color = "gray" | ||||
| 		else: | ||||
| 			self.indicator_color = "green" | ||||
| 			self.indicator_title = _("Paid") | ||||
|  | ||||
| @ -10,8 +10,8 @@ frappe.listview_settings['Sales Invoice'] = { | ||||
| 			"Draft": "grey", | ||||
| 			"Unpaid": "orange", | ||||
| 			"Paid": "green", | ||||
| 			"Return": "darkgray", | ||||
| 			"Credit Note Issued": "darkgray", | ||||
| 			"Return": "gray", | ||||
| 			"Credit Note Issued": "gray", | ||||
| 			"Unpaid and Discounted": "orange", | ||||
| 			"Overdue and Discounted": "red", | ||||
| 			"Overdue": "red" | ||||
|  | ||||
| @ -11,7 +11,7 @@ frappe.listview_settings['Subscription'] = { | ||||
| 		} else if(doc.status === 'Unpaid') { | ||||
| 			return [__("Unpaid"), "red"]; | ||||
| 		} else if(doc.status === 'Cancelled') { | ||||
| 			return [__("Cancelled"), "darkgray"]; | ||||
| 			return [__("Cancelled"), "gray"]; | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
| @ -4,9 +4,9 @@ frappe.listview_settings['Supplier Quotation'] = { | ||||
| 		if(doc.status==="Ordered") { | ||||
| 			return [__("Ordered"), "green", "status,=,Ordered"]; | ||||
| 		} else if(doc.status==="Rejected") { | ||||
| 			return [__("Lost"), "darkgray", "status,=,Lost"]; | ||||
| 			return [__("Lost"), "gray", "status,=,Lost"]; | ||||
| 		} else if(doc.status==="Expired") { | ||||
| 			return [__("Expired"), "darkgray", "status,=,Expired"]; | ||||
| 			return [__("Expired"), "gray", "status,=,Expired"]; | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| @ -10,7 +10,7 @@ frappe.listview_settings["Supplier Scorecard"] = { | ||||
| 		if (doc.indicator_color) { | ||||
| 			return [__(doc.status), doc.indicator_color.toLowerCase(), "status,=," + doc.status]; | ||||
| 		} else { | ||||
| 			return [__("Unknown"), "darkgray", "status,=,''"]; | ||||
| 			return [__("Unknown"), "gray", "status,=,''"]; | ||||
| 		} | ||||
| 	}, | ||||
| 
 | ||||
|  | ||||
| @ -6,7 +6,7 @@ frappe.listview_settings['Contract'] = { | ||||
|         } else if (doc.status == "Active") { | ||||
|             return [__(doc.status), "green", "status,=," + doc.status]; | ||||
|         } else if (doc.status == "Inactive") { | ||||
|             return [__(doc.status), "darkgray", "status,=," + doc.status]; | ||||
|             return [__(doc.status), "gray", "status,=," + doc.status]; | ||||
|         } | ||||
|     }, | ||||
| }; | ||||
| @ -21,7 +21,7 @@ | ||||
| 				{% elif frappe.utils.getdate(doc.admission_start_date) > today %} | ||||
| 					blue"> Application will open | ||||
| 				{% else %} | ||||
| 					darkgray | ||||
| 					gray | ||||
| 				{% endif  %} | ||||
| 	        </span> | ||||
| 		</div> | ||||
|  | ||||
| @ -11,7 +11,7 @@ | ||||
| 				{% elif frappe.utils.getdate(doc.admission_start_date) > today %} | ||||
| 					blue | ||||
| 				{% else %} | ||||
| 					darkgray | ||||
| 					gray | ||||
| 				{% endif  %} | ||||
| 				">{{ doc.title }}</span> | ||||
| 			</div> | ||||
|  | ||||
| @ -3,7 +3,7 @@ frappe.listview_settings['Employee'] = { | ||||
| 	filters: [["status","=", "Active"]], | ||||
| 	get_indicator: function(doc) { | ||||
| 		var indicator = [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status]; | ||||
| 		indicator[1] = {"Active": "green", "Temporary Leave": "red", "Left": "darkgray"}[doc.status]; | ||||
| 		indicator[1] = {"Active": "green", "Temporary Leave": "red", "Left": "gray"}[doc.status]; | ||||
| 		return indicator; | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| @ -5,7 +5,7 @@ | ||||
| frappe.listview_settings['Leave Allocation'] = { | ||||
| 	get_indicator: function(doc) { | ||||
| 		if(doc.status==="Expired") { | ||||
| 			return [__("Expired"), "darkgray", "expired, =, 1"]; | ||||
| 			return [__("Expired"), "gray", "expired, =, 1"]; | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
|  | ||||
| @ -41,7 +41,7 @@ frappe.team_updates = { | ||||
| 						me.add_row(d); | ||||
| 					}); | ||||
| 				} else { | ||||
| 					frappe.show_alert({message:__('No more updates'), indicator:'darkgray'}); | ||||
| 					frappe.show_alert({message:__('No more updates'), indicator:'gray'}); | ||||
| 					me.more.parent().addClass('hidden'); | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| @ -8,7 +8,7 @@ frappe.listview_settings['BOM'] = { | ||||
| 		} else if(doc.is_active) { | ||||
| 			return [__("Active"), "blue", "is_active,=,Yes"]; | ||||
| 		} else if(!doc.is_active) { | ||||
| 			return [__("Not active"), "darkgray", "is_active,=,No"]; | ||||
| 			return [__("Not active"), "gray", "is_active,=,No"]; | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| @ -9,8 +9,8 @@ frappe.listview_settings['Production Plan'] = { | ||||
| 				"Draft": "red", | ||||
| 				"In Process": "orange", | ||||
| 				"Completed": "green", | ||||
| 				"Material Requested": "darkgray", | ||||
| 				"Cancelled": "darkgray" | ||||
| 				"Material Requested": "gray", | ||||
| 				"Cancelled": "gray" | ||||
| 			}[doc.status], "status,=," + doc.status]; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| @ -12,7 +12,7 @@ frappe.listview_settings['Work Order'] = { | ||||
| 				"Not Started": "red", | ||||
| 				"In Process": "orange", | ||||
| 				"Completed": "green", | ||||
| 				"Cancelled": "darkgray" | ||||
| 				"Cancelled": "gray" | ||||
| 			}[doc.status], "status,=," + doc.status]; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| @ -19,7 +19,7 @@ class Quotation(SellingController): | ||||
| 			self.indicator_color = 'blue' | ||||
| 			self.indicator_title = 'Submitted' | ||||
| 		if self.valid_till and getdate(self.valid_till) < getdate(nowdate()): | ||||
| 			self.indicator_color = 'darkgray' | ||||
| 			self.indicator_color = 'gray' | ||||
| 			self.indicator_title = 'Expired' | ||||
| 
 | ||||
| 	def validate(self): | ||||
|  | ||||
| @ -20,9 +20,9 @@ frappe.listview_settings['Quotation'] = { | ||||
| 		} else if(doc.status==="Ordered") { | ||||
| 			return [__("Ordered"), "green", "status,=,Ordered"]; | ||||
| 		} else if(doc.status==="Lost") { | ||||
| 			return [__("Lost"), "darkgray", "status,=,Lost"]; | ||||
| 			return [__("Lost"), "gray", "status,=,Lost"]; | ||||
| 		} else if(doc.status==="Expired") { | ||||
| 			return [__("Expired"), "darkgray", "status,=,Expired"]; | ||||
| 			return [__("Expired"), "gray", "status,=,Expired"]; | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
|  | ||||
| @ -2,9 +2,9 @@ frappe.listview_settings['Batch'] = { | ||||
| 	add_fields: ["item", "expiry_date", "batch_qty", "disabled"], | ||||
| 	get_indicator: (doc) => { | ||||
| 		if (doc.disabled) { | ||||
| 			return [__("Disabled"), "darkgray", "disabled,=,1"]; | ||||
| 			return [__("Disabled"), "gray", "disabled,=,1"]; | ||||
| 		} else if (!doc.batch_qty) { | ||||
| 			return [__("Empty"), "darkgray", "batch_qty,=,0|disabled,=,0"]; | ||||
| 			return [__("Empty"), "gray", "batch_qty,=,0|disabled,=,0"]; | ||||
| 		} else if (doc.expiry_date && frappe.datetime.get_diff(doc.expiry_date, frappe.datetime.nowdate()) <= 0) { | ||||
| 			return [__("Expired"), "red", "expiry_date,not in,|expiry_date,<=,Today|batch_qty,>,0|disabled,=,0"] | ||||
| 		} else { | ||||
|  | ||||
| @ -3,7 +3,7 @@ frappe.listview_settings['Delivery Note'] = { | ||||
| 		"transporter_name", "grand_total", "is_return", "status", "currency"], | ||||
| 	get_indicator: function(doc) { | ||||
| 		if(cint(doc.is_return)==1) { | ||||
| 			return [__("Return"), "darkgray", "is_return,=,Yes"]; | ||||
| 			return [__("Return"), "gray", "is_return,=,Yes"]; | ||||
| 		} else if (doc.status === "Closed") { | ||||
| 			return [__("Closed"), "green", "status,=,Closed"]; | ||||
| 		} else if (flt(doc.per_billed, 2) < 100) { | ||||
|  | ||||
| @ -3,7 +3,7 @@ frappe.listview_settings['Purchase Receipt'] = { | ||||
| 		"transporter_name", "is_return", "status", "per_billed", "currency"], | ||||
| 	get_indicator: function(doc) { | ||||
| 		if(cint(doc.is_return)==1) { | ||||
| 			return [__("Return"), "darkgray", "is_return,=,Yes"]; | ||||
| 			return [__("Return"), "gray", "is_return,=,Yes"]; | ||||
| 		} else if (doc.status === "Closed") { | ||||
| 			return [__("Closed"), "green", "status,=,Closed"]; | ||||
| 		} else if (flt(doc.grand_total) !== 0 && flt(doc.per_billed, 2) < 100) { | ||||
|  | ||||
| @ -28,7 +28,7 @@ frappe.listview_settings['Issue'] = { | ||||
| 		} else if (doc.status === 'Closed') { | ||||
| 			return [__(doc.status), "green", "status,=," + doc.status]; | ||||
| 		} else { | ||||
| 			return [__(doc.status), "darkgray", "status,=," + doc.status]; | ||||
| 			return [__(doc.status), "gray", "status,=," + doc.status]; | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -2,7 +2,7 @@ | ||||
|     <a href="/addresses?name={{ doc.name | urlencode }}" class="no-underline text-reset"> | ||||
| 	    <div class="row"> | ||||
| 	        <div class="col-3"> | ||||
| 	                 <span class="indicator {{ "red" if doc.address_type=="Office" else "green" if doc.address_type=="Billing" else "blue" if doc.address_type=="Shipping" else "darkgray" }}">{{ doc.address_title }}</span> | ||||
| 	                 <span class="indicator {{ "red" if doc.address_type=="Office" else "green" if doc.address_type=="Billing" else "blue" if doc.address_type=="Shipping" else "gray" }}">{{ doc.address_title }}</span> | ||||
| 			</div> | ||||
| 			<div class="col-2"> {{ _(doc.address_type) }} </div> | ||||
| 			<div class="col-2"> {{ doc.city }} </div> | ||||
|  | ||||
| @ -2,7 +2,7 @@ | ||||
| 	<a href="/issues?name={{ doc.name }}" class="no-underline"> | ||||
| 		<div class="row py-4 border-bottom"> | ||||
| 			<div class="col-3 d-flex align-items-center"> | ||||
| 				{% set indicator = 'red' if doc.status == 'Open' else 'darkgray' %} | ||||
| 				{% set indicator = 'red' if doc.status == 'Open' else 'gray' %} | ||||
| 				{% set indicator = 'green' if doc.status == 'Closed' else indicator %} | ||||
| 				<span class="d-inline-flex indicator {{ indicator }}"></span> | ||||
| 					{{ doc.name }} | ||||
| @ -10,7 +10,7 @@ | ||||
| 			<div class="col-5 text-muted"> | ||||
| 				{{ doc.subject }}</div> | ||||
| 			<div class="col-2 d-flex align-items-center text-muted"> | ||||
| 				{% set indicator = 'red' if doc.status == 'Open' else 'darkgray' %} | ||||
| 				{% set indicator = 'red' if doc.status == 'Open' else 'gray' %} | ||||
| 				{% set indicator = 'green' if doc.status == 'Closed' else indicator %} | ||||
| 				{% set indicator = 'orange' if doc.status == 'Open' and doc.priority == 'Medium' else indicator %} | ||||
| 				{% set indicator = 'yellow' if doc.status == 'Open' and doc.priority == 'Low' else indicator %} | ||||
|  | ||||
| @ -15,7 +15,7 @@ | ||||
| 					  </div> | ||||
| 					</div> | ||||
| 				{% else %} | ||||
| 					<span class="indicator {{ "red" if doc.status=="Open" else "darkgray"  }}"> | ||||
| 					<span class="indicator {{ "red" if doc.status=="Open" else "gray"  }}"> | ||||
| 						{{ doc.status }}</span> | ||||
| 				{% endif %} | ||||
| 			</div> | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
| 		<a class="no-decoration task-link {{ task.css_seen }}" href="/tasks?name={{ task.name }}"> | ||||
| 		<div class='row project-item'> | ||||
| 			<div class='col-xs-9'> | ||||
| 				<span class="indicator {{ "red" if task.status=="Open" else "green" if task.status=="Closed" else "darkgray" }}" title="{{ task.status }}"  > {{ task.subject }}</span> | ||||
| 				<span class="indicator {{ "red" if task.status=="Open" else "green" if task.status=="Closed" else "gray" }}" title="{{ task.status }}"  > {{ task.subject }}</span> | ||||
| 	 				<div class="small text-muted item-timestamp" | ||||
| 	 					title="{{ frappe.utils.pretty_date(task.modified) }}"> | ||||
| 						{{ _("modified") }} {{ frappe.utils.pretty_date(task.modified) }} | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
| 	<a class="no-decoration timesheet-link {{ timesheet.css_seen }}" href="/timesheet/{{ timesheet.info.name}}"> | ||||
| 		<div class='row project-item'> | ||||
| 			<div class='col-xs-10'> | ||||
| 				<span class="indicator {{ "blue" if timesheet.info.status=="Submitted" else "red" if timesheet.info.status=="Draft" else "darkgray" }}" title="{{ timesheet.info.status }}"  > {{ timesheet.info.name }} </span> | ||||
| 				<span class="indicator {{ "blue" if timesheet.info.status=="Submitted" else "red" if timesheet.info.status=="Draft" else "gray" }}" title="{{ timesheet.info.status }}"  > {{ timesheet.info.name }} </span> | ||||
| 				<div class="small text-muted item-timestamp"> | ||||
| 				{{ _("From") }} {{ frappe.format_date(timesheet.from_time) }} {{ _("to") }} {{ frappe.format_date(timesheet.to_time) }} | ||||
| 			</div> | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| <div class="web-list-item transaction-list-item"> | ||||
| 	<div class="row"> | ||||
| 		<div class="col-xs-3"> | ||||
| 			<span class='indicator {{ "red" if doc.status=="Cancelled" else "green" if doc.status=="Billed" else "blue" if doc.status=="Submitted" else "darkgray" }} small'> | ||||
| 			<span class='indicator {{ "red" if doc.status=="Cancelled" else "green" if doc.status=="Billed" else "blue" if doc.status=="Submitted" else "gray" }} small'> | ||||
| 				{{ doc.name }} | ||||
| 			</span> | ||||
| 		</div> | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| <div class="web-list-item transaction-list-item"> | ||||
| 	<div class="row"> | ||||
| 		<div class="col-sm-4"> | ||||
| 			<span class="indicator small {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgray") }}"> | ||||
| 			<span class="indicator small {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "gray") }}"> | ||||
| 			{{ doc.name }}</span> | ||||
| 			<div class="small text-muted transaction-time" | ||||
| 				title="{{ frappe.utils.format_datetime(doc.modified, "medium") }}"> | ||||
|  | ||||
| @ -20,7 +20,7 @@ | ||||
| <div class="row transaction-subheading"> | ||||
| 	<div class="col-xs-6"> | ||||
| 
 | ||||
| 		<span class="indicator {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgray") }}"> | ||||
| 		<span class="indicator {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "gray") }}"> | ||||
| 			{{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }} | ||||
| 		</span> | ||||
| 	</div> | ||||
|  | ||||
| @ -34,7 +34,7 @@ | ||||
| 
 | ||||
| <div class="row transaction-subheading"> | ||||
| 	<div class="col-6"> | ||||
| 		<span class="indicator {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgray") }}"> | ||||
| 		<span class="indicator {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "gray") }}"> | ||||
| 			{{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }} | ||||
| 		</span> | ||||
| 	</div> | ||||
|  | ||||
| @ -77,13 +77,13 @@ | ||||
| 							<div class="web-list-item transaction-list-item quotations" idx="{{d.name}}"> | ||||
| 								<div class="row"> | ||||
| 									<div class="col-sm-6"> | ||||
| 										<span class="indicator darkgray">{{d.name}}</span> | ||||
| 										<span class="indicator gray">{{d.name}}</span> | ||||
| 									</div> | ||||
| 									<div class="col-sm-3"> | ||||
| 										<span class="small darkgray">{{d.status}}</span> | ||||
| 										<span class="small gray">{{d.status}}</span> | ||||
| 									</div> | ||||
| 									<div class="col-sm-3"> | ||||
| 										<span class="small darkgray">{{d.transaction_date}}</span> | ||||
| 										<span class="small gray">{{d.transaction_date}}</span> | ||||
| 									</div> | ||||
| 								</div> | ||||
| 								<a class="transaction-item-link" href="/quotations/{{d.name}}">Link</a> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user