PageRenderTime 27ms CodeModel.GetById 23ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/hudson-core/src/main/resources/hudson/model/Job/configure.jelly

http://github.com/hudson/hudson
Unknown | 123 lines | 113 code | 10 blank | 0 comment | 0 complexity | d87a6e19c9c2daac25cda79ffa650067 MD5 | raw file
  1<!--
  2The MIT License
  3
  4Copyright (c) 2004-2011, Oracle Corporation, Inc., Kohsuke Kawaguchi, Nikita Levyankov, id:cactusman
  5
  6Permission is hereby granted, free of charge, to any person obtaining a copy
  7of this software and associated documentation files (the "Software"), to deal
  8in the Software without restriction, including without limitation the rights
  9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 10copies of the Software, and to permit persons to whom the Software is
 11furnished to do so, subject to the following conditions:
 12
 13The above copyright notice and this permission notice shall be included in
 14all copies or substantial portions of the Software.
 15
 16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 22THE SOFTWARE.
 23-->
 24
 25<!--
 26  Config page. derived class specific entries should go to configure-entries.jsp
 27-->
 28<?jelly escape-by-default='true'?>
 29<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">
 30  <l:layout title="${it.displayName} Config" norefresh="true" permission="${it.EXTENDED_READ}">
 31    <j:set var="jobUrl" value="${h.getNearestAncestorUrl(request,it)}"/>
 32    <st:include page="sidepanel.jelly" />
 33    <l:main-panel>
 34      <div class="behavior-loading">${%LOADING}</div>
 35      <f:form method="post" action="configSubmit" name="config" tableClass="configure">
 36        <j:set var="descriptor" value="${it.descriptor}" />
 37        <j:set var="instance" value="${it}" />
 38
 39        <j:if test="${it.isNameEditable()}">
 40          <f:entry title="${%name(it.pronoun)}">
 41            <f:textbox name="name" value="${it.name}" />
 42          </f:entry>
 43        </j:if>
 44        <j:set var="cascadingCandidates" value="${cu.getCascadingParents(it.class, it)}"/>
 45        <j:choose>
 46          <j:when test="${cascadingCandidates.size() gt 0}">
 47            <f:entry title="${%cascadingProjectName}" help="/help/project-config/cascadingProject.html">
 48              <select class="setting-input" name="cascadingProjectName">
 49                <f:option value="">${%emptyCascadingProjectName}</f:option>
 50                <j:forEach var="job" items="${cascadingCandidates}">
 51                  <f:option selected="${job.name==it.cascadingProjectName}" value="${job.name}">${job.name}</f:option>
 52                </j:forEach>
 53              </select>
 54            </f:entry>
 55          </j:when>
 56          <j:otherwise>
 57            <f:invisibleEntry>
 58              <input type="hidden" name="cascadingProjectName" value="${it.cascadingProjectName}" />
 59            </f:invisibleEntry>
 60          </j:otherwise>
 61        </j:choose>
 62        <f:entry title="${%Description}" help="/help/project-config/description.html">
 63          <f:textarea name="description" value="${it.description}"/>
 64        </f:entry>
 65
 66        <j:if test="${it.supportsLogRotator()}">
 67          <!-- log rotator -->
 68          <j:set var="logRotatorProperty" value="${cu.getLogRotatorProjectProperty(it, it.LOG_ROTATOR_PROPERTY_NAME)}"/>
 69          <j:set var="logRotator" value="${logRotatorProperty.getValue()}"/>
 70          <f:optionalBlock name="logrotate"
 71            help="/help/project-config/log-rotation.html"
 72            title="${%Discard Old Builds}" checked="${logRotator!=null}"
 73            resetUrl="${jobUrl}/resetProjectProperty?propertyName=${it.LOG_ROTATOR_PROPERTY_NAME}"
 74            isPropertyOverridden="${logRotatorProperty.isOverridden()}">
 75            <st:include page="/hudson/tasks/LogRotator/config.jelly"/>
 76          </f:optionalBlock>
 77        </j:if>
 78
 79        <!-- job property configurations -->
 80        <j:set var="instances" value="${it.properties}" />
 81        <j:forEach var="d" items="${h.getJobPropertyDescriptors(it.getClass())}" varStatus="loop">
 82          <j:scope>
 83            <j:set var="descriptor" value="${d}"/>
 84            <j:set var="instance" value="${instances[d]}"/>
 85            <j:set var="rowSetName" value="${'jobProperty'+loop.index}"/>
 86            <j:set var="propertyOverridden" value="false"/>
 87            <j:if test="${cu.isCascadableJobProperty(descriptor)}">
 88              <j:set var="rowSetName" value="${descriptor.jsonSafeClassName}"/>
 89              <j:set var="cascadingProperty" value="${cu.getBaseProjectProperty(it, descriptor.jsonSafeClassName)}"/>
 90              <j:set var="instance" value="${cascadingProperty.value}"/>
 91              <j:set var="propertyOverridden" value="${cascadingProperty.isOverridden()}"/>
 92            </j:if>
 93            <f:rowSet name="${rowSetName}" isPropertyOverridden='${propertyOverridden}'>
 94              <j:if test="${propertyOverridden}">
 95                <tr>
 96                  <td>
 97                    <div class="optional-reset">
 98                      <a href="#" class="reset-button"
 99                         resetURL="${jobUrl}/resetProjectProperty?propertyName=${cascadingProperty.key}">
100                        <img src="${imagesURL}/16x16/undo.png"/>
101                      </a>
102                    </div>
103                  </td>
104                </tr>
105              </j:if>
106              <st:include from="${d}" page="${d.configPage}" optional="true"/>
107            </f:rowSet>
108          </j:scope>
109        </j:forEach>
110
111        <!-- additional entries from derived classes -->
112        <st:include page="configure-entries.jelly" />
113
114        <j:if test="${h.hasPermission(it,it.CONFIGURE)}">
115          <f:block>
116            <!--<input type="button" name="StructureTest" value="Test" onclick="buildFormTree(this.form)" />-->
117            <f:submit value="${%Save}" />
118          </f:block>
119        </j:if>
120      </f:form>
121    </l:main-panel>
122  </l:layout>
123</j:jelly>