equal
deleted
inserted
replaced
154 return u'%s (%s)' % (totalcost, ', '.join(costdescr)) |
154 return u'%s (%s)' % (totalcost, ', '.join(costdescr)) |
155 return unicode(totalcost) |
155 return unicode(totalcost) |
156 |
156 |
157 def build_progress_cell(self, entity): |
157 def build_progress_cell(self, entity): |
158 """``progress`` column cell renderer""" |
158 """``progress`` column cell renderer""" |
159 progress = u'<div class="progress_data">%s (%.2f%%)</div>' % ( |
159 return entity.view('progressbar') |
160 entity.done, entity.progress()) |
|
161 return progress + entity.view('progressbar') |
|
162 |
160 |
163 |
161 |
164 class InContextProgressTableView(ProgressTableView): |
162 class InContextProgressTableView(ProgressTableView): |
165 """this views redirects to ``progress_table_view`` but removes |
163 """this views redirects to ``progress_table_view`` but removes |
166 the ``project`` column |
164 the ``project`` column |
184 title = _('progress bar') |
182 title = _('progress bar') |
185 __select__ = implements(IProgress) |
183 __select__ = implements(IProgress) |
186 |
184 |
187 def cell_call(self, row, col): |
185 def cell_call(self, row, col): |
188 self._cw.add_css('cubicweb.iprogress.css') |
186 self._cw.add_css('cubicweb.iprogress.css') |
|
187 self.req.add_js('cubicweb.iprogress.js') |
189 entity = self.cw_rset.get_entity(row, col) |
188 entity = self.cw_rset.get_entity(row, col) |
190 widget = ProgressBarWidget(entity.done, entity.todo, |
189 widget = ProgressBarWidget(entity.done, entity.todo, |
191 entity.revised_cost) |
190 entity.revised_cost) |
192 self.w(widget.render()) |
191 self.w(widget.render()) |
193 |
192 |