Author: croberts
Date: 2011-05-04 20:10:13 +0000 (Wed, 04 May 2011)
New Revision: 4753
Modified:
trunk/cumin/python/cumin/account/widgets.py
trunk/cumin/python/cumin/account/widgets.strings
trunk/cumin/python/cumin/main.py
trunk/cumin/python/cumin/widgets.py
trunk/cumin/python/cumin/widgets.strings
Log:
Moving the "About" link to a better spot per RFE BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=694827 .
Modified: trunk/cumin/python/cumin/account/widgets.py
===================================================================
--- trunk/cumin/python/cumin/account/widgets.py 2011-05-04 18:48:54 UTC (rev 4752)
+++ trunk/cumin/python/cumin/account/widgets.py 2011-05-04 20:10:13 UTC (rev 4753)
@@ -35,9 +35,6 @@
self.settings = SettingsFrame(app, "main")
self.add_tab(self.settings)
- self.about = AboutFrame(app, "about")
- self.add_tab(self.about)
-
class SettingsFrame(Frame):
def __init__(self, app, name):
super(SettingsFrame, self).__init__(app, name)
@@ -64,42 +61,7 @@
def render_content(self, sessino):
return "Change password"
-class AboutFrame(Frame):
- def __init__(self, app, name):
- super(AboutFrame, self).__init__(app, name)
- content = AboutContent(app, "about_content")
- self.add_child(content)
- def render_title(self, session):
- return "About the console"
-
-class AboutContent(Widget):
- def __init__(self, app, name):
- super(AboutContent, self).__init__(app, name)
-
- self.version_string = ""
- self.version_local = False
-
- # Look for version info in our well-known file.
- version_path = os.path.join(self.app.home, "version")
- if os.path.isfile(version_path):
- # Permission errors or corrupt file always possible
- try:
- f = open(version_path)
- self.version_string = f.readline().strip()
- self.version_local = f.readline().strip() == "local"
- except:
- pass
-
- if len(self.version_string) == 0:
- self.version_string = "Version has not been set"
-
- def render_version(self, session):
- res = self.version_string
- if self.version_local:
- res += ", devel instance"
- return res
-
class LoginPage(HtmlPage):
def __init__(self, app, name):
super(LoginPage, self).__init__(app, name)
Modified: trunk/cumin/python/cumin/account/widgets.strings
===================================================================
--- trunk/cumin/python/cumin/account/widgets.strings 2011-05-04 18:48:54 UTC (rev 4752)
+++ trunk/cumin/python/cumin/account/widgets.strings 2011-05-04 20:10:13 UTC (rev 4753)
@@ -76,9 +76,3 @@
<p class="login_invalid">The user name and password you entered do not
match any account.</p>
-[AboutContent.html]
-<div>
-<h3>Management console version</h3>
-{version}
-</div>
-
Modified: trunk/cumin/python/cumin/main.py
===================================================================
--- trunk/cumin/python/cumin/main.py 2011-05-04 18:48:54 UTC (rev 4752)
+++ trunk/cumin/python/cumin/main.py 2011-05-04 20:10:13 UTC (rev 4753)
@@ -24,6 +24,7 @@
from wooly import Session
from cumin.stat import PieChartPage
+from cumin.widgets import AboutPage
strings = StringCatalog(__file__)
log = logging.getLogger("cumin")
@@ -73,7 +74,7 @@
# Space separated list of sasl authentication
# mechanisms, according to the sasl documentation
self.sasl_mech_list = None
-
+
def server_alive(self):
return self.server.server_alive()
@@ -171,6 +172,9 @@
self.export_page = CuminExportPage(self, "csv")
self.add_page(self.export_page)
+
+ self.about_page = AboutPage(self, "about.html")
+ self.add_page(self.about_page)
self.resource_page.protected = False
Modified: trunk/cumin/python/cumin/widgets.py
===================================================================
--- trunk/cumin/python/cumin/widgets.py 2011-05-04 18:48:54 UTC (rev 4752)
+++ trunk/cumin/python/cumin/widgets.py 2011-05-04 20:10:13 UTC (rev 4753)
@@ -83,6 +83,11 @@
return branch.marshal()
else:
return super(CuminMainView, self).render_tab_href(session, tab)
+
+ def render_about_href(self, session):
+ page = self.app.about_page
+ lsess = Session(page)
+ return lsess.marshal()
class CuminPageLinks(ItemSet):
def __init__(self, app, name):
@@ -1622,3 +1627,57 @@
class TopTableFooter(Widget):
def render(self, session):
return ""
+
+class AboutPage(CuminPage, ModeSet):
+ def __init__(self, app, name):
+ super(AboutPage, self).__init__(app, name)
+
+ self.about = AboutMainView(app, "about")
+ self.add_mode(self.about)
+ self.set_default_frame(self.about)
+
+ def render_title(self, session):
+ return "About"
+
+class AboutFrame(Frame):
+ def __init__(self, app, name):
+ super(AboutFrame, self).__init__(app, name)
+ content = AboutContent(app, "about_content")
+ self.add_child(content)
+
+ def render_title(self, session):
+ return "About the console"
+
+class AboutMainView(CuminMainView):
+ def __init__(self, app, name):
+ super(AboutMainView, self).__init__(app, name)
+
+ self.about = AboutFrame(app, "about")
+ self.add_tab(self.about)
+
+class AboutContent(Widget):
+ def __init__(self, app, name):
+ super(AboutContent, self).__init__(app, name)
+
+ self.version_string = ""
+ self.version_local = False
+
+ # Look for version info in our well-known file.
+ version_path = os.path.join(self.app.home, "version")
+ if os.path.isfile(version_path):
+ # Permission errors or corrupt file always possible
+ try:
+ f = open(version_path)
+ self.version_string = f.readline().strip()
+ self.version_local = f.readline().strip() == "local"
+ except:
+ pass
+
+ if len(self.version_string) == 0:
+ self.version_string = "Version has not been set"
+
+ def render_version(self, session):
+ res = self.version_string
+ if self.version_local:
+ res += ", devel instance"
+ return res
Modified: trunk/cumin/python/cumin/widgets.strings
===================================================================
--- trunk/cumin/python/cumin/widgets.strings 2011-05-04 18:48:54 UTC (rev 4752)
+++ trunk/cumin/python/cumin/widgets.strings 2011-05-04 20:10:13 UTC (rev 4753)
@@ -155,6 +155,8 @@
Hi, {user_name}
<span class="separator">|</span>
<a id="logout" onclick="wooly.clearUpdates()"
href="{logout_href}">Log out</a>
+ <span class="separator">|</span>
+ <a href="{about_href}">About</a>
</div>
<div id="global">
@@ -901,3 +903,9 @@
[StaticColumnHeader.html]
<th class="{class}">{content}</th>
+[AboutContent.html]
+<div>
+<h3>Management console version</h3>
+{version}
+</div>
+