Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from config import Config as C, Names as N 

2from control.utils import pick as G, E 

3from control.html import HtmlElements as H 

4from control.typ.master import Master 

5 

6CW = C.web 

7 

8Qn = H.icon(CW.unknown[N.number], asChar=True) 

9Qq = H.icon(CW.unknown[N.generic], asChar=True) 

10 

11 

12class CriteriaEntry(Master): 

13 """Type class for criteria entries.""" 

14 

15 def __init__(self, context): 

16 super().__init__(context) 

17 

18 def titleStr(self, record, markup=True): 

19 """The title is a sequence number plus the short criterion text.""" 

20 

21 context = self.context 

22 types = context.types 

23 

24 seqBare = G(record, N.seq) 

25 eid = G(record, N.criteria) 

26 titleBare = ( 

27 E if eid is None else types.criteria.title(eid=eid, markup=markup) 

28 ) 

29 return ( 

30 f"""{seqBare or E}.{titleBare}""" 

31 if markup is None 

32 else f"""{H.he(seqBare) or Qn}. {Qq if titleBare is None else titleBare}""" 

33 )