incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1330627 - in /incubator/bloodhound/trunk/bloodhound_theme/bhtheme: templates/bh_admin.html templates/bh_admin_logging.html theme.py
Date Thu, 26 Apr 2012 01:55:20 GMT
Author: gjm
Date: Thu Apr 26 01:55:19 2012
New Revision: 1330627

URL: http://svn.apache.org/viewvc?rev=1330627&view=rev
Log:
theme: admin (logging) template changes provided by Olemis #15

Added:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_logging.html
Modified:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html?rev=1330627&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin.html Thu Apr 26
01:55:19 2012
@@ -0,0 +1,48 @@
+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:xi="http://www.w3.org/2001/XInclude"
+      xmlns:py="http://genshi.edgewall.org/"
+      py:strip="">
+
+  <py:match path="head" once="true"><head>
+    <title>Administration: ${select('title/text()')}</title>
+    ${select("*[local-name() != 'title']")}
+  </head></py:match>
+
+  <py:match path="body" once="true" buffer="false"><body>
+    <div id="content" class="row">
+      <h1>Administration</h1>
+      <div id="tabs" class="span3">
+        <div class="well">
+          <ul class="nav nav-list">
+            <py:for each="category, panels in groupby(panels, lambda p: p.category)"
+                py:with="cat_is_active = category.id == active_cat">
+              <li class="nav-header">
+                <py:choose test="">
+                  <span py:when="cat_is_active" class="label label-important">
+                    ${category.label}
+                  </span>
+                  <py:otherwise>${category.label}</py:otherwise>
+                </py:choose>
+              </li>
+              <li py:for="panel in panels" py:with="panel = panel.panel;
+                      pan_is_active = cat_is_active and panel.id == active_panel"
+                  class="${'active' if pan_is_active else None}">
+                <a href="${href.admin(category.id, panel.id)}">${panel.label}</a>
+              </li>
+            </py:for>
+          </ul>
+        </div>
+      </div>
+      <div id="tabcontent" class="span9">
+        ${select("*|text()")}
+        <br style="clear: right" />
+      </div>
+    </div>
+
+  </body></py:match>
+
+  <xi:include href="layout.html" />
+</html>

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_logging.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_logging.html?rev=1330627&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_logging.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_logging.html Thu
Apr 26 01:55:19 2012
@@ -0,0 +1,65 @@
+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:xi="http://www.w3.org/2001/XInclude"
+      xmlns:i18n="http://genshi.edgewall.org/i18n"
+      xmlns:py="http://genshi.edgewall.org/">
+  <xi:include href="bh_admin.html" />
+  <head>
+    <title>Logging</title>
+    <script type="text/javascript">/*<![CDATA[*/
+      jQuery(document).ready(function($) {
+        $("#log_type").change(function() {
+          $("#log_level").enable(this.selectedIndex > 0);
+          $("#log_file").enable(this.options[this.selectedIndex].value == "file");
+        }).change();
+      });
+    /*]]>*/</script>
+  </head>
+
+  <body>
+    <h2>Logging</h2>
+
+    <form class="well form-horizontal" id="modlog" method="post" action="">
+      <fieldset>
+        <legend>Configuration</legend>
+        <div class="control-group">
+          <label class="control-label" for="log_type">Type:</label>
+          <div class="controls">
+            <select id="log_type" name="log_type" class="input-small">
+              <option py:for="type in log.types" value="${type.name}"
+                      selected="${type.selected or None}"
+                      disabled="${type.disabled or None}">${type.label}</option>
+            </select>
+          </div>
+        </div>
+        <div class="control-group">
+          <label class="control-label" for="log_level">Log level:</label>
+          <div class="controls">
+            <select id="log_level" name="log_level" class="input-small">
+              <option py:for="level in log.levels"
+                      selected="${level==log.level or None}">$level</option>
+            </select>
+          </div>
+        </div>
+        <div class="control-group">
+          <label class="control-label" for="log_file">Log file:</label>
+          <div class="controls">
+            <input type="text" id="log_file" name="log_file" value="$log.file"
+                class="input-xlarge" />
+          </div>
+          <p class="help" i18n:msg="dir">
+            If you specify a relative path, the log file will be stored inside the
+            <code>log</code> directory of the project environment (<code>$log.dir</code>).
+          </p>
+        </div>
+        <div class="control-group">
+          <input type="submit" class="btn-primary" 
+              value="${_('Apply changes')}"/>
+        </div>
+      </fieldset>
+    </form>
+  </body>
+
+</html>

Modified: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py?rev=1330627&r1=1330626&r2=1330627&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py Thu Apr 26 01:55:19 2012
@@ -72,7 +72,9 @@ class BloodhoundTheme(ThemeBase):
     """
     template = htdocs = css = screenshot = disable_trac_css = True
     disable_all_trac_css = True
-
+    BLOODHOUND_TEMPLATE_MAP = {
+        'admin_logging.html' : 'bh_admin_logging.html',
+    }
     implements(IRequestFilter)
 
     # IRequestFilter methods
@@ -93,12 +95,14 @@ class BloodhoundTheme(ThemeBase):
             return is_active
         
         if self.disable_all_trac_css and is_active_theme():
-            links = req.chrome.get('links',{})
-            stylesheets = links.get('stylesheet',[])
-            if stylesheets:
-                path = req.base_path + '/chrome/common/css/'
-                links['stylesheet'] = [ss for ss in stylesheets 
-                                       if not ss.get('href').startswith(path)]
+            if self.disable_all_trac_css:
+                links = req.chrome.get('links',{})
+                stylesheets = links.get('stylesheet',[])
+                if stylesheets:
+                    path = req.base_path + '/chrome/common/css/'
+                    links['stylesheet'] = [ss for ss in stylesheets 
+                                        if not ss.get('href').startswith(path)]
+            template = self.BLOODHOUND_TEMPLATE_MAP.get(template, template)
         return template, data, content_type
 
 class QuickCreateTicketDialog(Component):



Mime
View raw message