Skip to content

Commit

Permalink
Lint jelly
Browse files Browse the repository at this point in the history
janfaracik committed Nov 20, 2023
1 parent d9cbaa0 commit ec27b15
Showing 613 changed files with 5,859 additions and 7,535 deletions.
8 changes: 7 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"endOfLine": "auto",
"htmlWhitespaceSensitivity": "ignore"
"htmlWhitespaceSensitivity": "ignore",
"overrides": [
{
"files": "*.jelly",
"options": { "parser": "html", "printWidth": 250 }
}
]
}
22 changes: 7 additions & 15 deletions core/src/main/resources/hudson/AboutJenkins/index.jelly
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ THE SOFTWARE.
<l:header>
<script src="${resURL}/jsbundles/section-to-tabs.js" type="text/javascript" defer="true" />
</l:header>

<l:main-panel>
<div class="app-about-branding">
<div class="app-about-branding__aurora"></div>
@@ -39,9 +39,7 @@ THE SOFTWARE.
<div class="jenkins-app-bar">
<div class="jenkins-app-bar__content">
<h1 class="app-about-heading">Jenkins</h1>
<p class="app-about-version">
${%Version} ${app.VERSION}
</p>
<p class="app-about-version">${%Version} ${app.VERSION}</p>
</div>
<div class="jenkins-app-bar__controls">
<a href="https://www.jenkins.io/participate/" class="jenkins-button" target="_blank">
@@ -55,11 +53,11 @@ THE SOFTWARE.

<div class="jenkins-tab-pane">
<h2 class="jenkins-tab-pane__title">${%maven.dependencies}</h2>
<j:set var="uri" value="${it.licensesURL}"/>
<j:set var="uri" value="${it.licensesURL}" />
<j:choose>
<j:when test="${uri != null}">
<t:thirdPartyLicenses>
<j:include uri="${uri}"/>
<j:include uri="${uri}" />
</t:thirdPartyLicenses>
</j:when>
<j:otherwise>
@@ -81,9 +79,7 @@ THE SOFTWARE.
<tbody>
<tr>
<td>
<a class="jenkins-table__link" href="https://github.com/jenkins-contrib-themes/jenkins-core-theme">
Jenkins Contrib Themes
</a>
<a class="jenkins-table__link" href="https://github.com/jenkins-contrib-themes/jenkins-core-theme">Jenkins Contrib Themes</a>
</td>
<td>
<a class="jenkins-table__link" href="https://github.com/afonsof">Afonso Franca</a>
@@ -100,9 +96,7 @@ THE SOFTWARE.
<a class="jenkins-table__link" href="https://github.com/ionic-team">Ionic</a>
</td>
<td>
<a class="jenkins-table__link" href="https://github.com/ionic-team/ionicons/blob/master/LICENSE">MIT
License
</a>
<a class="jenkins-table__link" href="https://github.com/ionic-team/ionicons/blob/master/LICENSE">MIT License</a>
</td>
</tr>
</tbody>
@@ -123,9 +117,7 @@ THE SOFTWARE.
<td>
<a class="jenkins-table__link" href="${rootURL}/plugin/${p.shortName}/wrapper/thirdPartyLicenses">
<j:choose>
<j:when test="${p.active}">
${p.displayName}
</j:when>
<j:when test="${p.active}">${p.displayName}</j:when>
<j:otherwise>
<strike>${p.displayName}</strike>
</j:otherwise>
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:st="jelly:stapler">
${%blurb}
</j:jelly>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:st="jelly:stapler">${%blurb}</j:jelly>
Original file line number Diff line number Diff line change
@@ -26,10 +26,10 @@ 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">
<div class="alert alert-danger">
<dl>
<dt>${%PluginCycles}</dt>
<j:forEach var="p" items="${it.pluginsWithCycle}">
<dd><j:out value="${p.longName} v${p.version}"/></dd>
</j:forEach>
<dt>${%PluginCycles}</dt>
<j:forEach var="p" items="${it.pluginsWithCycle}">
<dd><j:out value="${p.longName} v${p.version}" /></dd>
</j:forEach>
</dl>
</div>
</j:jelly>
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:st="jelly:stapler">
${%blurb}
</j:jelly>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:st="jelly:stapler">${%blurb}</j:jelly>
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:st="jelly:stapler">
${%blurb}
</j:jelly>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:st="jelly:stapler">${%blurb}</j:jelly>
Original file line number Diff line number Diff line change
@@ -26,9 +26,13 @@ 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">
<div class="alert alert-danger">
<dl>
<dt>${%RequiredPluginUpdates}</dt>
<j:forEach var="p" items="${it.pluginsToBeUpdated}">
<dd><j:out value="${p.pluginName}"/> — <j:out value="${p.message}"/></dd>
<dt>${%RequiredPluginUpdates}</dt>
<j:forEach var="p" items="${it.pluginsToBeUpdated}">
<dd>
<j:out value="${p.pluginName}" />
<j:out value="${p.message}" />
</dd>
</j:forEach>
</dl>
</div>
60 changes: 38 additions & 22 deletions core/src/main/resources/hudson/PluginManager/_api.jelly
Original file line number Diff line number Diff line change
@@ -25,24 +25,35 @@ 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" xmlns:i="jelly:fmt">
<h2>Uploading a plugin</h2>
<p>Permission required: <code>Overall/Administer</code></p>
<p>
You can upload a plugin from HTTP client by POST to <a href="../uploadPlugin">this URL</a> with <a href="https://datatracker.ietf.org/doc/html/rfc2388">multipart/form-data</a> MIME type.
Permission required:
<code>Overall/Administer</code>
</p>
<p>
You can upload a plugin from HTTP client by POST to
<a href="../uploadPlugin">this URL</a>
with
<a href="https://datatracker.ietf.org/doc/html/rfc2388">multipart/form-data</a>
MIME type.
</p>

