changeset 209:d2b9c72e9643

Hide deactivated build configurations on the build status page by default, and provide an option panel to make them visible.
author cmlenz
date Mon, 19 Sep 2005 23:41:22 +0000
parents f39136272683
children c550e31c06d2
files bitten/trac_ext/htdocs/bitten.css bitten/trac_ext/templates/bitten_config.cs bitten/trac_ext/web_ui.py
diffstat 3 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/trac_ext/htdocs/bitten.css
+++ b/bitten/trac_ext/htdocs/bitten.css
@@ -4,6 +4,7 @@
  background-image: url(bitten_build.png) !important
 }
 
+#content.build h2.deactivated { text-decoration: line-through; }
 #content.build #prefs { line-height: 1.4em; }
 
 #content.build form.config th { text-align: left; }
--- a/bitten/trac_ext/templates/bitten_config.cs
+++ b/bitten/trac_ext/templates/bitten_config.cs
@@ -3,9 +3,20 @@
  <div id="content" class="build">
   <h1><?cs var:title ?></h1><?cs
 
-  if:page.mode == 'overview' ?><?cs
+  if:page.mode == 'overview' ?>
+   <form id="prefs" method="get">
+    <div>
+     <input type="checkbox" id="showall" name="show" value="all"<?cs
+      if:config.show_all ?> checked="checked"<?cs /if ?> />
+     <label for="showall">Show deactivated configurations</label>
+    </div>
+    <div class="buttons">
+     <input type="submit" value="Update" />
+    </div>
+   </form><?cs
    each:config = configs ?>
-    <h2><a href="<?cs var:config.href ?>"><?cs var:config.label ?></a></h2><?cs
+    <h2<?cs if:!config.active ?> class="deactivated"<?cs /if ?>><a href="<?cs
+      var:config.href ?>"><?cs var:config.label ?></a></h2><?cs
     if:config.description ?><div class="description"><?cs
      var:config.description ?></div><?cs
     /if ?><?cs
--- a/bitten/trac_ext/web_ui.py
+++ b/bitten/trac_ext/web_ui.py
@@ -289,14 +289,20 @@
 
     def _render_overview(self, req):
         req.hdf['title'] = 'Build Status'
-        configurations = BuildConfig.select(self.env, include_inactive=True)
+        show_all = False
+        if req.args.get('show') == 'all':
+            show_all = True
+        req.hdf['config.show_all'] = show_all
+
+        configurations = BuildConfig.select(self.env, include_inactive=show_all)
         for idx, config in enumerate(configurations):
             description = config.description
             if description:
                 description = wiki_to_html(description, self.env, req)
             req.hdf['configs.%d' % idx] = {
                 'name': config.name, 'label': config.label or config.name,
-                'path': config.path, 'description': description,
+                'active': config.active, 'path': config.path,
+                'description': description,
                 'href': self.env.href.build(config.name),
             }
         req.hdf['page.mode'] = 'overview'
Copyright (C) 2012-2017 Edgewall Software