Author: justi9
Date: 2009-09-15 17:39:08 -0400 (Tue, 15 Sep 2009)
New Revision: 3636
Modified:
mgmt/trunk/cumin/python/cumin/grid/job.py
mgmt/trunk/cumin/python/cumin/grid/limit.py
mgmt/trunk/cumin/python/cumin/grid/negotiator.py
mgmt/trunk/cumin/python/cumin/grid/scheduler.py
mgmt/trunk/cumin/python/cumin/grid/submission.py
mgmt/trunk/cumin/python/cumin/inventory/system.py
mgmt/trunk/cumin/python/cumin/messaging/binding.py
mgmt/trunk/cumin/python/cumin/messaging/broker.py
mgmt/trunk/cumin/python/cumin/messaging/connection.py
mgmt/trunk/cumin/python/cumin/messaging/exchange.py
mgmt/trunk/cumin/python/cumin/messaging/queue.py
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
mgmt/trunk/wooly/python/wooly/__init__.py
mgmt/trunk/wooly/python/wooly/tables.py
mgmt/trunk/wooly/python/wooly/tables.strings
Log:
* Make columns truncate according to width; incorporate this into
standard tables directly
* Clean up table class hierarchy
* Set widths on various table columns
Modified: mgmt/trunk/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/job.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/grid/job.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -38,7 +38,7 @@
self.add_column(col)
col = self.ArgsColumn(app, "Args")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
self.phase = JobStatusSwitch(app, "phase")
@@ -86,11 +86,11 @@
state = self.phase.get(session)
return self.phase.get_title(state)
- class ArgsColumn(QmfTableColumn):
+ class ArgsColumn(ItemTableColumn):
def render_title(self, session, data):
return "Arguments"
- class CustomIdColumn(QmfTableColumn):
+ class CustomIdColumn(ItemTableColumn):
def render_title(self, session, data):
return "ID"
@@ -104,7 +104,7 @@
job_id, hash, num = id.rpartition('#')
return fmt_link(href, job_id, link_title=id)
- class StatusColumn(QmfTableColumn):
+ class StatusColumn(ItemTableColumn):
def render_title(self, session, data):
return "Status"
@@ -112,7 +112,7 @@
stat = data[self.name]
return JobStatusInfo.get_status_string(int(stat))
- class CommandColumn(QmfTableColumn):
+ class CommandColumn(ItemTableColumn):
def render_title(self, session, data):
return "Command"
@@ -132,15 +132,17 @@
super(TopJobSet, self).__init__(app, name)
col = self.NameColumn(app, "name")
+ col.width = "70%"
self.add_column(col)
self.set_default_column(col)
col = self.DurationColumn(app, "name")
- col.alignment = "right"
+ col.width = "20%"
+ col.align = "right"
self.add_column(col)
- class NameColumn(TopClientTruncateColumn):
+ class NameColumn(TopTableColumn):
def render_title(self, session, data):
return "Name"
@@ -897,7 +899,7 @@
self.add_column(col)
col = self.JobsCountColumn(app, "jobs")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
class GroupColumn(SqlTableColumn):
Modified: mgmt/trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/limit.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/grid/limit.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -30,11 +30,11 @@
self.set_default_column(col)
col = self.CurrentColumn(app, "curr")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.MaxColumn(app, "max")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
self.limit_count = self.LimitCount(app, "limit_count")
Modified: mgmt/trunk/cumin/python/cumin/grid/negotiator.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/negotiator.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/grid/negotiator.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -101,7 +101,7 @@
self.title = None
self.getter = getter
- self.alignment = "right"
+ self.align = "right"
self.user = False
self.negotiator = negotiator
self.task = task
Modified: mgmt/trunk/cumin/python/cumin/grid/scheduler.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/scheduler.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/grid/scheduler.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -34,15 +34,15 @@
self.add_column(col)
col = self.UsersColumn(app, "users")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.RunningJobsColumn(app, "running")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.HeldJobsColumn(app, "held")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
task = main.module.scheduler_set_start
Modified: mgmt/trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -14,12 +14,14 @@
super(SubmissionSet, self).__init__(app, name)
col = self.NameColumn(app, "name")
+ col.width = "40%"
self.add_column(col)
self.scheduler_col = self.SchedulerColumn(app, "scheduler")
self.add_column(self.scheduler_col)
self.submitter_col = self.SubmitterColumn(app, "submitter")
+ self.width = "15%"
self.add_column(self.submitter_col)
col = self.IdleColumn(app, "idle")
@@ -47,7 +49,7 @@
def render_title(self, session):
return "Submissions %s" % fmt_count(self.get_item_count(session))
- class NameColumn(ClientTruncateColumn):
+ class NameColumn(TopTableColumn):
def render_title(self, session, data):
return "Name"
@@ -64,7 +66,7 @@
(session, data["scheduler_id"])
return fmt_link(href, data["scheduler_name"])
- class SubmitterColumn(ClientTruncateColumn):
+ class SubmitterColumn(SqlTableColumn):
def render_title(self, session, data):
return "Submitter"
Modified: mgmt/trunk/cumin/python/cumin/inventory/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/inventory/system.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/inventory/system.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -30,11 +30,11 @@
self.add_column(col)
col = self.FreeMemoryColumn(app, "mem_free")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.LoadColumn(app, "load")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
def render_title(self, session, *args):
@@ -86,15 +86,17 @@
super(TopSystemSet, self).__init__(app, name)
col = self.NameColumn(app, "name")
+ col.width = "70%"
self.add_column(col)
self.set_default_column(col)
col = self.LoadColumn(app, "load")
- col.alignment = "right"
+ col.width = "20%"
+ col.align = "right"
self.add_column(col)
- class NameColumn(TopClientTruncateColumn):
+ class NameColumn(TopTableColumn):
def render_title(self, session, data):
return "Name"
Modified: mgmt/trunk/cumin/python/cumin/messaging/binding.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/binding.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/messaging/binding.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -30,11 +30,11 @@
self.add_column(col)
col = self.RateColumn(app, "rate")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.MatchedColumn(app, "matched")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
self.phase = PhaseSwitch(app, "phase")
Modified: mgmt/trunk/cumin/python/cumin/messaging/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/broker.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/messaging/broker.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -26,6 +26,7 @@
self.add_parameter(self.group)
col = self.NameColumn(app, "name")
+ col.width = "40%"
self.add_column(col)
self.set_default_column(col)
Modified: mgmt/trunk/cumin/python/cumin/messaging/connection.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/connection.py 2009-09-15 17:40:48 UTC (rev
3635)
+++ mgmt/trunk/cumin/python/cumin/messaging/connection.py 2009-09-15 21:39:08 UTC (rev
3636)
@@ -33,11 +33,11 @@
self.add_column(col)
col = self.SentColumn(app, "sent")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.ReceivedColumn(app, "received")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
self.unit = StateSwitch(app, "unit")
Modified: mgmt/trunk/cumin/python/cumin/messaging/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/exchange.py 2009-09-15 17:40:48 UTC (rev
3635)
+++ mgmt/trunk/cumin/python/cumin/messaging/exchange.py 2009-09-15 21:39:08 UTC (rev
3636)
@@ -50,23 +50,23 @@
self.set_default_column(col)
col = self.ProducersColumn(app, "name")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.BindingsColumn(app, "bindings")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.ReceivedColumn(app, "received")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.RoutedColumn(app, "routed")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.DroppedColumn(app, "dropped")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
self.unit = UnitSwitch(app, "unit")
Modified: mgmt/trunk/cumin/python/cumin/messaging/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -30,27 +30,28 @@
self.vhost = vhost
col = self.NameColumn(app, "name")
+ col.width = "30%"
self.add_column(col)
self.set_default_column(col)
col = self.ConsumersColumn(app, "consumers")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.BindingsColumn(app, "bindings")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.EnqueuedColumn(app, "enqueued")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.DequeuedColumn(app, "dequeued")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
col = self.DepthColumn(app, "depth")
- col.alignment = "right"
+ col.align = "right"
self.add_column(col)
self.unit = UnitSwitch(app, "unit")
@@ -87,7 +88,7 @@
vhost = self.vhost.get(session)
return {"id": vhost.id}
- class NameColumn(ClientTruncateColumn):
+ class NameColumn(SqlTableColumn):
def render_title(self, session, data):
return "Name"
@@ -158,15 +159,17 @@
super(TopQueueSet, self).__init__(app, name)
col = self.NameColumn(app, "name")
+ col.width = "70%"
self.add_column(col)
self.set_default_column(col)
col = self.EnqueuesColumn(app, "enqueues")
- col.alignment = "right"
+ col.width = "20%"
+ col.align = "right"
self.add_column(col)
- class NameColumn(TopClientTruncateColumn):
+ class NameColumn(TopTableColumn):
def render_title(self, session, data):
return "Name"
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -649,69 +649,24 @@
return fmt_link("", title, class_, link_title=hover, bm=bm,
click=click)
-class ClientTruncateColumn(SqlTableColumn):
- def __init__(self, app, name):
- super(ClientTruncateColumn, self).__init__(app, name)
-
- self.col_percent = 33
-
- def get_class_list(self, session):
- cls = super(ClientTruncateColumn, self).get_class_list(session)
- cls.append("truncate")
- return cls
-
- def get_class_attr(self, session):
- cls = super(ClientTruncateColumn, self).get_class_attr(session)
- return "width=\"%i%%\" %s" % (self.col_percent, cls)
-
-class QmfTableColumn(ItemTableColumn):
- def render_content(self, session, data):
- key = self.get_column_key(session)
- return self.render_value(session, data[key])
-
- def render_value(self, session, value):
- return str(value)
-
class TopTableColumn(SqlTableColumn):
def __init__(self, app, name):
super(TopTableColumn, self).__init__(app, name)
self.header_class = TopTableColumnHeader
-class TopTableCountColumn(TopTableColumn):
- def get_class_list(self, session):
- cls = super(TopTableCountColumn, self).get_class_list(session)
- cls.append("top_count")
- return cls
-
class TopTableColumnHeader(ItemTableColumnHeader):
pass
-class TopClientTruncateColumn(ClientTruncateColumn):
+class TopTable(SqlTable):
def __init__(self, app, name):
- super(TopClientTruncateColumn, self).__init__(app, name)
-
- self.header_class = TopTableColumnHeader
- self.col_percent = 60
-
-class TruncatableItemTable(ItemTable):
- def render_extra_class(self, session, *args):
- """ if any columns are truncate, table needs a fixed layout
"""
- return True in [True for x in self.columns
- if isinstance(x, ClientTruncateColumn)] and " truncate"
or ""
-
-class TruncatableTable(SqlTable):
- def render_extra_class(self, session, *args):
- """ if any columns are truncate, table needs a fixed layout
"""
- return True in [True for x in self.columns
- if isinstance(x, ClientTruncateColumn)] and " truncate"
or ""
-
-class TopTable(TruncatableTable):
- def __init__(self, app, name):
super(TopTable, self).__init__(app, name)
+ self.html_class = TopTable.__name__
+
col = self.CountColumn(app, "name")
- col.alignment = "right"
+ col.width = "1em"
+ col.align = "right"
self.add_column(col)
self.update_enabled = True
@@ -723,13 +678,13 @@
def get_connection(self, session):
return self.app.model.get_sql_connection()
- class CountColumn(TopTableCountColumn):
+ class CountColumn(TopTableColumn):
def render_content(self, session, data):
count = self.parent.count.get(session)
self.parent.count.set(session, count + 1)
return count
-class CuminItemTable(TruncatableItemTable):
+class CuminItemTable(ItemTable):
def __init__(self, app, name):
super(CuminItemTable, self).__init__(app, name)
@@ -747,12 +702,14 @@
def get_connection(self, session):
return self.app.model.get_sql_connection()
-class CuminTable(TruncatableTable):
+class CuminTable(SqlTable):
def __init__(self, app, name):
super(CuminTable, self).__init__(app, name)
- self.update_enabled = True
+ self.html_class = CuminTable.__name__
+ # XXX self.update_enabled = True
+
self.paginator = Paginator(app, "page")
self.add_child(self.paginator)
@@ -946,6 +903,7 @@
super(CheckboxInputColumn, self).__init__(app, name, None)
self.header_class = CheckboxIdColumnHeader
+ self.width = "2em"
self.param = ListParameter(app, "param", item_param)
self.add_parameter(self.param)
@@ -965,6 +923,7 @@
super(CheckboxColumn, self).__init__(app, name, param)
self.header_class = CheckboxColumnHeader
+ self.width = "2em"
def do_render(self, session, data, disabled=False):
name = self.param.path
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2009-09-15 21:39:08 UTC (rev 3636)
@@ -416,7 +416,7 @@
width: 100%;
border-collapse: collapse;
margin: 0;
- min-width: 100% !important;
+ table-layout: fixed;
}
table.TopTable tr {
@@ -426,6 +426,8 @@
table.TopTable td {
padding: 0.35em 0.5em;
+ white-space: nowrap;
+ overflow: hidden;
text-overflow: ellipsis;
}
@@ -436,28 +438,30 @@
font-style: italic;
color: #444;
font-size: 0.9em;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
-table.TopTable th.ralign {
- text-align: right;
-}
-
-table.TopTable th.top_count {
- width: 1em;
-}
-
[TopTable.html]
-<table id="{id}" class="TopTable {extra_class}">
+<table id="{id}" class="{class}">
+ {columns}
<thead><tr>{headers}</tr></thead>
<tbody>{items}</tbody>
</table>
[TopTableColumnHeader.html]
-<th {class_attr}>{content}</th>
+<th {attrs}>{content}</th>
[CuminTable.css]
+div.CuminTable table,
+table.CuminTable {
+ table-layout: fixed;
+}
+
div.CuminTable th.setnav {
font-size: 0.9em;
+ padding: 0.35em 0.75em;
}
div.CuminTable ul.switches,
@@ -482,30 +486,29 @@
clear: both;
}
-div.CuminTable > table td {
+div.CuminTable table td,
+table.CuminTable td,
+div.CuminTable table th,
+table.CuminTable th {
+ white-space: nowrap;
+ overflow: hidden;
text-overflow: ellipsis;
}
-div.truncate > table,
-table.truncate {
- table-layout: fixed;
- min-width: 600px;
+div.CuminTable table th,
+table.CuminTable th {
+ font-size: 0.9em;
}
-div.truncate > table td.truncate,
-table.truncate td.truncate {
- white-space: nowrap;
- overflow: hidden;
-}
-
[CuminTable.javascript]
wooly.addPageUpdateListener(cumin.restoreTableCheckboxes);
[CuminTable.html]
-<div id="{id}" class="CuminTable {extra_class}">
+<div id="{id}" class="{class}">
{links}
<table class="mobjects">
+ {columns}
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
@@ -520,7 +523,7 @@
</div>
[CuminTableWithControls.html]
-<div id="{id}" class="CuminTable {extra_class}">
+<div id="{id}" class="{class}">
{links}
{filters}
@@ -528,6 +531,7 @@
{switches}
<table class="mobjects">
+ {columns}
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
@@ -545,7 +549,7 @@
</div>
[CuminSelectionTable.html]
-<div id="{id}" class="CuminTable {extra_class}">
+<div id="{id}" class="{class}">
{links}
{filters}
@@ -559,6 +563,7 @@
</div>
<table class="mobjects">
+ {columns}
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
@@ -591,9 +596,6 @@
[TableHeader.item_html]
<th class="{item_class}"><a
href="{item_href}">{item_content}</a></th>
-[CheckboxColumn.html]
-<td><input type="checkbox" name="{name}"
-
[CheckboxColumnHeader.css]
th.chk_box {
width: 2em;
@@ -792,6 +794,7 @@
<div class="sactions">Act on Selected {plural_title}:
{actions}</div>
<table class="mobjects">
+ {columns}
<thead>
<tr>
<th class="setnav" colspan="{column_count}">
Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/wooly/python/wooly/__init__.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -137,7 +137,7 @@
self.sealed = False
# Configuration
- self.html_class = "_"
+ self.html_class = None
self.update_enabled = False
self.defer_enabled = False
@@ -333,7 +333,7 @@
return self.path
def render_class(self, session, *args):
- return self.html_class
+ return self.html_class or "_"
def render_href(self, session, *args):
return session.marshal()
Modified: mgmt/trunk/wooly/python/wooly/tables.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/tables.py 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/wooly/python/wooly/tables.py 2009-09-15 21:39:08 UTC (rev 3636)
@@ -8,6 +8,8 @@
def __init__(self, app, name):
super(ItemTable, self).__init__(app, name)
+ self.html_class = ItemTable.__name__
+
self.columns = list()
self.headers_by_column = dict()
@@ -30,8 +32,7 @@
def render_headers(self, session, *args):
writer = Writer()
- vlist = self.get_visible_columns(session)
- for column in vlist:
+ for column in self.get_visible_columns(session):
header = self.headers_by_column[column]
writer.write(header.render(session))
@@ -44,8 +45,7 @@
def render_cells(self, session, item):
writer = Writer()
- vlist = self.get_visible_columns(session)
- for col in vlist:
+ for col in self.get_visible_columns(session):
col.set_item(session, item)
writer.write(col.render(session))
@@ -62,6 +62,17 @@
if self.scolumn.default is None:
self.scolumn.default = column.name
+ def render_columns(self, session, *args):
+ writer = Writer()
+
+ for column in self.get_visible_columns(session):
+ if column.width:
+ writer.write("<col style=\"width: %s\"/>" %
column.width)
+ else:
+ writer.write("<col/>")
+
+ return writer.to_string()
+
def set_header(self, column, header):
self.headers_by_column[column] = header
@@ -94,17 +105,17 @@
return None
- def render_class(self, session, *args):
- return None
-
class ItemTableColumn(Widget):
def __init__(self, app, name):
super(ItemTableColumn, self).__init__(app, name)
self.header_class = ItemTableColumnHeader
- self.alignment = None
+
self.visible = True
+ self.align = None
+ self.width = None
+
self.__item = Attribute(app, "item")
self.add_attribute(self.__item)
@@ -117,21 +128,31 @@
def get_column_key(self, session):
return self.name
- def get_class_list(self, session):
- """ allow derived classes to add their own classes
"""
- cls = list()
- if self.alignment == "right":
- cls.append("ralign");
- return cls
-
- def get_class_attr(self, session):
- cls = self.get_class_list(session)
- return cls and "class=\"%s\"" % " ".join(cls) or
""
-
def do_render(self, session, data):
+ attrs = self.render_attrs(session)
content = self.render_content(session, data)
- return "<td %s>%s</td>" % (self.get_class_attr(session) or
"", content)
+ return "<td %s>%s</td>" % (attrs, content)
+
+ def render_attrs(self, session):
+ attrs = list()
+
+ classes = self.render_class(session)
+
+ if classes:
+ attrs.append("class=\"%s\"" % classes)
+
+ styles = self.render_style(session)
+
+ if styles:
+ attrs.append("style=\"%s\"" % styles)
+
+ return " ".join(attrs)
+
+ def render_style(self, session):
+ if self.align:
+ return "text-align: %s" % self.align
+
def render_content(self, session, data):
key = self.get_column_key(session)
return self.render_value(session, data[key])
@@ -149,6 +170,9 @@
self.column = column
+ def render_attrs(self, session, *args):
+ return self.column.render_attrs(session)
+
def render_href(self, session, *args):
branch = session.branch()
@@ -166,9 +190,6 @@
cargs = self.column.get_args(session)
return self.column.render_title(session, *cargs)
- def render_class_attr(self, session, *args):
- return self.column.get_class_attr(session)
-
def render_sorted_dir(self, session, *args):
sel = self.parent.get_selected_column(session)
Modified: mgmt/trunk/wooly/python/wooly/tables.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/tables.strings 2009-09-15 17:40:48 UTC (rev 3635)
+++ mgmt/trunk/wooly/python/wooly/tables.strings 2009-09-15 21:39:08 UTC (rev 3636)
@@ -1,5 +1,17 @@
+[ItemTable.css]
+table.ItemTable {
+ table-layout: fixed;
+}
+
+table.ItemTable td
+table.ItemTable th {
+ white-space: nowrap;
+ overflow: hidden;
+}
+
[ItemTable.html]
-<table {class}>
+<table class="{class}">
+ {columns}
<thead><tr>{headers}</tr></thead>
<tbody>{items}</tbody>
</table>
@@ -41,7 +53,7 @@
}
[ItemTableColumnHeader.html]
-<th {class_attr}><a class="ItemTableColumnHeader"
href="{href}"><span><span
class="{sorted_dir}">{content}</span></span></a></th>
+<th {attrs}><a class="ItemTableColumnHeader"
href="{href}"><span><span
class="{sorted_dir}">{content}</span></span></a></th>
[SqlTable.find_sql]
-select * from %s
\ No newline at end of file
+select * from %s