You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by gj...@apache.org on 2012/05/18 16:46:24 UTC

svn commit: r1340111 - in /incubator/bloodhound/trunk/bloodhound_theme/bhtheme: ./ templates/

Author: gjm
Date: Fri May 18 14:46:24 2012
New Revision: 1340111

URL: http://svn.apache.org/viewvc?rev=1340111&view=rev
Log:
theme: adding preference panels for #8 (from olemis)

Added:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs.html   (with props)
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_advanced.html   (with props)
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_datetime.html   (with props)
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_general.html   (with props)
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_keybindings.html   (with props)
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_pygments.html   (with props)
Modified:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs.html?rev=1340111&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs.html Fri May 18 14:46:24 2012
@@ -0,0 +1,53 @@
+<!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>Preferences: ${select('title/text()')}</title>
+    ${select("*[local-name() != 'title']")}
+  </head></py:match>
+
+  <py:match path="body" once="true" buffer="true"><body>
+    <div id="content" class="prefs">
+      <h1>Preferences</h1>
+      <p>This page lets you customize your personal settings for this site.
+      These settings are stored on the server and are identified by a session
+      key stored in a browser cookie. That cookie allows your settings to be
+      restored on subsequent visits.</p>
+      <ul id="tabs" class="nav nav-tabs">
+        <li py:for="name, label in sorted(panels)"
+            class="${'active' if name == active_panel else None}"
+            id="${('tab_%s' % name) if name else None}">
+          <a href="${name != active_panel and href.prefs(name) or '#'}">
+            <span py:strip="name != 'advanced'" class="label label-inverse">
+              ${label}
+            </span>
+          </a>
+        </li>
+
+      </ul>
+      <div id="tab-content" py:with="has_forms = list(select('.//form'))">
+        <div class="tab-pane active">
+          <form id="userprefs" class="form-horizontal" action="" method="post"
+              py:strip="has_forms">
+            ${select("*|text()")}
+            <br/>
+            <div class="control-group" py:if="not has_forms">
+              <input type="hidden" name="action" value="save" />
+              <input class="btn btn-primary" type="submit"
+                  value="${_('Save changes')}" />
+            </div >
+          </form>
+        </div>
+      </div>
+    </div>
+
+  </body></py:match>
+
+  <xi:include href="layout.html" />
+</html>
+

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_advanced.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_advanced.html?rev=1340111&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_advanced.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_advanced.html Fri May 18 14:46:24 2012
@@ -0,0 +1,51 @@
+<!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:py="http://genshi.edgewall.org/"
+      xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="bh_prefs.html" />
+  <head>
+    <title>Advanced</title>
+  </head>
+  <body>
+
+    <form class="form-horizontal" action="" method="post">
+      <div class="control-group">
+        <label class="control-label" for="newsid">Session key:</label>
+        <div class="controls">
+          <input type="text" name="newsid" id="newsid" size="30"
+              value="${settings.session_id}" />
+          <p class="help-block">
+          <span class="label label-info">Notice</span>
+          The session key is used to identify stored custom
+          settings and session data on the server. Although it is
+          automatically generated by default, you may change it to something
+          easier to remember at any time if you wish to load your settings
+          in a different web browser.</p>
+          <br/>
+          <input class="btn" type="submit" name="change" value="${_('Change')}" />
+        </div>
+      </div>
+    </form>
+
+    <form action="" method="post" class="form-horizontal">
+      <div class="control-group">
+        <label class="control-label" for="loadsid">Restore session:</label>
+        <div class="controls">
+          <input type="text" name="loadsid" id="loadsid" size="30" value="" />
+          <p class="help-block">
+          <span class="label label-info">Notice</span>
+          You may load a previously created session by entering the
+          corresponding session key below. This lets you share settings between
+          multiple computers and web browsers.</p>
+          <br/>
+          <input class="btn btn-inverse" type="submit" name="restore"
+              value="${_('Load')}" />
+        </div>
+      </div>
+    </form>
+
+  </body>
+</html>
+

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_advanced.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_advanced.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_datetime.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_datetime.html?rev=1340111&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_datetime.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_datetime.html Fri May 18 14:46:24 2012
@@ -0,0 +1,103 @@
+<!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:py="http://genshi.edgewall.org/"
+      xmlns:i18n="http://genshi.edgewall.org/i18n"
+      xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="bh_prefs.html" />
+  <head>
+    <title>Date &amp; Time</title>
+  </head>
+  <body>
+
+    <div class="control-group" 
+        py:with="session_tzname = settings.session.get('tz');
+                    selected_tz = timezone(session_tzname) or utc">
+      <label for="tz" class="control-label">Time zone:</label>
+      <div class="controls">
+        <select id="tz" name="tz">
+          <option value="">Default time zone</option>
+          <option py:for="tzname in timezones" value="$tzname"
+                  selected="${session_tzname != None and
+                              session_tzname.startswith('Etc/') and
+                              selected_tz == timezone(tzname) or
+                              session_tzname == tzname or None}">$tzname</option>
+        </select>
+        <p class="help-block">Configuring your time zone will result in all
+        dates and times displayed on this site to use your time zone
+        instead of that of the server.</p>
+  
+        <!-- This currently crashes Genshi's extractor if you add i18n:msg -->
+        <p class="help-block" py:with="now = datetime.now(utc);
+                                 nowtz = selected_tz.normalize(now.astimezone(selected_tz));
+                                 formatted = format_time(now, 'iso8601', tzinfo=req.tz)"
+                        py:choose="">
+          <i18n:msg params="time">
+            <span class="label label-info">Example</span> The current time is <strong>${format_time(now, 'iso8601', tzinfo=utc)}</strong> <span class="label">UTC</span>.
+          </i18n:msg>
+          <br />
+          <py:when test="session_tzname">
+            <i18n:msg params="tz, formatted">
+              In your time zone ${nowtz.tzname()}, this would be displayed as
+              <strong>$formatted</strong>.
+            </i18n:msg>
+          </py:when>
+          <py:otherwise>
+            <i18n:msg params="formatted">
+              In the default time zone, this would be displayed as <strong>$formatted</strong>.
+            </i18n:msg>
+          </py:otherwise>
+        </p>
+  
+        <p class="help-block" i18n:msg="">
+          <span class="label label-info">Note</span> Universal Co-ordinated Time ( <span class="label">UTC</span> ) is also known as Greenwich Mean Time ( <span class="label">GMT</span> ).<br />
+          A positive offset is used to indicate a timezone at the east of Greenwich, i.e. ahead of Universal Time.
+        </p>
+      </div>
+
+    </div>
+
+    <div class="control-group"
+        py:with="session_lc_time = settings.session.get('lc_time')">
+      <label class="control-label" for="lc_time">Date format:</label>
+      <div class="controls">
+        <select name="lc_time" id="lc_time">
+          <option value="">Default date format</option>
+          <option value="locale" py:if="locales and languages"
+                  selected="${session_lc_time == 'locale' or None}">Your language setting</option>
+          <option value="iso8601"
+                  selected="${session_lc_time == 'iso8601' or None}">ISO 8601 format</option>
+        </select>
+
+        <p class="help-block">
+        <span class="label label-info">Note</span>
+        Configuring your date format will result in formatting
+        and parsing datetime displayed on this site to use your date format
+        instead of that of the server.</p>
+      </div>
+    </div>
+
+    <div class="control-group"
+        py:with="session_dateinfo = settings.session.get('dateinfo')">
+      <label class="control-label" for="dateinfo">Date relative/absolute format:</label>
+      <div class="controls">
+        <select name="dateinfo">
+          <option value="">Default format</option>
+          <option value="relative"
+                  selected="${session_dateinfo == 'relative' or None}">Relative format</option>
+          <option value="absolute"
+                  selected="${session_dateinfo == 'absolute' or None}">Absolute format</option>
+        </select>
+
+        <p class="help-block">
+        <span class="label label-info">Note</span>
+        Configuring your relative/absolute format will result in
+        formatting datetime displayed on this site to use your format instead of
+        that of the server.</p>
+      </div>
+    </div>
+
+  </body>
+</html>
+

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_datetime.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_datetime.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_general.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_general.html?rev=1340111&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_general.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_general.html Fri May 18 14:46:24 2012
@@ -0,0 +1,44 @@
+<!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:py="http://genshi.edgewall.org/"
+      xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="bh_prefs.html" />
+  <head>
+    <title>General</title>
+  </head>
+  <body>
+
+    <div class="control-group">
+      <label class="control-label" for="name">Full name:</label>
+      <div class="controls">
+        <input type="text" id="name" name="name" size="30"
+            placeholder="Jack Pumpkinhead"
+            value="${settings.session.get('name')}" />
+      </div>
+    </div>
+    <div class="control-group">
+      <label class="control-label" for="email">Email address:</label>
+      <div class="controls">
+        <input type="text" id="email" name="email" size="30"
+            placeholder="jack@marvelous.land-of.oz"
+            value="${settings.session.get('email')}" />
+      </div>
+    </div>
+    <p py:choose="" class="help-block">
+      <span class="label label-info">Note</span>
+      <py:when test="req.authname == 'anonymous'">
+        This information is used to automatically populate some forms
+        on this site with your contact details.
+      </py:when>
+      <py:otherwise>
+        This information is used to associate your login name with your
+        email address and full name, which is used for email
+        notification and RSS feeds, for example.
+      </py:otherwise>
+    </p>
+
+  </body>
+</html>
+

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_general.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_general.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_keybindings.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_keybindings.html?rev=1340111&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_keybindings.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_keybindings.html Fri May 18 14:46:24 2012
@@ -0,0 +1,33 @@
+<!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:py="http://genshi.edgewall.org/"
+      xmlns:i18n="http://genshi.edgewall.org/i18n"
+      xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="bh_prefs.html" />
+  <head>
+    <title>Keyboard Shortcuts</title>
+  </head>
+  <body>
+
+    <div class="control-group">
+      <input type="hidden" id="accesskeys_cb" name="accesskeys_cb" value="" />
+      <input type="checkbox" name="accesskeys" value="1"
+          checked="${settings.session.get('accesskeys') or None}" />
+      <label for="accesskeys">
+        Enable access keys
+      </label>
+      <p class="help-block" i18n:msg="">
+      <span class="label label-info">Note</span>
+      This site provides keyboard shortcuts for
+      faster access to certain functions of this site. As these shortcuts can
+      cause conflicts with shortcuts provided by the desktop system or
+      web browser, they are disabled by default. See
+      <a href="${href.wiki('TracAccessibility')}">TracAccessibility</a>
+      for more information on access keys.</p>
+    </div>
+
+  </body>
+</html>
+

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_keybindings.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_keybindings.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_pygments.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_pygments.html?rev=1340111&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_pygments.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_pygments.html Fri May 18 14:46:24 2012
@@ -0,0 +1,53 @@
+<!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:py="http://genshi.edgewall.org/"
+      xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="bh_prefs.html" />
+  <head>
+    <title>Syntax Highlighting</title>
+    <style type="text/css">
+      div.code pre { border: 1px solid #999; font-size: 90%; margin: 1em 2em;
+        padding: 5px; width: 60%;
+      }
+    </style>
+    <link py:for="style in sorted(styles)" rel="stylesheet" type="text/css"
+          href="${href.pygments('%s.css' % style)}" title="${style.title()}" />
+    <script type="text/javascript">
+        (function($){
+              window.switchStyleSheet = function(title) {
+                $('link[rel="stylesheet"][title]').each(function() {
+                  this.disabled = this.getAttribute('title') != title;
+                });
+              }
+      })(jQuery);
+      jQuery(document).ready(function($) {
+        switchStyleSheet("${selection.title()}");
+        $("#pygment_theme").attr("autocomplete", "off").bind('change keypress', function() {
+          switchStyleSheet(this.options[this.selectedIndex].text);
+        });
+      });
+    </script>
+  </head>
+  <body>
+
+    <div>
+      <p class="help-block">
+        <span class="label label-info">Overview</span>
+        The Pygments syntax highlighter can be used with
+        different coloring styles.</p>
+      <br/>
+      <p><label for="pygmennt_theme">Style:</label>
+        <select id="pygment_theme" name="style">
+          <option py:for="style in sorted(styles)" value="${style}"
+                  selected="${selection == style or None}">${style.title()}</option>
+        </select>
+      </p>
+      Preview:
+      <div class="code"><pre>${output}</pre></div>
+    </div>
+
+  </body>
+</html>
+

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_pygments.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_prefs_pygments.html
------------------------------------------------------------------------------
    svn:mime-type = text/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=1340111&r1=1340110&r2=1340111&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py Fri May 18 14:46:24 2012
@@ -60,6 +60,13 @@ class BloodhoundTheme(ThemeBase):
         'admin_versions.html' : ('bh_admin_versions.html', None),
         'admin_products.html' : ('bh_admin_products.html', None),
 
+        # Preferences
+        'prefs_advanced.html' : ('bh_prefs_advanced.html', None),
+        'prefs_datetime.html' : ('bh_prefs_datetime.html', None),
+        'prefs_general.html' : ('bh_prefs_general.html', None),
+        'prefs_keybindings.html' : ('bh_prefs_keybindings.html', None),
+        'prefs_pygments.html' : ('bh_prefs_pygments.html', None),
+
         # Search
         'search.html' : ('bh_search.html', '_modify_search_data'),