<h2>Making sure all the needed plugins are installed</h2>
<p>Permission required: <code>Overall/Administer</code></p>
<p>
Jenkins uses an XML format for representing most of complex objects internally (such as agents, views, jobs, and builds.)
As such, it has various APIs that send/receive those XMLs. For example, you can create a new job by POSTing its XML representation.
Starting 1.482, Jenkins annotates these XMLs with additional information indicating what plugins have been used in them.
This improves the portability of those XML files.
</p><p>
By POSTing such XML to <a href="../prevalidateConfig">this URL</a>, you can find out if any plugins are missing or too old.
This method responds with a JSON array that contains one entry for every missing/outdated plugin. If this method
returns an empty array, then you know that this Jenkins has every plugin needed to accept the submitted XML.
Permission required:
<code>Overall/Administer</code>
</p>
<p>
Jenkins uses an XML format for representing most of complex objects internally (such as agents, views, jobs, and builds.) As such, it has various APIs that send/receive those XMLs. For example, you can create a new job by POSTing its XML
representation. Starting 1.482, Jenkins annotates these XMLs with additional information indicating what plugins have been used in them. This improves the portability of those XML files.
</p>
<blockquote><pre>
<p>
By POSTing such XML to
<a href="../prevalidateConfig">this URL</a>
, you can find out if any plugins are missing or too old. This method responds with a JSON array that contains one entry for every missing/outdated plugin. If this method returns an empty array, then you know that this Jenkins has every plugin
needed to accept the submitted XML.
</p>
<blockquote>
<pre>
Sample response:

