mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
Use IconSpec.getIconClassName() instead of Action.getIconFileName() where possible [JENKINS-24170]
This commit is contained in:
1 parent
2f3e1fff21
commit
38ff4f08be
6 files changed
+20
-8
No files matched your search
+1
-1
@@ -51,7 +51,7 @@ THE SOFTWARE.
|
||||
<dependency>
|
||||
<groupId>org.jenkins-ci.plugins.icon-shim</groupId>
|
||||
<artifactId>icon-set</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
|
||||
@@ -35,7 +35,8 @@ THE SOFTWARE.
|
||||
<table style="margin-top: 1em; margin-left:1em;">
|
||||
|
||||
<j:forEach var="act" items="${it.prominentActions}">
|
||||
<t:summary icon="${act.iconFileName}" href="${act.urlName}">
|
||||
<j:set var="icon" value="${act.iconClassName != null ? act.iconClassName : act.iconFileName}"/>
|
||||
<t:summary icon="${icon}" href="${act.urlName}">
|
||||
${act.displayName}
|
||||
</t:summary>
|
||||
</j:forEach>
|
||||
|
||||
@@ -84,8 +84,9 @@ THE SOFTWARE.
|
||||
<table style="padding-left: 2em;" id="management-links">
|
||||
<j:forEach var="m" items="${it.managementLinks}">
|
||||
<l:hasPermission permission="${m.requiredPermission}">
|
||||
<j:if test="${m.iconFileName!=null}">
|
||||
<local:feature icon="${m.iconFileName}" href="${m.urlName}" title="${m.displayName}" requiresConfirmation="${m.requiresConfirmation}">
|
||||
<j:set var="icon" value="${m.iconClassName != null ? m.iconClassName : m.iconFileName}"/>
|
||||
<j:if test="${icon!=null}">
|
||||
<local:feature icon="${icon}" href="${m.urlName}" title="${m.displayName}" requiresConfirmation="${m.requiresConfirmation}">
|
||||
<j:out value="${m.description}"/>
|
||||
<st:include it="${m}" page="info.jelly" optional="true"/>
|
||||
</local:feature>
|
||||
|
||||
@@ -37,8 +37,9 @@ THE SOFTWARE.
|
||||
the action object itself is available in the 'action' variable
|
||||
-->
|
||||
<st:include page="action.jelly" from="${action}" optional="true">
|
||||
<j:if test="${action.iconFileName!=null}">
|
||||
<l:task icon="${h.getIconFilePath(action)}" title="${action.displayName}"
|
||||
<j:set var="icon" value="${action.iconClassName != null ? action.iconClassName + ' icon-md' : action.iconFileName}"/>
|
||||
<j:if test="${icon!=null}">
|
||||
<l:task icon="${icon}" title="${action.displayName}"
|
||||
href="${h.getActionUrl(it.url,action)}" contextMenu="${h.isContextMenuVisible(action)}"/>
|
||||
</j:if>
|
||||
</st:include>
|
||||
|
||||
@@ -58,7 +58,11 @@ THE SOFTWARE.
|
||||
that, we try deriving it by URL (assuming it's a full icon path). If all that fails,
|
||||
we just fall back to the old method by passing a 'src' attribute to the <icon> tag.
|
||||
-->
|
||||
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(icons.toNormalizedIconNameClass(icon) + ' icon-xlg')}"/>
|
||||
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(icon + ' icon-xlg')}"/>
|
||||
<j:if test="${iconMetadata == null}">
|
||||
<!-- Icon could be provided as a simple iconFileName e.g. "settings.png" -->
|
||||
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(icons.toNormalizedIconNameClass(icon) + ' icon-xlg')}"/>
|
||||
</j:if>
|
||||
<j:if test="${iconMetadata == null}">
|
||||
<j:set var="iconMetadata" value="${icons.getIconByUrl(icon)}"/>
|
||||
</j:if>
|
||||
|
||||
@@ -105,7 +105,12 @@ THE SOFTWARE.
|
||||
-->
|
||||
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(attrs.icon)}"/>
|
||||
<j:if test="${iconMetadata == null}">
|
||||
<j:set var="iconMetadata" value="${icons.getIconByUrl(icon)}"/>
|
||||
<!-- Icon could be provided as a simple iconFileName e.g. "settings.png" -->
|
||||
<j:set var="iconMetadata" value="${icons.getIconByClassSpec(icons.toNormalizedIconNameClass(attrs.icon) + ' icon-md')}"/>
|
||||
</j:if>
|
||||
<j:if test="${iconMetadata == null}">
|
||||
<!-- Icon could be provided as an absolute iconFileName e.g. "/plugin/foo/abc.png" -->
|
||||
<j:set var="iconMetadata" value="${icons.getIconByUrl(attrs.icon)}"/>
|
||||
</j:if>
|
||||
|
||||
<j:set var="icon" value="${rootURL}${icon.startsWith('images/') || icon.startsWith('plugin/') ? h.resourcePath : ''}/${icon}"/>
|
||||
|
||||
Reference in new issue
Block a user