Author: justi9
Date: 2009-09-15 11:34:12 -0400 (Tue, 15 Sep 2009)
New Revision: 3633
Modified:
mgmt/trunk/cumin/python/cumin/messaging/queue.py
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
* Simplify context bars, in code and ui, based on discussion with
design team
* Remove some obsoleted code
Modified: mgmt/trunk/cumin/python/cumin/messaging/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-09-14 20:15:30 UTC (rev 3632)
+++ mgmt/trunk/cumin/python/cumin/messaging/queue.py 2009-09-15 15:34:12 UTC (rev 3633)
@@ -195,20 +195,6 @@
self.view = QueueView(app, "view", self.object)
self.add_mode(self.view)
- def show_object(self, session, queue):
- #XXX self.page.main.messaging.broker.object.set(session, queue.vhost.broker)
- return super(QueueFrame, self).show_object(session, queue)
-
- def render_href(self, session, queue):
- if queue:
- return super(QueueFrame, self).render_href(session, queue)
-
- def render_title(self, session, queue):
- if queue:
- return super(QueueFrame, self).render_title(session, queue)
- else:
- return "Queue"
-
class QueueView(CuminView):
def __init__(self, app, name, queue):
super(QueueView, self).__init__(app, name, queue)
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-09-14 20:15:30 UTC (rev 3632)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-09-15 15:34:12 UTC (rev 3633)
@@ -29,8 +29,6 @@
def __init__(self, app, name):
super(CuminMainView, self).__init__(app, name)
- self.__frame_tmpl = Template(self, "frame_html")
-
self.tasks = TaskInvocationSet(app, "tasks")
self.add_child(self.tasks)
@@ -79,7 +77,8 @@
self.__remove = None
def show_object(self, session, object):
- self.object.set(session, object)
+ if self.object:
+ self.object.set(session, object)
if hasattr(self, "view"):
self.view.show(session)
@@ -119,8 +118,8 @@
def render_title(self, session, *args):
obj = self.get_object(session)
+ cls = self.app.model.get_class_by_object(obj)
- cls = self.app.model.get_class_by_object(obj)
if cls:
return cls.get_object_title(session, obj)
@@ -141,23 +140,30 @@
def render_icon_resource(self, session):
return "action-36.png"
- def render_title(self, session):
- return self.frame.render_title(session)
-
def render_frames(self, session):
writer = Writer()
- for frame in self.page.get_frames(session)[:-1]:
+ for frame in self.page.get_frames(session):
self.__frame_tmpl.render(writer, session, frame)
return writer.to_string()
- def render_frame_href(self, session, frame):
- return frame.render_href(session)
+ def render_frame(self, session, frame):
+ if frame == self.frame:
+ html = frame.render_title(session)
+ else:
+ obj = None
- def render_frame_title(self, session, frame):
- return frame.render_title(session)
+ if frame.object:
+ obj = frame.object.get(session)
+ href = frame.get_href(session, obj)
+ content = frame.render_title(session)
+
+ html = fmt_link(href, content)
+
+ return html
+
class BackgroundInclude(Widget):
def __init__(self, app, name):
super(BackgroundInclude, self).__init__(app, name)
@@ -415,7 +421,7 @@
cls = self.app.model.get_class_by_object(obj)
if cls:
- return xml_escape(cls.get_object_title(session, obj))
+ return xml_escape(cls.get_object_name(obj))
def render_icon_href(self, session):
obj = self.object.get(session)
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2009-09-14 20:15:30 UTC (rev 3632)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2009-09-15 15:34:12 UTC (rev 3633)
@@ -157,6 +157,7 @@
<ul id="tabs">{tabs}</ul>
</div>
+
<div id="body">
{tasks}
@@ -169,29 +170,25 @@
<div id="foot"/>
-[CuminMainView.frame_html]
-<li><a href="{frame_href}">{frame_title}</a></li>
-
[CuminView.css]
ul.context {
- display: inline;
list-style: none;
padding: 0;
margin: 0;
line-height: 1.75em;
font-size: 0.9em;
- color: #fff;
+ color: #999;
}
ul.context li {
display: inline;
}
-ul.context li:after {
+ul.context a:after {
content: " > ";
font-weight: bold;
font-size: 0.8em;
- color: #ccc;
+ color: #999;
}
[CuminView.html]
@@ -202,7 +199,7 @@
{tabs}
[CuminView.frame_html]
-<li><a href="{frame_href}">{frame_title}</a></li>
+<li>{frame}</li>
[CuminForm.html]
<form id="{id}" class="mform" method="post"
action="?">