diff -r 49d085ba05ff -r bf30ab5ba6ee web/views/workflow.py --- a/web/views/workflow.py Mon Sep 14 18:25:43 2009 +0200 +++ b/web/views/workflow.py Mon Sep 14 18:28:01 2009 +0200 @@ -19,9 +19,10 @@ relation_possible, match_form_params) from cubicweb.interfaces import IWorkflowable from cubicweb.view import EntityView -from cubicweb.web import stdmsgs, action, component, form +from cubicweb.schema import display_name +from cubicweb.web import stdmsgs, action, component, form, action from cubicweb.web import formfields as ff, formwidgets as fwdgs -from cubicweb.web.views import TmpFileViewMixin, forms +from cubicweb.web.views import TmpFileViewMixin, forms, primary # IWorkflowable views ######################################################### @@ -129,32 +130,18 @@ row=row, col=col))) -# workflow images ############################################################# - -class ViewWorkflowAction(action.Action): +class WorkflowPrimaryView(primary.PrimaryView): id = 'workflow' - __select__ = implements('CWEType') & has_related_entities('workflow_of', 'object') + __select__ = implements('Workflow') + cache_max_age = 60*60*2 # stay in http cache for 2 hours by default - category = 'mainactions' - title = _('view workflow') - def url(self): - entity = self.rset.get_entity(self.row or 0, self.col or 0) - return entity.absolute_url(vid='workflow') + def render_entity_attributes(self, entity): + self.w(u'' % ( + xml_escape(entity.absolute_url(vid='wfgraph')), + xml_escape(self.req._('graphical workflow for %s') % entity.name))) -class CWETypeWorkflowView(view.EntityView): - id = 'workflow' - __select__ = implements('CWEType') - cache_max_age = 60*60*2 # stay in http cache for 2 hours by default - - def cell_call(self, row, col, **kwargs): - entity = self.entity(row, col) - self.w(u'