Author: eallen
Date: 2010-09-21 17:18:34 -0400 (Tue, 21 Sep 2010)
New Revision: 4322
Modified:
mgmt/newdata/cumin/python/cumin/grid/job.py
mgmt/newdata/cumin/python/cumin/widgets.py
mgmt/newdata/cumin/python/cumin/widgets.strings
Log:
Fix for 435885: Make job summaries column headers non-clickable
Modified: mgmt/newdata/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/job.py 2010-09-21 19:47:32 UTC (rev 4321)
+++ mgmt/newdata/cumin/python/cumin/grid/job.py 2010-09-21 21:18:34 UTC (rev 4322)
@@ -160,6 +160,20 @@
results = self.app.model.get_submission_job_summaries(submission)
return results.data and len(results.data) or 0
+class NonSortableObjectTableColumn(ObjectTableColumn):
+ def __init__(self, app, name, attr):
+ super(NonSortableObjectTableColumn, self).__init__(app, name, attr)
+
+ self.header = StaticColumnHeader(app, "header")
+ self.replace_child(self.header)
+
+class NonSortableObjectLinkColumn(ObjectLinkColumn):
+ def __init__(self, app, name, attr, id_attr, frame_path):
+ super(NonSortableObjectLinkColumn, self).__init__(app, name, attr, id_attr,
frame_path)
+
+ self.header = StaticColumnHeader(app, "header")
+ self.replace_child(self.header)
+
class JobSelector(ObjectSelector):
def __init__(self, app, name, submission):
cls = app.model.com_redhat_cumin_grid.JobSummary
@@ -176,7 +190,8 @@
status_column = self.Status(app, "status", cls.JobStatus)
self.add_column(status_column)
- self.add_attribute_column(cls.Cmd)
+ cmd_column = NonSortableObjectTableColumn(app, cls.Cmd.name, cls.Cmd)
+ self.add_column(cmd_column)
self.job_id_column = ObjectTableColumn(app, cls.JobId.name, cls.JobId)
self.job_id_column.visible = False
@@ -237,7 +252,7 @@
values['args'] = ()
return values
- class JobIdColumn(ObjectLinkColumn):
+ class JobIdColumn(NonSortableObjectLinkColumn):
def render_cell_href(self, session, record):
job_id = record[self.parent.job_id_column.field.index]
#frame = self.page.page_widgets_by_path[self.frame_path]
@@ -246,7 +261,7 @@
submission = self.parent.submission.get(session)
return frame.get_href(session, submission._id, job_id)
- class Status(ObjectTableColumn):
+ class Status(NonSortableObjectTableColumn):
def render_cell_content(self, session, record):
status = self.field.get_content(session, record)
return JobStatusInfo.get_status_string(status)
Modified: mgmt/newdata/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.py 2010-09-21 19:47:32 UTC (rev 4321)
+++ mgmt/newdata/cumin/python/cumin/widgets.py 2010-09-21 21:18:34 UTC (rev 4322)
@@ -917,6 +917,9 @@
class StaticTableColumnHeader(ItemTableColumnHeader):
pass
+class StaticColumnHeader(TableColumnHeader):
+ pass
+
class NonSortableTableColumn(ItemTableColumn):
def __init__(self, app, name):
super(NonSortableTableColumn, self).__init__(app, name)
Modified: mgmt/newdata/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.strings 2010-09-21 19:47:32 UTC (rev 4321)
+++ mgmt/newdata/cumin/python/cumin/widgets.strings 2010-09-21 21:18:34 UTC (rev 4322)
@@ -869,3 +869,6 @@
[StaticTableColumnHeader.html]
<th {attrs}>{content}</th>
+
+[StaticColumnHeader.html]
+<th class="{class}">{content}</th>