Skip to content

Commit

Permalink
Merge pull request #149 from timja/JENKINS-62817-tables-to-divs
Browse files Browse the repository at this point in the history
JENKINS-62817 Tables to divs compat
  • Loading branch information
oleg-nenashev authored Aug 5, 2020
2 parents 171d89f + e8f7ae0 commit 582efd4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:p="/lib/promoted_builds">
<fieldset style="margin-bottom:1em">
<legend>${%Promotion process}</legend>
<table width="100%">
<p:blockWrapper>
<f:entry title="Name" field="name">
<f:textbox />
</f:entry>
Expand Down Expand Up @@ -51,9 +51,9 @@

<f:section title="Criteria">
<f:nested>
<table style="width:100%">
<p:blockWrapper>
<f:descriptorList field="conditions" descriptors="${descriptor.getApplicableConditions(it)}" />
</table>
</p:blockWrapper>
</f:nested>
</f:section>

Expand Down Expand Up @@ -81,6 +81,6 @@
<input type="button" value="${%Delete this promotion process}" class="repeatable-delete show-if-not-only" style="margin-left: 1em;" />
</div>
</f:entry>
</table>
</p:blockWrapper>
</fieldset>
</j:jelly>
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?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">
<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:p="/lib/promoted_builds">
<f:nested>
<f:repeatable var="s" items="${instance.criteria}" noAddButton="true" minimum="1" name="criteria">
<table width="100%">
<p:blockWrapper>
<f:entry title="Name">
<f:textbox name="criteria.name" value="${s.name}" />
</f:entry>
<f:block>
Promote a build when all of the following conditions are met:
</f:block>
<f:entry>
<table>
<p:blockWrapper>
<f:descriptorList varName="condition" descriptors="${descriptor.getApplicableConditions(it)}" instances="${s.conditions.toMap()}" />
</table>
</p:blockWrapper>
</f:entry>

<f:entry>
Expand All @@ -21,7 +22,7 @@
<input type="button" value="Delete" class="repeatable-delete show-if-not-only" style="margin-left: 1em;" />
</div>
</f:entry>
</table>
</p:blockWrapper>
</f:repeatable>
</f:nested>
</j:jelly>
</j:jelly>
23 changes: 23 additions & 0 deletions src/main/resources/lib/promoted_builds/blockWrapper.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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>
This adds a wrapper allowing adding an ID to a field or group of fields that can be targeted by JavaScript
The wrapper will be a `table` tag before form layout changes are merged: https://github.com/jenkinsci/jenkins/pull/3895,
and a `div` tag after that.

</st:documentation>

<j:choose>
<j:when test="${divBasedFormLayout}">
<div>
<d:invokeBody/>
</div>
</j:when>
<j:otherwise>
<table>
<d:invokeBody/>
</table>
</j:otherwise>
</j:choose>

</j:jelly>
Empty file.

0 comments on commit 582efd4

Please sign in to comment.