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/04/27 15:58:49 UTC

svn commit: r1331433 - in /incubator/bloodhound/trunk/bloodhound_theme/bhtheme: templates/bh_admin_plugins.html templates/bh_admin_repositories.html theme.py

Author: gjm
Date: Fri Apr 27 13:58:48 2012
New Revision: 1331433

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

Added:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_plugins.html   (with props)
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_repositories.html   (with props)
Modified:
    incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_plugins.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_plugins.html?rev=1331433&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_plugins.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_plugins.html Fri Apr 27 13:58:48 2012
@@ -0,0 +1,141 @@
+<!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/"
+      xmlns:i18n="http://genshi.edgewall.org/i18n">
+  <xi:include href="bh_admin.html" />
+  <head>
+    <title>Plugins</title>
+    <script type="text/javascript"
+        src="${href.chrome('theme/scripts/bootstrap-collapse.js')}"></script>
+  </head>
+
+  <body>
+    <h2>Manage Plugins</h2>
+
+    <div class="row">
+      <div class="span6">
+        <div class="accordion" id="pluginlist">
+          <div class="accordion-group" id="trac-plugin-${plugin.name}"
+              py:for="idx, plugin in enumerate(plugins)">
+            <div class="accordion-heading">
+              <a class="accordion-toggle" data-toggle="collapse" 
+                  data-parent="#pluginlist" href="#body-plugin-${plugin.name}">
+                ${plugin.name} ${plugin.version}
+              </a>
+              <p style="padding: 0px 10px;" py:if="plugin.info">
+                ${plugin.info.get('summary')}
+              </p>
+            </div>
+            <div id="body-plugin-${plugin.name}" class="accordion-body collapse">
+              <div class="accordion-inner">
+                <dl py:if="plugin.info and ('home_page' in plugin.info or
+                           'author' in plugin.info or
+                           'author_email' in plugin.info)"
+                    class="dl-horizontal well">
+                  <py:if test="'author' in plugin.info or 'author_email' in plugin.info">
+                    <dt>Author:</dt>
+                    <dd>
+                      <a py:strip="not plugin.info.get('author_email')"
+                         href="mailto:${plugin.info.author_email}">
+                        ${plugin.info.author or plugin.info.author_email}
+                      </a>
+                    </dd>
+                  </py:if>
+                  <py:if test="plugin.info.get('home_page')">
+                    <dt>Home page:</dt>
+                    <dd>
+                      <a onclick="window.open(this.href); return false"
+                         href="${plugin.info.home_page}">${plugin.info.home_page}</a>
+                    </dd>
+                  </py:if>
+                  <py:if test="plugin.info.get('license')">
+                    <dt>License:</dt>
+                    <dd>${plugin.info.license}</dd>
+                  </py:if>
+                </dl>
+                <form method="post" action="">
+                  <table class="table">
+                    <thead>
+                      <tr>
+                        <th class="full-x">Component</th>
+                        <th class="sel">Enabled</th>
+                      </tr>
+                    </thead>
+                    <tbody py:for="module_name, module in sorted(plugin.modules.iteritems())">
+                      <tr>
+                        <td id="trac-mod-${module_name}">
+                          <i class="icon-tag"></i>
+                          <span class="label">${module_name}.*</span>
+                          <span py:if="module.summary" class="help-inline">
+                            &mdash; ${module.summary}
+                          </span>
+                        </td>
+                        <td class="sel"></td>
+                      </tr>
+                      <tr py:for="component_name, component in sorted(module.components.iteritems())">
+                        <td id="trac-comp-${component.full_name}"
+                            style="padding-left: 28px">
+                          <span class="label label-inverse">
+                            $component_name
+                          </span>
+                          <span py:if="component.summary" class="help-inline"
+                              style="display: inline;">
+                            &mdash; ${component.summary}
+                          </span>
+                        </td>
+                        <td class="sel">
+                          <input py:if="not component.required" type="hidden"
+                              name="component" 
+                              value="${module_name}.${component_name}"/>
+                          <input type="checkbox" name="enable"
+                                 value="${module_name}.${component_name}"
+                                 checked="${component.enabled or None}"
+                                 disabled="${component.required or None}" />
+                        </td>
+                      </tr>
+                    </tbody>
+                  </table>
+                  <div class="control-group">
+                    <input type="hidden" name="plugin" value="$idx" />
+                    <input class="btn btn-warning" type="submit" name="update"
+                        value="${_('Apply changes')}" />
+                  </div>
+                </form>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="span3">
+        <form id="addplug" class="well" method="post" enctype="multipart/form-data" action="">
+          <fieldset>
+            <legend>Install Plugin:</legend>
+            <label i18n:msg="" for="plugin_file">File:</label>
+            <input class="input-medium" type="file" id="plugin_file" size="10"
+                  name="plugin_file" disabled="${readonly or None}" />
+            <py:choose test="readonly">
+              <p class="alert alert-error" py:when="True">
+                <span class="label label-important">Caution</span>
+                The web server does not have sufficient permissions to store files in
+                the environment plugins directory.
+              </p>
+              <p class="help-block" py:otherwise="">
+                <span class="label label-info">Notice</span>
+                Upload a plugin packaged as Python egg.
+              </p>
+            </py:choose>
+            <div class="control-group">
+              <input class="btn btn-danger" type="submit" name="install"
+                  value="${_('Install')}" disabled="${readonly or None}" />
+            </div>
+          </fieldset>
+        </form>
+      </div>
+    </div>
+  </body>
+
+</html>
+

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

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

Added: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_repositories.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_repositories.html?rev=1331433&view=auto
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_repositories.html (added)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_repositories.html Fri Apr 27 13:58:48 2012
@@ -0,0 +1,192 @@
+<!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/"
+      xmlns:i18n="http://genshi.edgewall.org/i18n">
+  <xi:include href="bh_admin.html"/>
+  <head>
+    <title>Repositories</title>
+  </head>
+
+  <body>
+    <h2>Manage Repositories</h2>
+
+    <py:def function="type_field(editable, selected=None)">
+      <div class="control-group">
+        <label class="control-label" for="trac-typetype">Type:</label>
+        <div class="controls">
+          <select class="input-medium" size="1" id="trac-type" name="type"
+              disabled="${not editable or None}">
+            <option py:for="type in types" value="$type" selected="${type == selected or None}">${type or _('(default)')}</option>
+            <option py:if="selected and selected not in types" selected="selected">$selected</option>
+          </select>
+          <p class="help-block">
+            <span class="label label-info">Default</span> $default_type
+          </p>
+        </div>
+      </div>
+    </py:def>
+
+    <py:def function="alias_field(editable, selected=None)">
+      <div class="control-group">
+        <label class="control-label" for="trac-repository">Repository:</label>
+        <div class="controls">
+          <select class="input-medium" size="1" id="trac-repository"
+              name="alias" disabled="${not editable or None}">
+            <option py:for="(reponame, info) in sorted(repositories.iteritems())" py:if="not info.alias"
+                    value="$info.name" selected="${info.name == selected or None}">${info.name or _('(default)')}</option>
+            <option py:if="selected is not None and selected not in repositories" selected="selected">$selected</option>
+          </select>
+        </div>
+      </div>
+    </py:def>
+
+    <py:choose test="view">
+      <form py:when="'detail'" py:with="info = repositories[reponame]"
+          class="well form-horizontal" id="trac-modrepos" method="post"
+          action="">
+        <fieldset py:choose="" py:with="readonly = not info.editable or None">
+          <legend py:when="info.editable">Modify Repository:</legend>
+          <legend py:otherwise="">View Repository:</legend>
+          <p py:if="not info.editable" class="help-block" i18n:msg="">
+            <span class="label label-warning">Warning</span>
+            This repository is defined in <code><a href="${href.wiki('TracIni')}">trac.ini</a></code>
+            and cannot be edited on this page.
+          </p>
+          <div class="control-group">
+            <label class="control-label" for="name">Name:</label>
+            <div class="controls">
+              <input type="text" id="name" name="name" value="$info.name"
+                  readonly="$readonly"/>
+            </div>
+          </div>
+          <py:choose>
+            <py:when test="'alias' in info">
+              ${alias_field(info.editable, info.alias)}
+            </py:when>
+            <py:otherwise>
+              ${type_field(info.editable, info.type)}
+              <div class="control-group">
+                <label class="control-label" for="dir">Directory:</label>
+                <div class="controls">
+                  <input type="text" id="dir" name="dir" size="48"
+                      value="$info.dir" readonly="$readonly"/>
+                </div>
+              </div>
+              <div class="control-group">
+                <label class="control-label" for="url">URL:</label>
+                <div class="controls">
+                  <input type="text" id="url" name="url" size="48"
+                      value="$info.url" readonly="$readonly"/>
+                </div>
+              </div>
+            </py:otherwise>
+          </py:choose>
+          <div class="control-group">
+            <div class="controls">
+              <input type="checkbox" name="hidden" value="1"
+                  checked="${info.hidden or None}" disabled="$readonly"/>
+              Hide from repository index
+            </div>
+          </div>
+          <div class="control-group">
+            <fieldset class="iefix">
+              <label class="control-label" for="description" i18n:msg="">
+                Description:
+              </label>
+             <div class="controls">
+                <textarea id="description" name="description" class="wikitext trac-resizable"
+                    placeholder="Describe this repository using WikiFormatting"
+                    rows="6" cols="60" readonly="$readonly">$info.description</textarea>
+                <p class="help-block">
+                  <span class="label label-info">Tip</span>
+                  you may use <a tabindex="42" href="${href.wiki('WikiFormatting')}">WikiFormatting</a> here
+                </p>
+              </div>
+            </fieldset>
+          </div>
+          <div class="control-group">
+            <input class="btn" type="submit" name="cancel" value="${_('Cancel')}"/>
+            <input class="btn btn-inverse" py:if="info.editable" type="submit"
+                name="save" value="${_('Save')}"/>
+          </div>
+        </fieldset>
+      </form>
+
+      <py:otherwise>
+        <div class="row">
+          <div class="span6">
+    
+            <form id="trac-repository_table" method="post" action="">
+              <table id="trac-reposlist"
+                  class="table table-striped table-condensed table-bordered">
+                <thead>
+                  <tr><th class="sel"><i class="icon-check"></i></th>
+                    <th>Name</th><th>Type</th>
+                    <th class="full-x">Directory</th><th>Revision</th>
+                  </tr>
+                </thead>
+                <tbody>
+                  <tr py:for="(reponame, info) in sorted(repositories.iteritems())">
+                    <td class="sel"><input py:if="info.editable" type="checkbox" name="sel" value="$info.name"/></td>
+                    <td class="name">
+                      <a href="${panel_href(info.name or '(default)')}">${info.name or _('(default)')}</a>
+                    </td>
+                    <td>${(info.type or _('(default)')) if not info.alias else None}</td>
+                    <td py:choose="">
+                      <py:when test="info.dir">$info.prettydir</py:when>
+                      <em py:otherwise="" i18n:msg="repo">Alias of ${info.alias or _('(default)')}</em>
+                    </td>
+                    <td><a py:if="info.rev" href="${href.changeset(info.rev, reponame) or None}">[$info.display_rev]</a></td>
+                  </tr>
+                </tbody>
+              </table>
+              <div class="control-group">
+                <input class="btn" type="submit" name="refresh"
+                    value="${_('Refresh')}"/>
+                <input class="btn btn-warning" type="submit" name="remove"
+                    value="${_('Remove selected items')}"/>
+              </div>
+            </form>
+          </div>
+          <div class="span3">
+            <form class="well" id="trac-addrepos" method="post" action="">
+              <fieldset>
+                <legend>Add Repository:</legend>
+                <label for="name">Name:</label>
+                <input class="input-medium" type="text" id="name" name="name"/>
+                ${type_field(True)}
+                <label for="dir">Directory:</label>
+                <input class="input-medium" type="text" id="dir" name="dir"/>
+                <div class="control-group">
+                  <input class="btn btn-info" type="submit" name="add_repos"
+                      value="${_('Add')}"/>
+                </div>
+              </fieldset>
+            </form>
+
+            <form py:if="any(not info.alias for info in repositories.itervalues())"
+                  class="well" id="trac-addalias" method="post" action="">
+              <fieldset>
+                <legend>Add Alias:</legend>
+                <label for="alias_name">Name:</label>
+                <input class="input-medium" type="text" id="alias_name" 
+                    name="name"/>
+                ${alias_field(True)}
+                <div class="control-group">
+                  <input class="btn btn-info" type="submit" name="add_alias"
+                      value="${_('Add')}"/>
+                </div>
+              </fieldset>
+            </form>
+          </div>
+        </div>
+
+      </py:otherwise>
+    </py:choose>
+  </body>
+
+</html>
+

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

Propchange: incubator/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_repositories.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=1331433&r1=1331432&r2=1331433&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py (original)
+++ incubator/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py Fri Apr 27 13:58:48 2012
@@ -79,6 +79,8 @@ class BloodhoundTheme(ThemeBase):
         'admin_logging.html' : 'bh_admin_logging.html',
         'admin_milestones.html' : 'bh_admin_milestones.html',
         'admin_perms.html' : 'bh_admin_perms.html',
+        'admin_plugins.html' : 'bh_admin_plugins.html',
+        'admin_repositories.html' : 'bh_admin_repositories.html',
         'admin_versions.html' : 'bh_admin_versions.html',
     }
     implements(IRequestFilter)