view bitten/templates/bitten_config.html @ 882:e0bf8de58f1b 0.6.x

0.6dev: Merged [960] from trunk.
author hodgestar
date Thu, 18 Nov 2010 10:38:44 +0000
parents 99c5c7abee14
children
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="layout.html" />
  <xi:include href="macros.html" />
  <head>
    <title>$title</title>
    <script type="text/javascript" src="${req.href.chrome('bitten', 'excanvas.js')}"></script>
    <script type="text/javascript" src="${req.href.chrome('bitten', 'jquery.flot.js')}"></script>
  </head>
  <body>
    <strong py:def="build_status(status)" class="status">
      <py:choose test="status">
      <py:when test="'completed'">Success</py:when>
      <py:when test="'failed'">Failed</py:when>
      <py:when test="'in progress'">In-progress</py:when>
      </py:choose>
    </strong>
    
    <div py:def="build_time(build)" class="system">
      <py:choose>
	<span py:when="build.stopped">
	  <div>Duration: ${build.duration}</div>
	</span>
	<span py:otherwise="">
	  <div>${build.started} (${build.started_delta} ago)</div>
	</span>
      </py:choose>
    </div>

    <div py:def="slave_info(slave)" class="system">
      <strong>$slave.name</strong> ($slave.ipnr)<br />
      $slave.os_name $slave.os_version
      <py:if test="slave.machine or slave.processor"> / </py:if>
      ${slave.processor or slave.machine or ''}
    </div>
    
    <ul py:def="build_steps(steps)" py:if="steps" class="steps">
      <li py:for="step in steps"
          class="${step.cls}">
        <span class="duration">$step.duration</span> 
        <a href="$step.href" title="${step.description or None}">
          $step.name
        </a>
        <ul py:if="step.status is 'failed' and step.errors">
          <li py:for="error in step.errors">$error</li>
        </ul>
      </li>
    </ul>
 
    <div id="content" class="build">
      <h1>$title</h1><py:choose test="page_mode"><py:when test="'overview'">
      <py:if test="builds_pending">
       <div>$builds_pending pending build<py:if test="builds_pending > 1">s</py:if>
       </div></py:if><py:if test="builds_inprogress">
       <div>$builds_inprogress in-progress build<py:if test="builds_inprogress > 1">s</py:if>
      </div></py:if>
      <form id="prefs" method="get" action="">
        <div>
          <input type="checkbox" id="showall" name="show" value="all"
                 checked="${show_all and 'checked' or None}" />
          <label for="showall">Show deactivated configurations</label>
        </div>
        <div class="buttons">
          <input type="submit" value="Update" />
        </div>
      </form><py:for each="config in configs">
      <h2 class="config ${not config.active and 'deactivated' or ''}">
        <a href="$config.href">$config.label</a>
      </h2><py:if test="config.builds_pending">
        <div>$config.builds_pending pending
          build<py:if test="config.builds_pending > 1">s</py:if>&nbsp;<i>(<py:for each="platform in config.platforms">
        <py:if test="platform.builds_pending">
          $platform.name: $platform.builds_pending
        </py:if></py:for>)</i>
       </div></py:if><py:if test="config.builds_inprogress">
       <div>$config.builds_inprogress in-progress
         build<py:if test="config.builds_inprogress > 1">s</py:if>&nbsp;<i>(<py:for each="platform in config.platforms"><py:if test="platform.builds_inprogress">
            $platform.name: $platform.builds_inprogress
          </py:if></py:for>)</i>
      </div></py:if>
      <div py:if="config.description" class="description">
        $config.description
      </div><py:if test="len(config.builds)">
      <h3 class="builds"><a href="$config.href">Latest builds</a></h3>
      <table class="builds"><tbody><tr>
        <th py:with="youngest_rev = config.youngest_rev">
          <a href="$youngest_rev.href">[$youngest_rev.display_rev]</a>
          by ${format_author(youngest_rev.author)}<p class="date">$youngest_rev.date</p>
          <p class="message">$youngest_rev.message</p>
        </th>
        <td py:for="build in config.builds" class="$build.cls"><py:choose>
        <py:when test="build.status != 'pending'">
          <a href="$build.href">$build.platform</a>
          <p class="date">$build.stopped</p>
          ${slave_info(build.slave)}
          ${build_status(build.status)}
        </py:when><py:otherwise>
          <strong>$build.platform</strong>
          <p class="nobuild">No build yet</p>
        </py:otherwise></py:choose>
        </td>
      </tr></tbody></table></py:if></py:for>

    </py:when><py:when test="'view_config'">
      <div id="charts"><py:for each="chart in config.charts">
        <h3 id="chart_${chart.category}_title" style="text-align: center;"/>
        <div id="chart_${chart.category}" style="${chart.style}"></div>
        <script type="text/javascript">
          $(document).ready(function() { 
               
              $.getJSON('${chart.href}', function(json) { 
                   
                  $("#chart_${chart.category}_title").append(json.title);
                  json.options['xaxis']['tickFormatter'] = function(rev) { return "[" + rev + "]"; }; 
                  $.plot($("#chart_${chart.category}"), json.data, json.options); 
              }); 
          });
        </script>
        <br /></py:for>
      </div>
      <form py:if="config.can_modify" id="prefs" method="post"
            class="activation"><py:choose>
        <div py:when="not config.active" class="help">
          This build configuration is currently inactive.<br />
          No builds will be initiated for this configuration<br />
          until it is activated.
        </div>
        <div py:otherwise="" class="help">
          This configuration is currently active.
        </div></py:choose>
        <div class="buttons" py:choose="">
          <input type="hidden" name="action" value="edit" />
          <input py:when="config.active" type="submit" name="deactivate"
                 value="Deactivate" />
          <input py:otherwise="" type="submit" name="activate"
                 value="Activate" />
        </div>
      </form>
      <p class="path">
        Repository path: 
        <a py:if="config.path" href="$config.browser_href">$config.path</a>
        ${not config.path and '&mdash;' or ''}
        <py:if test="config.min_rev or config.max_rev">
        (<py:if test="config.min_rev">starting at 
         <a href="$config.min_rev_href">[$config.min_rev]</a></py:if>
         <py:if test="config.min_rev and config.max_rev">, </py:if>
         <py:if test="config.max_rev">up to 
         <a href="$config.max_rev_href">[$config.max_rev]</a></py:if>)
        </py:if>
      </p>
      <div py:if="config.description" class="description">
        $config.description
      </div>
      <div class="buttons">
        ${attach_file_form(config.attachments)}
      </div>
      ${list_of_attachments(config.attachments, compact=True)}
      <py:if test="config.builds_pending">
      <div>$config.builds_pending pending build<py:if test="config.builds_pending > 1">s</py:if>&nbsp;<i>(<py:for each="platform in config.platforms">
        <py:if test="platform.builds_pending">
          $platform.name: $platform.builds_pending
        </py:if></py:for>)</i>
       </div></py:if><py:if test="config.builds_inprogress">
	<div>$config.builds_inprogress in-progress build<py:if test="config.builds_inprogress > 1">s</py:if>&nbsp;<i>(<py:for each="platform in config.platforms"><py:if test="platform.builds_inprogress">
	$platform.name: $platform.builds_inprogress
        </py:if></py:for>)</i>
      </div></py:if>

      <table py:if="config.platforms and config.builds"
             class="listing" id="builds">
        <thead><tr>
          <th class="chgset"><abbr title="Changeset">Chgset</abbr></th>
          <th py:for="platform in config.platforms">$platform.name</th>
        </tr></thead>
        <tbody py:if="config.builds">
          <tr py:for="rev_num in config.revisions"
              py:with="rev = config.builds[rev_num]">
            <th class="chgset" scope="row">
              <a href="$rev.href" title="View Changeset">[$rev.display_rev]</a>
            </th><py:for each="platform in config.platforms"><py:choose>
            <td py:when="platform.id in rev" py:with="build = rev[platform.id]"
                class="$build.cls">
              <div class="info">
                <a href="$build.href" title="View build results">
                  $build.id
                  ${build_status(build.status)}
                </a>
                ${slave_info(build.slave)}
		${build_time(build)}
              </div>
              ${build_steps(build.steps)}
            </td>
            <td py:otherwise="">&mdash;</td></py:choose></py:for>
          </tr>
        </tbody>
      </table>
      <br style="clear: right"/>

    </py:when><py:when test="'view-inprogress'">
      <py:for each="config in configs">
      <h2 class="config ${not config.active and 'deactivated' or ''}">
        <a href="$config.href">$config.label</a>
      </h2>
      <table class="listing" id="builds">
        <thead><tr>
          <th class="chgset" abbrev="Changeset">Chgset</th><th>Build</th>
        </tr></thead><tbody>
        <tr py:for="build in config.builds">
          <th class="chgset" scope="row">
            <a href="$build.rev_href" title="View Changeset">[$build.rev]</a>
          </th>
          <td class="$build.cls">
            <div class="info">
              <a href="$build.href" title="View build results">
                $build.id: <strong class="status">$build.platform</strong>
              </a>
              ${slave_info(build.slave)}
              ${build_time(build)}
            </div>
            ${build_steps(build.steps)}
          </td>
        </tr></tbody>
      </table></py:for></py:when>
    </py:choose></div>
  </body>
</html>
Copyright (C) 2012-2017 Edgewall Software