Skip to content

Commit

Permalink
Add support for description in radios
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Dec 28, 2021
1 parent bd30285 commit cd91cff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/main/resources/lib/form/radio.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ THE SOFTWARE.
If specified, this human readable text will follow the radio, and clicking this text also
toggles the radio.
</st:attribute>
<st:attribute name="description">
Description text for the radiobutton, visible below the title.
</st:attribute>
</st:documentation>
<div class="jenkins-radio">
<input class="jenkins-radio__input" type="radio" name="${attrs.name}" onclick="${attrs.onclick}"
id="${attrs.id}" value="${attrs.value}" checked="${attrs.checked?'true':null}"
disabled="${readOnlyMode?'true':null}" />
<label class="jenkins-radio__label ${attrs.id != null ? '' : 'attach-previous'}" for="${attrs.id}">${attrs.title}</label>
<j:if test="${description != null}">
<div class="jenkins-radio__description">
${description}
</div>
</j:if>
<div class="jenkins-radio__children">
<d:invokeBody />
</div>
Expand Down
8 changes: 8 additions & 0 deletions core/src/main/resources/lib/form/radioBlock.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ THE SOFTWARE.
<st:attribute name="title" use="required">
Human readable label text to be rendered next to the radio button.
</st:attribute>
<st:attribute name="description">
Description text for the radiobutton, visible below the title.
</st:attribute>
<st:attribute name="checked" use="required" type="boolean">
Should this control be initially checked or not?
</st:attribute>
Expand Down Expand Up @@ -69,6 +72,11 @@ THE SOFTWARE.
<label class="jenkins-radio__label" for="${name}-${value}">
${title}
</label>
<j:if test="${description != null}">
<div class="jenkins-radio__description">
${description}
</div>
</j:if>
</div>
<f:helpLink url="${help}" featureName="${title}" />
</div>
Expand Down

0 comments on commit cd91cff

Please sign in to comment.