Content-Type: application/javascript; charset=UTF-8
@@ -51,16 +62,21 @@ Content-Type: application/javascript; charset=UTF-8
{ name: "findbugs", version: "1.5", mode:"missing" },
{ name: "checkstyle", version: "1.3", mode:"old" }
]
</pre></blockquote>
</pre
>
</blockquote>
<p>
Whereas
<a href="../prevalidateConfig">prevalidateConfig</a>
call runs without any side-effect, you can also submit the same XML to
<a href="../installNecessaryPlugins">installNecessaryPlugins</a>
endpoint to install missing plugins and updating old ones. This calls returns immediately after initiating plugin installation process, without waiting for the completion of those.
</p>
<p>
Whereas <a href="../prevalidateConfig">prevalidateConfig</a> call runs without any side-effect, you can also
submit the same XML to <a href="../installNecessaryPlugins">installNecessaryPlugins</a> endpoint to
install missing plugins and updating old ones.
This calls returns immediately after initiating plugin installation process, without waiting for the completion
of those.
</p><p>
To wait for the completion of the plugin installations/updates, use <a href="../../updateCenter/api">update center REST API</a>.
In some cases, Jenkins would have to be restarted before newly installed/updated plugins take effect.
See <a href="../../api">restart API</a> for how to do this over the REST API.
To wait for the completion of the plugin installations/updates, use
<a href="../../updateCenter/api">update center REST API</a>
. In some cases, Jenkins would have to be restarted before newly installed/updated plugins take effect. See
<a href="../../api">restart API</a>
for how to do this over the REST API.
</p>
</j:jelly>
157 changes: 75 additions & 82 deletions core/src/main/resources/hudson/PluginManager/advanced.jelly
Original file line number Diff line number Diff line change
@@ -26,94 +26,87 @@ THE SOFTWARE.
Advanced settings for plugin manager
-->
<?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">
<l:layout title="${%Advanced settings} - ${%Plugins}" permission="${app.SYSTEM_READ}">
<j:set var="readOnlyMode" value="${!app.hasPermission(app.ADMINISTER)}"/>
<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">
<l:layout title="${%Advanced settings} - ${%Plugins}" permission="${app.SYSTEM_READ}">
<j:set var="readOnlyMode" value="${!app.hasPermission(app.ADMINISTER)}" />

<st:include page="sidepanel.jelly"/>
<!-- no need for additional breadcrumb here as the side panel offers enough functionality to browse between different pages -->
<st:include page="sidepanel.jelly" />
<!-- no need for additional breadcrumb here as the side panel offers enough functionality to browse between different pages -->

<l:main-panel>
<l:app-bar title="${%Advanced settings}"/>

<div class="jenkins-form">
<section class="jenkins-section jenkins-!-margin-bottom-5">
<h2 class="jenkins-section__title">${%HTTP Proxy Configuration}</h2>
<f:form method="post" action="proxyConfigure" name="proxyConfigure">
<j:scope>
<j:set var="instance" value="${app.proxy}"/>
<j:set var="descriptor" value="${it.proxyDescriptor}"/>
<st:include from="${descriptor}" page="${descriptor.configPage}"/>
</j:scope>
<l:isAdmin>
<f:block>
<f:submit/>
</f:block>
</l:isAdmin>
</f:form>
</section>
<l:main-panel>
<l:app-bar title="${%Advanced settings}" />

<div class="jenkins-form">
<section class="jenkins-section jenkins-!-margin-bottom-5">
<h2 class="jenkins-section__title">${%HTTP Proxy Configuration}</h2>
<f:form method="post" action="proxyConfigure" name="proxyConfigure">
<j:scope>
<j:set var="instance" value="${app.proxy}" />
<j:set var="descriptor" value="${it.proxyDescriptor}" />
<st:include from="${descriptor}" page="${descriptor.configPage}" />
</j:scope>
<l:isAdmin>
<section class="jenkins-section jenkins-!-margin-bottom-5">
<h2 class="jenkins-section__title">${%Deploy Plugin}</h2>
<f:form method="post" action="uploadPlugin" name="uploadPlugin" enctype="multipart/form-data">
<div style="margin-bottom: 1em;">
${%deploytext}
</div>
<f:entry title="${%File}" field="name">
<f:file accept=".hpi,.jpi" />
</f:entry>
<p>${%Or}</p>
<f:entry title="${%URL}">
<f:textbox name="pluginUrl"
class="jenkins-input validated" checkUrl="checkPluginUrl" checkDependsOn="" />
</f:entry>
<f:submit value="${%Deploy}"/>
</f:form>
</section>
<f:block>
<f:submit />
</f:block>
</l:isAdmin>
</f:form>
</section>

