Skip to content

Commit

Permalink
display_icon fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
zmsdev committed Jul 21, 2023
1 parent b35d425 commit 94650ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Products/zms/zmsobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,15 +593,15 @@ def zmi_icon(self,*args, **kwargs):
# --------------------------------------------------------------------------
def display_icon(self, *args, **kwargs):
""" ZMSObject.display_icon """
id = kwargs.get('meta_id',self.meta_id)
meta_id = kwargs.get('meta_id',self.meta_id)
name = 'fas fa-exclamation-triangle'
title = self.display_type(meta_id=meta_id)
extra = ''
if id in self.getMetaobjIds( sort=0) + ['ZMSTrashcan']:
name = self.evalMetaobjAttr( '%s.%s'%(id, 'icon_clazz'))
if id in self.getMetaobjIds( sort=False) + ['ZMSTrashcan']:
name = self.evalMetaobjAttr( '%s.%s'%(meta_id, 'icon_clazz'))
if not name:
names = {'ZMSResource':'fas fa-asterisk icon-asterisk','ZMSLibrary':'fas fa-flask icon-beaker','ZMSPackage':'fas fa-suitcase icon-suitcase','ZMSRecordSet':'far fa-list-alt icon-list','ZMSReference':'fas fa-link icon-link','ZMSTrashcan':'fas fa-trash'}
name = names.get(id, 'fas fa-file-alt icon-file-alt')
name = names.get(meta_id, 'fas fa-file-alt icon-file-alt')
if meta_id is None:
constraints = self.attr('check_constraints')
if isinstance(constraints, dict):
Expand All @@ -618,7 +618,7 @@ def display_icon(self, *args, **kwargs):
title += '; '+'; '.join(['RESTRICTION: '+x[1] for x in constraints['RESTRICTIONS']])
else:
name = 'fas fa-exclamation-triangle constraint-error'
title = '%s not found!'%str(id)
title = '%s not found!'%str(meta_id)
return '<i class="%s" title="%s"%s></i>'%(name,title,extra)


Expand Down

0 comments on commit 94650ea

Please sign in to comment.