Author: tmckay Date: 2011-06-14 19:11:38 +0000 (Tue, 14 Jun 2011) New Revision: 4826
Modified: branches/clarity/cumin/python/cumin/grid/submission.py branches/clarity/cumin/python/cumin/objectframe.py Log: Merge 4778 from trunk. BZ699732
Modified: branches/clarity/cumin/python/cumin/grid/submission.py =================================================================== --- branches/clarity/cumin/python/cumin/grid/submission.py 2011-06-14 19:10:01 UTC (rev 4825) +++ branches/clarity/cumin/python/cumin/grid/submission.py 2011-06-14 19:11:38 UTC (rev 4826) @@ -88,7 +88,7 @@ cls = app.model.com_redhat_grid.JobServer self.add_filter(self.pool, cls.Pool)
- col = ObjectLinkColumn(app, "name", self.cls.Name, self.cls._id, frame) + col = self.PoolSubmissionObjectLinkColumn(app, "name", self.cls.Name, self.cls._id, frame) self.insert_column(0, col) self.add_search_filter(col)
@@ -111,6 +111,14 @@ def do_enter(self, session, obj, form_session): pool = self.parent.pool.get(session) self.form.pool_name.set(form_session, pool.Pool) + + class PoolSubmissionObjectLinkColumn(ObjectLinkColumn): + def render_cell_content(self, session, record): + retval = len(record) > 0 and record[self.field.index] or "" + if(len(record[self.field.index]) > 100): + retval = record[self.field.index][:100] + "..." #indicate that we truncated the name + return retval +
class PoolSubmissionJoinSelector(PoolSubmissionSelector): def __init__(self, app, name, pool):
Modified: branches/clarity/cumin/python/cumin/objectframe.py =================================================================== --- branches/clarity/cumin/python/cumin/objectframe.py 2011-06-14 19:10:01 UTC (rev 4825) +++ branches/clarity/cumin/python/cumin/objectframe.py 2011-06-14 19:11:38 UTC (rev 4826) @@ -233,8 +233,20 @@
links.append(self.link.render(session, frame))
- return " › ".join(reversed(links)) - + trimmed_links = list() + text_matcher = re.compile('<a.*?>(.*?)</a>') + for onelink in links: + new_link = onelink + #get just the text that we will be displaying to truncate + result = text_matcher.search(onelink) + if(result.group(1) and len(result.group(1)) > 100): + origText = result.group(1) + newText = result.group(1)[:100] + "...'" + new_link = onelink.replace(origText, newText, 1) + trimmed_links.append(new_link) + + return " › ".join(reversed(trimmed_links)) + class ObjectViewContextLink(Link): def __init__(self, app, name): super(ObjectViewContextLink, self).__init__(app, name) @@ -261,7 +273,11 @@ return self.frame.icon_href
def render_title(self, session): - return self.parent.render_title(session) + retval = self.parent.render_title(session) + if(len(retval) > 100): + retval = retval[:100] + "..." + return retval +
class ObjectViewSummary(ObjectViewChild): def __init__(self, app, name, object):
cumin-developers@lists.fedorahosted.org