web/views/iprogress.py
changeset 8038 678d22a56ab6
parent 8037 a36bd56f33bb
child 8190 2a3c1b787688
equal deleted inserted replaced
8037:a36bd56f33bb 8038:678d22a56ab6
    60     # default columns of the table
    60     # default columns of the table
    61     columns = (_('project'), _('milestone'), _('state'), _('eta_date'),
    61     columns = (_('project'), _('milestone'), _('state'), _('eta_date'),
    62                _('cost'), _('progress'), _('todo_by'))
    62                _('cost'), _('progress'), _('todo_by'))
    63 
    63 
    64     def cell_call(self, row, col):
    64     def cell_call(self, row, col):
    65         x
       
    66         _ = self._cw._
    65         _ = self._cw._
    67         entity = self.cw_rset.get_entity(row, col)
    66         entity = self.cw_rset.get_entity(row, col)
    68         infos = {}
    67         infos = {}
    69         for col in self.columns:
    68         for col in self.columns:
    70             meth = getattr(self, 'build_%s_cell' % col, None)
    69             meth = getattr(self, 'build_%s_cell' % col, None)
   157     __metaclass__ = class_deprecated
   156     __metaclass__ = class_deprecated
   158     __deprecation_warning__ = '[3.14] %(cls)s is deprecated'
   157     __deprecation_warning__ = '[3.14] %(cls)s is deprecated'
   159     __regid__ = 'ic_progress_table_view'
   158     __regid__ = 'ic_progress_table_view'
   160 
   159 
   161     def call(self, columns=None):
   160     def call(self, columns=None):
   162         x
       
   163         view = self._cw.vreg['views'].select('progress_table_view', self._cw,
   161         view = self._cw.vreg['views'].select('progress_table_view', self._cw,
   164                                          rset=self.cw_rset)
   162                                          rset=self.cw_rset)
   165         columns = list(columns or view.columns)
   163         columns = list(columns or view.columns)
   166         try:
   164         try:
   167             columns.remove('project')
   165             columns.remove('project')
   203         if budget == 0:
   201         if budget == 0:
   204             return 0
   202             return 0
   205         return cls.overrun(iprogress) * 100. / budget
   203         return cls.overrun(iprogress) * 100. / budget
   206 
   204 
   207     def cell_call(self, row, col):
   205     def cell_call(self, row, col):
   208         x
       
   209         self._cw.add_css('cubicweb.iprogress.css')
   206         self._cw.add_css('cubicweb.iprogress.css')
   210         self._cw.add_js('cubicweb.iprogress.js')
   207         self._cw.add_js('cubicweb.iprogress.js')
   211         entity = self.cw_rset.get_entity(row, col)
   208         entity = self.cw_rset.get_entity(row, col)
   212         iprogress = entity.cw_adapt_to('IProgress')
   209         iprogress = entity.cw_adapt_to('IProgress')
   213         done = iprogress.done or 0
   210         done = iprogress.done or 0