tagForm.jelly 3.2 KB
Newer Older
K
kohsuke 已提交
1 2 3 4 5 6
<!--
  Displays the form to choose the tag name.

  This belongs to a build view.
-->
<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">
7 8 9

  <d:taglib uri="local">
    <d:tag name="tagForm">
K
kohsuke 已提交
10
      <form action="submit" method="get">
K
kohsuke 已提交
11 12
        <table>
          <f:block>
K
i18n  
kohsuke 已提交
13
            ${%Choose the CVS tag name for this build}:
14 15
            <input type="text" name="name" value="hudson-${it.build.number}" class="validated"
                   checkUrl="'checkTag?value='+escape(this.value)"/>
K
kohsuke 已提交
16 17
          </f:block>

18
          <j:set var="upstream" value="${it.build.transitiveUpstreamBuilds}" />
K
kohsuke 已提交
19 20 21 22
          <j:if test="${!empty(upstream)}">
            <f:optionalBlock name="upstream" title="Tag all upstream builds at once" help="/help/_cvs/tagAll.html">
              <j:forEach var="up" items="${upstream}">
                <f:entry title="${up.key.name} #${up.value}">
23 24
                  <input type="text" name="upstream.${up.key.name}" value="hudson-${up.value}" class="validated"
                         checkUrl="'checkTag?value='+escape(this.value)"/>
K
kohsuke 已提交
25 26 27 28 29 30
                </f:entry>
              </j:forEach>
            </f:optionalBlock>
          </j:if>

          <f:entry>
K
kohsuke 已提交
31
            <f:submit value="${%Tag}" />
K
kohsuke 已提交
32 33
          </f:entry>
        </table>
K
kohsuke 已提交
34
      </form>
35 36 37 38 39 40 41 42 43 44 45 46
    </d:tag>
  </d:taglib>

  <l:layout norefresh="true" xmlns:local="local">
    <st:include it="${it.build}" page="sidepanel.jelly" />
    <l:main-panel>
      <h1>Build #${it.build.number}</h1>

      <j:set var="tags" value="${it.tagNames}"/>
      <j:choose>
        <j:when test="${!empty(tags)}">
          <p>
K
i18n  
kohsuke 已提交
47
            ${%This build is already tagged as}
48 49 50 51 52 53 54
            <j:forEach var="t" items="${tags}">
              <st:nbsp />
              <tt>${t}</tt>
            </j:forEach>
          </p>

          <p id="tagButton">
K
i18n  
kohsuke 已提交
55
            <input type="button" value="${%Create another tag}"
56 57 58 59 60 61 62 63 64
                   onclick="Element.show('tagForm');Element.hide('tagButton')"/>
          </p>

          <div id="tagForm" style="display:none;">
            <local:tagForm />
          </div>

          <j:set var="upstream" value="${it.build.upstreamBuilds}" />
          <j:if test="${!empty(upstream)}">
K
i18n  
kohsuke 已提交
65
            <h2>${%Upstream tags}</h2>
66 67
            <table class="pane sortable" style="width:inherit">
              <tr>
K
i18n  
kohsuke 已提交
68 69
                <td class="pane-header">${%Build}</td>
                <td class="pane-header">${%Tag}</td>
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
              </tr>
              <j:forEach var="up" items="${upstream}">
                <tr>
                  <td class="pane">
                    <a href="${rootURL}/${up.key.url}">${up.key.name}</a>
                    <t:buildLink job="${up.key}" number="${up.value}"/>
                  </td>
                  <td class="pane">
                    <j:set var="tag" value="${up.key.getBuildByNumber(up.value).getAction(it.getClass()).tagName}" />
                    ${h.ifThenElse(tag==null,'Not tagged',tag)}
                  </td>
                </tr>
              </j:forEach>
            </table>
          </j:if>
        </j:when>
        <j:otherwise>
          <local:tagForm />
        </j:otherwise>
      </j:choose>
K
kohsuke 已提交
90 91 92
    </l:main-panel>
  </l:layout>
</j:jelly>