Projet

Général

Profil

0001-workflows-improve-wording-of-automatic-global-action.patch

Frédéric Péters, 18 juillet 2018 09:25

Télécharger (2,87 ko)

Voir les différences:

Subject: [PATCH] workflows: improve wording of automatic global actions
 (#25176)

 wcs/admin/workflows.py |  2 +-
 wcs/workflows.py       | 14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)
wcs/admin/workflows.py
1267 1267
    def get_new_trigger_form(self):
1268 1268
        form = Form(enctype='multipart/form-data', action='newtrigger')
1269 1269
        available_triggers = [
1270
            ('timeout', _('Timeout')),
1270
            ('timeout', _('Automatic')),
1271 1271
            ('manual', _('Manual')),
1272 1272
        ]
1273 1273
        form.add(SingleSelectWidget, 'type', title=_('Type'),
wcs/workflows.py
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
-