# HG changeset patch # User Nicolas Chauvat # Date 1248352365 -7200 # Node ID b36f759bd2cc5f6a9ece38ccef0ec9d63ba5fe42 # Parent bd8be3295233f444e8c3fcae07f7eaecf519dd31 #343093: display workflow diff -r bd8be3295233 -r b36f759bd2cc web/views/boxes.py --- a/web/views/boxes.py Thu Jul 23 14:27:54 2009 +0200 +++ b/web/views/boxes.py Thu Jul 23 14:32:45 2009 +0200 @@ -144,20 +144,16 @@ if 'in_state' in entity.e_schema.subject_relations() and entity.in_state: _ = self.req._ state = entity.in_state[0] - transitions = list(state.transitions(entity)) - if transitions: - menu_title = u'%s: %s' % (_('state'), state.view('text')) - menu_items = [] - for tr in transitions: - url = entity.absolute_url(vid='statuschange', treid=tr.eid) - menu_items.append(self.mk_action(_(tr.name), url)) - box.append(BoxMenu(menu_title, menu_items)) - # when there are no possible transition, put state if the menu if - # there are some other actions - elif not box.is_empty(): - menu_title = u'%s: %s' % ( - _('no possible transition'), _('state'), state.view('text')) - box.append(RawBoxItem(menu_title, 'boxMainactions')) + menu_title = u'%s: %s' % (_('state'), state.view('text')) + menu_items = [] + for tr in state.transitions(entity): + url = entity.absolute_url(vid='statuschange', treid=tr.eid) + menu_items.append(self.mk_action(_(tr.name), url)) + wfurl = self.build_url('cwetype/%s'%entity.e_schema, vid='workflow') + menu_items.append(self.mk_action(_('view workflow'), wfurl)) + wfurl = entity.absolute_url(vid='wfhistory') + menu_items.append(self.mk_action(_('view history'), wfurl)) + box.append(BoxMenu(menu_title, menu_items)) return None def linkto_url(self, entity, rtype, etype, target):