1005 |
1005 |
|
1006 |
1006 |
def render_as_line(self):
|
1007 |
1007 |
if self.properly_configured():
|
1008 |
|
return _('Timeout, %(timeout)s, relative to: %(anchor)s') % {
|
|
1008 |
return _('Automatic, %(timeout)s, relative to: %(anchor)s') % {
|
1009 |
1009 |
'anchor': self.get_anchor_labels().get(self.anchor).lower(),
|
1010 |
1010 |
'timeout': _('%s days') % self.timeout}
|
1011 |
1011 |
else:
|
1012 |
|
return _('Timeout (not configured)')
|
|
1012 |
return _('Automatic (not configured)')
|
1013 |
1013 |
|
1014 |
1014 |
def form(self, workflow):
|
1015 |
1015 |
form = Form(enctype='multipart/form-data')
|
1016 |
1016 |
options = self.get_anchor_labels().items()
|
1017 |
|
form.add(SingleSelectWidget, 'anchor', title=_('Anchor'),
|
|
1017 |
form.add(SingleSelectWidget, 'anchor', title=_('Reference Date'),
|
1018 |
1018 |
options=options, value=self.anchor, required=True,
|
1019 |
1019 |
attrs={'data-dynamic-display-parent': 'true'})
|
1020 |
1020 |
|
... | ... | |
1037 |
1037 |
'data-dynamic-display-value': _('Latest arrival in status')}
|
1038 |
1038 |
)
|
1039 |
1039 |
|
1040 |
|
form.add(ValidatedStringWidget, 'timeout', title=_('Timeout'),
|
|
1040 |
form.add(ValidatedStringWidget, 'timeout', title=_('Delay (in days)'),
|
1041 |
1041 |
value=self.timeout,
|
1042 |
1042 |
regex=r'^-?\d+$',
|
1043 |
1043 |
required=True,
|
1044 |
|
hint=_('Number of days, relative to anchor point.'))
|
|
1044 |
hint=_('''
|
|
1045 |
Number of days relative to the reference date. If the
|
|
1046 |
reference date is computed from an expression, a negative
|
|
1047 |
delay is accepted to trigger the action before the
|
|
1048 |
date.'''))
|
1045 |
1049 |
|
1046 |
1050 |
return form
|
1047 |
1051 |
|
1048 |
|
-
|