Projet

Général

Profil

workflow-complete-view.patch

Thomas Noël, 10 juin 2011 23:58

Télécharger (2,5 ko)

Voir les différences:


  

wcs/admin/workflows.ptl (copie de travail)
271 271

  
272 272
class WorkflowPage(Directory):
273 273
    _q_exports = ['', 'edit', 'delete', 'newstatus', ('status', 'status_dir'), 'update_order',
274
            'duplicate']
274
            'duplicate', 'view']
275 275

  
276 276
    def __init__(self, component):
277 277
        self.workflow = Workflow.get(component)
......
312 312
        '<li><a href="edit">%s</a></li>' % _('Change Title')
313 313
        '<li><a href="delete" rel="popup">%s</a></li>' % _('Delete')
314 314
        '<li><a href="duplicate">%s</a></li>' % _('Duplicate')
315
        '<li><a href="view">%s</a></li>' % _('Complete View')
315 316
        '</ul>'
316 317
        self.get_new_status_form()
317 318

  
......
397 398
        self.workflow_ui.workflow.name = self.workflow_ui.workflow.name + _(' (copy)')
398 399
        return self.edit(duplicate = True)
399 400

  
401
    def view [html] (self):
402
        html_top('workflows', title = _('View Workflow'))
403
        get_response().breadcrumb.append( ('view', _('Complete View')) )
404
        '<h2>%s %s</h2>'% (_('Workflow:'), self.workflow.name)
400 405

  
406
        if not self.workflow.possible_status:
407
            '<p>%s</p>' % _('There are not yet any status defined in this workflow.')
408
        else:
409
            for status in self.workflow.possible_status:
410
                '<h3>'
411
                '%s <a href="status/%s/">%s</a>' % (_('Status:'), status.id, status.name)
412
                '</h3>'
413
                if status.items:
414
                    '<ul>'
415
                    for i, item in enumerate(status.items):
416
                        '<li>'
417
                        if hasattr(item, str('fill_admin_form')):
418
                            '%s <a href="status/%s/items/%s/">%s</a>' % \
419
                                    (_('Action:'), status.id, item.id, item.render_as_line())
420
                        else:
421
                            item.render_as_line()
422
                        '</li>'
423
                    '</ul>'
424

  
425
        '<p><a href=".">%s</a></p>' % _('Back to workflow main page')
426

  
427

  
401 428
class WorkflowsDirectory(Directory):
402 429

  
403 430
    _q_exports = ['', 'new']
......
420 447
            command_icon('%s/' % workflow.id, 'edit')
421 448
            command_icon('%s/delete' % workflow.id, 'remove', popup = True)
422 449
            command_icon('%s/duplicate' % workflow.id, 'duplicate')
450
            command_icon('%s/view' % workflow.id, 'view')
423 451
            '</p></li>'
424 452
        '</ul>'
425 453