main.jelly 3.7 KB
Newer Older
K
kohsuke 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:local="local">

  <d:taglib uri="local">
    <d:tag name="relationship">
      <j:if test="${lhs.fingerprintConfigured and rhs.fingerprintConfigured}">
        <st:nbsp/>
        <a href="${rootURL}/projectRelationship?lhs=${lhs.name}&amp;rhs=${rhs.name}">
          <img src="${rootURL}/images/16x16/fingerprint.gif" alt="check relationship"/>
        </a>
      </j:if>
    </d:tag>
  </d:taglib>

  <!-- floating box -->
  <div style="float:right">
  <j:set var="tr" value="${it.lastSuccessfulBuild.testResultAction}" />
  <j:if test="${tr.previousResult!=null}">
K
kohsuke 已提交
18
    <!-- at least two data points are required for a trend report -->
K
kohsuke 已提交
19 20 21 22 23 24 25 26 27 28
    <div align="right">
      <j:set var="mode" value="${h.getCookie(request,'TestResultAction_failureOnly').value}" />
      <j:if test="${mode!=null}">
        <j:set var="trendQueryString1" value="?failureOnly=${mode}" />
        <j:set var="trendQueryString2" value="&amp;failureOnly=${mode}" />
      </j:if>
      <div class="test-trend-caption">
        Test Result Trend
      </div>
      <div>
K
kohsuke 已提交
29
        <img src="testResultTrend${trendQueryString1}" lazymap="testResultTrendMap${trendQueryString1}"/>
K
kohsuke 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
      </div>
      <div style="text-align:right">
        <a href="flipTestResultTrend">
          <j:choose>
            <j:when test="${mode}">
              (show test # and failure #)
            </j:when>
            <j:otherwise>
              (just show failures)
            </j:otherwise>
          </j:choose>
        </a> <st:nbsp/>
        <a href="testResultTrend?width=800&amp;height=600${trendQueryString2}">enlarge</a>
      </div>
    </div>
  </j:if>
  </div>

  <table style="margin-top: 1em; margin-left:1em;">

    <j:forEach var="act" items="${it.prominentActions}">
      <t:summary icon="${act.iconFileName}" href="${act.urlName}">
        ${act.displayName}
      </t:summary>
    </j:forEach>
    <t:summary icon="folder.gif" href="ws/">
      Workspace
    </t:summary>

    <t:artifactList caption="Latest Artifacts"
        build="${it.lastSuccessfulBuild}" baseURL="lastSuccessfulBuild/" />

62 63 64 65
    <t:summary icon="notepad.gif" href="changes">
      Recent Changes
    </t:summary>

K
kohsuke 已提交
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
    <j:if test="${tr!=null}">
      <t:summary icon="clipboard.gif">
        <a href="lastSuccessfulBuild/testReport/">Latest Test Result</a>
        <j:choose>
          <j:when test="${tr.failCount==0}">
            (no failures)
          </j:when>
          <j:when test="${tr.failCount==1}">
            (1 failure)
          </j:when>
          <j:otherwise>
            (${tr.failCount} failures)
          </j:otherwise>
        </j:choose>
      </t:summary>
    </j:if>
  </table>

  <!-- upstream/downstream projects -->
  <j:set var="upstream" value="${it.upstreamProjects}" />
  <j:if test="${!empty(upstream)}">
    <h2>Upstream Projects</h2>
    <ul style="list-style-type: none;">
      <j:forEach var="item" items="${upstream}">
        <li>
          <img src="${rootURL}/images/16x16/${item.buildStatusUrl}"/>
          <a href="../${item.name}/">${item.name}</a>
          <local:relationship lhs="${item}" rhs="${it}"/>
        </li>
      </j:forEach>
    </ul>
  </j:if>
  <j:set var="downstream" value="${it.downstreamProjects}" />
  <j:if test="${!empty(downstream)}">
    <h2>Downstream Projects</h2>
    <ul style="list-style-type: none;">
      <j:forEach var="item" items="${downstream}">
        <li>
          <img src="${rootURL}/images/16x16/${item.buildStatusUrl}"/>
          <a href="../${item.name}/">${item.name}</a>
          <local:relationship lhs="${it}" rhs="${item}"/>
        </li>
      </j:forEach>
    </ul>
  </j:if>
</j:jelly>