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