<section class="jenkins-section jenkins-!-margin-bottom-5">
<h2 class="jenkins-section__title">${%Update Site}</h2>
<f:form method="post" action="siteConfigure" name="siteConfigure">
<f:entry title="${%URL}">
<j:if test="${app.updateCenter.ID_DEFAULT.equals(app.updateCenter.PREDEFINED_UPDATE_SITE_ID)}">
<a id="reset-to-default" href="#">${%Reset to default}</a>
</j:if>
<f:textbox name="site"
id="update-site-url"
value="${app.updateCenter.getSite(app.updateCenter.ID_DEFAULT).url}"
checkUrl="checkUpdateSiteUrl" checkDependsOn=""/>
</f:entry>
<st:adjunct includes="hudson.PluginManager._updateSite"/>
<l:isAdmin>
<f:block>
<f:submit/>
</f:block>
</l:isAdmin>
</f:form>
<j:set var="hasNonDefault" value="${false}"/>
<j:forEach var="site" items="${app.updateCenter.sites}">
<j:if test="${site.id != app.updateCenter.ID_DEFAULT}">
<j:set var="hasNonDefault" value="${true}"/>
</j:if>
</j:forEach>
</section>
<l:isAdmin>
<section class="jenkins-section jenkins-!-margin-bottom-5">
<h2 class="jenkins-section__title">${%Deploy Plugin}</h2>
<f:form method="post" action="uploadPlugin" name="uploadPlugin" enctype="multipart/form-data">
<div style="margin-bottom: 1em">${%deploytext}</div>
<f:entry title="${%File}" field="name">
<f:file accept=".hpi,.jpi" />
</f:entry>
<p>${%Or}</p>
<f:entry title="${%URL}">
<f:textbox name="pluginUrl" class="jenkins-input validated" checkUrl="checkPluginUrl" checkDependsOn="" />
</f:entry>
<f:submit value="${%Deploy}" />
</f:form>
</section>
</l:isAdmin>

<j:if test="${hasNonDefault}">
<section class="jenkins-section jenkins-!-margin-bottom-5">
<h2 class="jenkins-section__title">${%Other Sites}</h2>
<ul>
<j:forEach var="site" items="${app.updateCenter.sites}">
<j:if test="${site.id != app.updateCenter.ID_DEFAULT}">
<li>${site.url}</li>
</j:if>
</j:forEach>
</ul>
</section>
<section class="jenkins-section jenkins-!-margin-bottom-5">
<h2 class="jenkins-section__title">${%Update Site}</h2>
<f:form method="post" action="siteConfigure" name="siteConfigure">
<f:entry title="${%URL}">
<j:if test="${app.updateCenter.ID_DEFAULT.equals(app.updateCenter.PREDEFINED_UPDATE_SITE_ID)}">
<a id="reset-to-default" href="#">${%Reset to default}</a>
</j:if>
<f:textbox name="site" id="update-site-url" value="${app.updateCenter.getSite(app.updateCenter.ID_DEFAULT).url}" checkUrl="checkUpdateSiteUrl" checkDependsOn="" />
</f:entry>
<st:adjunct includes="hudson.PluginManager._updateSite" />
<l:isAdmin>
<f:block>
<f:submit />
</f:block>
</l:isAdmin>
</f:form>
<j:set var="hasNonDefault" value="${false}" />
<j:forEach var="site" items="${app.updateCenter.sites}">
<j:if test="${site.id != app.updateCenter.ID_DEFAULT}">
<j:set var="hasNonDefault" value="${true}" />
</j:if>
</div>
</l:main-panel>
</l:layout>
</j:forEach>
</section>

<j:if test="${hasNonDefault}">
<section class="jenkins-section jenkins-!-margin-bottom-5">
<h2 class="jenkins-section__title">${%Other Sites}</h2>
<ul>
<j:forEach var="site" items="${app.updateCenter.sites}">
<j:if test="${site.id != app.updateCenter.ID_DEFAULT}">
<li>${site.url}</li>
</j:if>
</j:forEach>
</ul>
</section>
</j:if>
</div>
</l:main-panel>
</l:layout>
</j:jelly>
Loading

0 comments on commit ec27b15

Please sign in to comment.