Add new vendor catalog row status, render product with hyperlink
This commit is contained in:
		
							parent
							
								
									8c211df633
								
							
						
					
					
						commit
						7443b31a93
					
				
					 1 changed files with 17 additions and 1 deletions
				
			
		
							
								
								
									
										18
									
								
								tailbone/views/vendors/catalogs.py
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								tailbone/views/vendors/catalogs.py
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -177,9 +177,25 @@ class VendorCatalogsView(FileBatchMasterView):
 | 
				
			||||||
    def row_grid_extra_class(self, row, i):
 | 
					    def row_grid_extra_class(self, row, i):
 | 
				
			||||||
        if row.status_code == row.STATUS_PRODUCT_NOT_FOUND:
 | 
					        if row.status_code == row.STATUS_PRODUCT_NOT_FOUND:
 | 
				
			||||||
            return 'warning'
 | 
					            return 'warning'
 | 
				
			||||||
        if row.status_code in (row.STATUS_NEW_COST, row.STATUS_UPDATE_COST):
 | 
					        if row.status_code in (row.STATUS_NEW_COST,
 | 
				
			||||||
 | 
					                               row.STATUS_UPDATE_COST, # TODO: deprecate/remove this one
 | 
				
			||||||
 | 
					                               row.STATUS_CHANGE_VENDOR_ITEM_CODE,
 | 
				
			||||||
 | 
					                               row.STATUS_CHANGE_CASE_SIZE,
 | 
				
			||||||
 | 
					                               row.STATUS_CHANGE_COST):
 | 
				
			||||||
            return 'notice'
 | 
					            return 'notice'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def configure_row_form(self, f):
 | 
				
			||||||
 | 
					        super(VendorCatalogsView, self).configure_row_form(f)
 | 
				
			||||||
 | 
					        f.set_renderer('product', self.render_product)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def render_product(self, row, field):
 | 
				
			||||||
 | 
					        product = row.product
 | 
				
			||||||
 | 
					        if not product:
 | 
				
			||||||
 | 
					            return ""
 | 
				
			||||||
 | 
					        text = six.text_type(product)
 | 
				
			||||||
 | 
					        url = self.request.route_url('products.view', uuid=product.uuid)
 | 
				
			||||||
 | 
					        return tags.link_to(text, url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def template_kwargs_create(self, **kwargs):
 | 
					    def template_kwargs_create(self, **kwargs):
 | 
				
			||||||
        parsers = self.get_parsers()
 | 
					        parsers = self.get_parsers()
 | 
				
			||||||
        for parser in parsers:
 | 
					        for parser in parsers:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue