view bitten/templates/bitten_admin_configs.html @ 563:a5a7e19399b5

Autocomplete path names in configuration using trac's autocompletion code (supports trac 0.11 and 0.12) (Emannuel Blot) - fixes #363
author dfraser
date Mon, 11 May 2009 15:15:24 +0000
parents a7c795920c4a
children 1caaefd76375
line wrap: on
line source
<!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/">
  <xi:include href="admin.html" />
  <head>
    <title>Manage Build Configurations</title>
    <script type="text/javascript">
      jQuery(document).ready(function($) {
        $("input[name='path']").suggest("${href.diff()}");
      });
    </script>
  </head>
  <body>
    <h2>Manage Build Configurations</h2>
    <py:choose><form py:when="config" class="mod"
         id="modconfig" method="post" action="">
      <table class="form" summary=""><tr>
        <td class="name"><label>Name:<br />
          <input type="text" name="name"
                 value="$config.name" />
        </label></td>
        <td class="label"><label>Label (for display):<br />
          <input type="text" name="label" size="32"
                 value="$config.label" />
        </label></td>
      </tr><tr>
        <td colspan="2"><fieldset class="iefix">
          <label for="description">
            Description (you may use 
            <a tabindex="42"
               href="${href.wiki('WikiFormatting')}">
              WikiFormatting</a> here):
          </label>
          <p>
            <textarea id="description" name="description"
                      class="wikitext" rows="3" cols="65">$config.description</textarea>
          </p>
          <script type="text/javascript" src="${chrome.htdocs_location}js/wikitoolbar.js"></script>
        </fieldset></td>
      </tr><tr>
        <td colspan="2"><fieldset class="iefix">
          <label for="recipe">Recipe:</label>
          <p>
            <textarea id="recipe" name="recipe" rows="8" cols="78">$config.recipe</textarea>
          </p>
        </fieldset></td>
      </tr></table>
      <fieldset id="repos">
        <legend>Repository Mapping</legend>
        <table class="form" summary=""><tr>
          <th><label for="path">Path:</label></th>
          <td colspan="3"><input id="path" type="text" name="path"
              size="48" value="$config.path" /></td>
        </tr><tr>
          <th><label for="min_rev">
            Oldest revision:
          </label></th>
          <td><input id="min_rev" type="text" name="min_rev" size="8"
                     value="$config.min_rev" /></td>
          <th><label for="max_rev">
            Youngest revision:
          </label></th>
          <td><input id="max_rev" type="text" name="max_rev" size="8"
                     value="$config.max_rev" /></td>
        </tr></table>
      </fieldset>
      <div class="buttons">
        <input type="submit" name="cancel"
               value="Cancel" />
        <input type="submit" name="save" value="Save" />
      </div>
      <div class="platforms">
        <h3>Target Platforms</h3>
        <table class="listing" id="platformlist">
          <thead>
            <tr><th class="sel">&nbsp;</th>
            <th>Name</th><th>Rules</th></tr>
          </thead>
          <tbody>
            <tr py:if="not config.platforms">
              <td colspan="3"><em>(No Platforms)</em></td>
            </tr>
            <tr py:for="platform in config.platforms">
              <td class="sel">
                <input type="checkbox" name="sel"
                       value="$platform.id" />
              </td>
              <td class="name"><a href="$platform.href">
                $platform.name
              </a></td>
              <td class="rules">
                <ul py:if="len(platform.rules)">
                  <li py:for="rule in platform.rules">
                    <code>
                      <strong>$rule.property</strong> ~= 
                      $rule.pattern
                    </code>
                  </li>
                </ul>
              </td>
            </tr>
          </tbody>
        </table>
        <div class="buttons">
          <input type="submit" name="new"
                 value="Add platform" />
          <input type="submit" name="remove"
                 value="Delete selected platforms" />
        </div>
      </div>
    </form>

    <form py:when="platform" class="mod" id="modplatform"
          method="post" action="">
      <div class="field"><label>Target Platform:
        <input type="text" name="name"
               value="$platform.name" />
      </label></div>
      <fieldset>
        <legend>Rules</legend>
        <table><thead><tr>
          <th>Property name</th><th>Match pattern</th>
        </tr></thead><tbody>
          <tr py:for="idx, rule in enumerate(platform.rules)">
            <td><input type="text" name="property_${idx}"
                       value="$rule.property" /></td>
            <td><input type="text" name="pattern_${idx}" 
                       value="$rule.pattern" /></td>
            <td><input type="submit"
                       name="add_rule_${idx}" value="+" />
                <input type="submit" name="rm_rule_${idx}"
                       value="-" />
            </td>
          </tr>
        </tbody></table>
      </fieldset>
      <p class="help">
        The property name can be any of a set of standard
        default properties, or custom properties defined
        in slave configuration files. The default 
        properties are:
      </p>
      <dl class="help">
        <dt><code>os</code>:</dt>
        <dd>The name of the operating system (for example
            "Darwin")</dd>
        <dt><code>family</code>:</dt>
        <dd>The type of operating system (for example
            "posix" or "nt")</dd>
        <dt><code>version</code>:</dt>
        <dd>The operating system version (for example
            "8.10.1)</dd>
        <dt><code>machine</code>:</dt>
        <dd>The hardware architecture (for example "i386"</dd>
        <dt><code>processor</code>:</dt>
        <dd>The CPU model (for example "i386", this may be
            empty or the same as for <code>machine</code>
        </dd>
        <dt><code>name</code>:</dt>
        <dd>The name of the slave</dd>
        <dt><code>ipnr</code>:</dt>
        <dd>The IP address of the slave</dd>
      </dl>
      <p class="help">
        The match pattern is a regular expression.
      </p>
      <div class="buttons">
        <form method="get" action=""><div>
          <input type="hidden"
                 name="${platform.exists and 'edit'
                         or 'new'}" value="" />
          <input type="hidden" name="platform"
                 value="$platform.id" />
          <input type="submit" name="cancel"
                 value="Cancel" /><py:choose>
          <input py:when="platform.exists" type="submit"
                 name="save" value="Save" />
          <input py:otherwise="" type="submit"
                 name="add" value="Add" /></py:choose>
        </div></form>
      </div>
    </form>

    <py:otherwise><form class="addnew" id="addcomp"
                        method="post" action=""><fieldset>
      <legend>Add Configuration:</legend>
      <table summary=""><tr>
        <td class="name"><div  
            class="field"><label>Name:<br />
          <input type="text" name="name" size="12" />
        </label></div></td>
        <td class="label"><div
            class="field"><label>Label:<br />
          <input type="text" name="label" size="22" />
        </label></div></td>
      </tr><tr>
        <td class="path" colspan="2"><div class="field">
          <label>Path:<br />
            <input type="text" name="path" size="32" />
          </label>
        </div></td>
      </tr></table>
      <div class="buttons">
        <input type="submit" name="add" value="Add" />
      </div>
    </fieldset></form>

    <form method="post" action="">
      <table class="listing" id="configlist">
        <thead>
          <tr><th class="sel">&nbsp;</th><th>Name</th>
          <th>Path</th><th>Active</th></tr>
        </thead><tbody>
        <tr py:if="not configs">
          <td colspan="4"><em>(No Build Configurations)</em></td>
        </tr>
        <tr py:for="config in configs">
          <td class="sel">
            <input type="checkbox" name="sel"
                   value="$config.name" />
          </td>
          <td class="name">
            <a href="$config.href">$config.label</a>
          </td>
          <td class="path"><code>$config.path</code></td>
          <td class="active">
            <input type="checkbox" name="active"
                   value="$config.name"
                   checked="${config.active and 'checked'
                              or None}" />
          </td>
        </tr>
      </tbody></table>
      <div class="buttons">
        <input type="submit" name="remove"
               value="Remove selected items" />
        <input type="submit" name="apply"
               value="Apply changes" />
      </div>
    </form></py:otherwise></py:choose>
  </body>
</html>
Copyright (C) 2012-2017 Edgewall Software