提交 cef6b490 编写于 作者: M Matt Moore

Surface a new class-entry form tag for submitting the appropriate invisible $class form field

上级 81ebb628
......@@ -56,13 +56,7 @@ THE SOFTWARE.
<j:set var="descriptor" value="${d}"/>
<j:set var="instance"
value="${it.launcher.descriptor==d ? it.launcher : null}"/>
<f:invisibleEntry>
<!-- Legacy: Remove once plugins have been staged onto $class -->
<input type="hidden" name="stapler-class" value="${d.clazz.name}" />
</f:invisibleEntry>
<f:invisibleEntry>
<input type="hidden" name="$class" value="${d.clazz.name}" />
</f:invisibleEntry>
<f:class-entry descriptor="${d}" />
<st:include from="${d}" page="${d.configPage}" optional="true"/>
</f:dropdownListBlock>
</j:forEach>
......@@ -80,11 +74,7 @@ THE SOFTWARE.
<j:set var="descriptor" value="${d}"/>
<j:set var="instance"
value="${it.retentionStrategy.descriptor==d ? it.retentionStrategy : null}"/>
<tr><td>
<!-- Legacy: Remove once plugins have been staged onto $class -->
<input type="hidden" name="stapler-class" value="${d.clazz.name}" />
<input type="hidden" name="$class" value="${d.clazz.name}" />
</td></tr>
<f:class-entry descriptor="${d}" />
<st:include from="${d}" page="${d.configPage}" optional="true"/>
</f:dropdownListBlock>
</j:if>
......
<!--
The MIT License
Copyright (c) 2014, Google, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<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">
<st:documentation>
Invisible &lt;f:entry> type for embedding a descriptor's $class field.
<st:attribute name="clazz">
The describable class that we are instantiating via structured form submission.
</st:attribute>
<st:attribute name="descriptor">
The descriptor of the describable that we are instantiating via
structured form submission. Mutually exclusive with clazz.
</st:attribute>
</st:documentation>
<j:set var="clazz" value="${attrs.clazz ?: attrs.descriptor.clazz.name}" />
<f:invisibleEntry>
<!-- Legacy: Remove once plugins have been staged onto $class -->
<input type="hidden" name="stapler-class" value="${clazz}" />
<input type="hidden" name="$class" value="${clazz}" />
</f:invisibleEntry>
</j:jelly>
\ No newline at end of file
......@@ -53,13 +53,7 @@ THE SOFTWARE.
title="${d.displayName}" checked="${instance.descriptor==d}">
<j:set var="descriptor" value="${d}" />
<j:set var="instance" value="${instance.descriptor==d?instance:null}" />
<f:invisibleEntry>
<!-- Legacy: Remove once plugins have been staged onto $class -->
<input type="hidden" name="stapler-class" value="${descriptor.clazz.name}"/>
</f:invisibleEntry>
<f:invisibleEntry>
<input type="hidden" name="$class" value="${descriptor.clazz.name}"/>
</f:invisibleEntry>
<f:class-entry descriptor="${descriptor}" />
<st:include from="${d}" page="${d.configPage}" optional="true" />
</f:radioBlock>
</j:forEach>
......
......@@ -50,15 +50,7 @@ THE SOFTWARE.
</j:when>
<j:when test="${dropdownListMode=='generateEntries'}">
<!-- sandwich them by markers so that we know what to show/hide -->
<tr class="dropdownList-start rowvg-start">
<j:if test="${!empty(attrs.staplerClass)}">
<td style="display:none">
<!-- Legacy: Remove once plugins have been staged onto $class -->
<input type="hidden" name="stapler-class" value="${attrs.staplerClass}"/>
<input type="hidden" name="$class" value="${attrs.staplerClass}"/>
</td>
</j:if>
</tr>
<tr class="dropdownList-start rowvg-start" />
<j:choose>
<j:when test="${attrs.lazy!=null and !attrs.selected}">
<l:renderOnDemand capture="${attrs.lazy}" tag="tr">
......@@ -69,6 +61,9 @@ THE SOFTWARE.
<d:invokeBody />
</j:otherwise>
</j:choose>
<j:if test="${!empty(attrs.staplerClass)}">
<f:class-entry clazz="${attrs.staplerClass}" />
</j:if>
<tr class="dropdownList-end rowvg-end" />
</j:when>
</j:choose>
......
......@@ -91,11 +91,9 @@ THE SOFTWARE.
<d:invokeBody/>
<f:class-entry descriptor="${descriptor}" />
<f:block>
<div align="right">
<!-- Legacy: Remove once plugins have been staged onto $class -->
<input type="hidden" name="stapler-class" value="${descriptor.clazz.name}" />
<input type="hidden" name="$class" value="${descriptor.clazz.name}" />
<f:repeatableDeleteButton value="${attrs.deleteCaption}" />
</div>
</f:block>
......
......@@ -47,14 +47,7 @@ THE SOFTWARE.
<j:set var="descriptor" value="${d}" />
<j:set var="instance" value="${currentDescriptor==d?currentInstance:null}" />
<st:include from="${d}" page="${d.configPage}" optional="true" />
<f:invisibleEntry>
<!-- Legacy: Remove once plugins have been staged onto $class -->
<input type="hidden" name="stapler-class" value="${d.clazz.name}" />
</f:invisibleEntry>
<f:invisibleEntry><!-- this tells Stapler which block is for which class -->
<input type="hidden" name="$class" value="${d.clazz.name}" />
</f:invisibleEntry>
<f:class-entry descriptor="${d}" />
</f:radioBlock>
</j:forEach>
</table>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册