Skip to content

Commit

Permalink
table enhancement (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 authored Apr 18, 2024
1 parent 145c17e commit ba80ecb
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 53 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>ionicons-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
Expand Down
87 changes: 46 additions & 41 deletions src/main/resources/lib/configfiles/configfiles.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -26,56 +26,61 @@ THE SOFTWARE.
<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:cf="/lib/configfiles">

<st:adjunct includes="org.jenkinsci.plugins.configfiles.styles"/>
<j:set var="groupedConfigs" value="${attrs.groupedConfigs}"/>

<div class="excerpt">

<j:forEach var="pEntry" items="${groupedConfigs}">
<p/>
<p/>
<table class="pane">
<tr valign="center" style="border-top: 0px;">
<td class="pane-header" colspan="3">
<i>
<table class="jenkins-table cfp-table">
<j:forEach var="pEntry" items="${groupedConfigs}">
<tbody>
<tr class="cfp-table__section-header cfp-table__section-header--title">
<td colspan="6" >
${pEntry.key.displayName}
</i>
</td>
</tr>
<j:forEach var="t" items="${pEntry.value}">
<tr valign="center" style="border-top: thin inset darkgray">
<td width="32">
<a href="editConfig?id=${t.id}">
<l:icon title="${%edit script} ${t.name}"
class="icon-notepad icon-md"/>
</a>
<j:out value=" "/>
<l:confirmationLink href="removeConfig?id=${t.id}" post="true" message="Sure you want to delete [${t.name}]?">
<l:icon title="${%remove script} ${t.name}"
class="icon-edit-delete icon-md"/>
</l:confirmationLink>
</td>
<td>
<i>
${t.name}
</i>
</td>
<td>
<code>
${t.id}
</code>
</td>
</tr>
<tr>
<td>
${t.contentType}
<tr class="cfp-table__section-header cfp-table__section-header--fields">
<td class="jenkins-table__cell--tight cfp-table__icon">
${%E}
</td>
<td>
${t.comment}
<td class="jenkins-table__cell--tight cfp-table__icon">
${%D}
</td>
<td></td>
<td>${%Name}</td>
<td>${%ID}</td>
<td>${%Comment}</td>
<td>${%Content Type}</td>
</tr>
</j:forEach>
</table>
</j:forEach>
<j:forEach var="t" items="${pEntry.value}">
<tr>
<td class="jenkins-table__cell--tight cfp-table__icon">
<a href="editConfig?id=${t.id}">
<l:icon tooltip="${%Edit script} ${t.name}" src="symbol-create-outline plugin-ionicons-api"
class="icon-md"/>
</a>
</td>
<td class="jenkins-table__cell--tight cfp-table__icon">
<l:confirmationLink href="removeConfig?id=${t.id}" post="true" message="Sure you want to delete [${t.name}]?">
<l:icon tooltip="${%Remove script} ${t.name}" src="symbol-trash-outline plugin-ionicons-api"
class="icon-md"/>
</l:confirmationLink>
</td>
<td>
${t.name}
</td>
<td>
${t.id}
</td>
<td>
${t.comment}
</td>
<td>
${t.contentType}
</td>
</tr>
</j:forEach>
</tbody>
</j:forEach>
</table>
</div>
</j:jelly>
1 change: 1 addition & 0 deletions src/main/resources/lib/configfiles/selectprovider.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ THE SOFTWARE.
<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:set var="providers" value="${attrs.providers}" />

<st:adjunct includes="org.jenkinsci.plugins.configfiles.styles"/>
<f:form name="addConfig" method="post" action="addConfig">
<j:if test="${error != null}">
<j:out value="${error.renderHtml()}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ THE SOFTWARE.
<l:layout title="${%filetype}" norefresh="true">
<cf:sitepanel />

<!-- TODO Remove when Jenkins LTS release is no longer supported by update center -->
<style>
.jenkins-radio__label {
margin-left: 5px;
font-weight: 600;
}
.jenkins-radio__description {
margin: 4px 0 10px 21px;
color: var(--text-color-secondary);
}
</style>

<l:main-panel>
<div class="jenkins-app-bar">
<div class="jenkins-app-bar__content">
Expand Down
34 changes: 34 additions & 0 deletions src/main/resources/org/jenkinsci/plugins/configfiles/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.cfp-table {
width: auto;
}

.cfp-table__icon {
text-align: center!important;
width: 3rem!important;
}

.cfp-table__section-header > td {
background-color: color-mix(in srgb, var(--medium-grey) 20%, var(--light-grey))!important;
height: unset!important;
font-weight: 600!important;
padding-top: 0!important;
padding-bottom: 0!important;
}

.cfp-table > tbody:not(:first-of-type):before {
content: "";
display: block;
height: 20px;
}

.cfp-table__section-header--title > td {
padding: 0 .5rem!important;
}

.cfp-table__section-header--fields > td:not(.cfp-table__icon) {
padding-left: 1.6rem!important;
}

.jenkins-radio__label {
font-weight: 600;
}

0 comments on commit ba80ecb

Please sign in to comment.