Skip to content

Commit

Permalink
[FIXED JENKINS-39300] Use View.getDisplayName() when rendering the vi…
Browse files Browse the repository at this point in the history
…ew tabs

- Also fix the stapler documentation for the <l:tab> tag
  • Loading branch information
stephenc committed Oct 27, 2016
1 parent 8242e0e commit 0763ffd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
Expand Up @@ -27,7 +27,7 @@ THE SOFTWARE.
<!-- view tab bar -->
<l:tabBar>
<j:forEach var="v" items="${views}">
<l:tab name="${v.viewName}" active="${v==currentView}" href="${rootURL}/${v.url}" />
<l:tab name="${v.displayName}" active="${v==currentView}" href="${rootURL}/${v.url}" />
</j:forEach>
<j:if test="${currentView.hasPermission(currentView.CREATE)}">
<l:tab name="+" href="${rootURL}/${currentView.owner.url}newView" active="false"
Expand Down
Expand Up @@ -27,7 +27,7 @@ THE SOFTWARE.
<!-- view tab bar -->
<l:tabBar>
<j:forEach var="v" items="${views}">
<l:tab name="${v.viewName}" active="${v==currentView}" href="${rootURL}/${v.url}" />
<l:tab name="${v.displayName}" active="${v==currentView}" href="${rootURL}/${v.url}" />
</j:forEach>
<j:if test="${currentView.hasPermission(currentView.CREATE)}">
<l:tab name="+" href="${rootURL}/${currentView.owner.url}newView" active="false"
Expand Down
28 changes: 18 additions & 10 deletions core/src/main/resources/lib/layout/tab.jelly
Expand Up @@ -22,24 +22,32 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<!--
<%@ attribute name="name" required="true" type="java.lang.String" %>
<%@ attribute name="href" required="true" type="java.lang.String" %>
<%@ attribute name="active" required="true" type="java.lang.Boolean" %>
<%@ attribute name="title" required="false" type="java.lang.String" %>
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core">
<div class="tab${active?' active':''}">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<st:documentation>
<st:attribute name="name" use="required">
The name of the tab
</st:attribute>
<st:attribute name="href" use="required">
The url of the tab
</st:attribute>
<st:attribute name="active" type="java.lang.Boolean">
Whether the tab is active or not
</st:attribute>
<st:attribute name="title">
The title of the tab
</st:attribute>
</st:documentation>
<div class="tab${attrs.active?' active':''}">
<j:choose>
<j:when test="${active}">
<j:when test="${attrs.active}">
<input type="radio" id="tab-${tabBarId}-${tabIndex}" name="tab-group-${tabBarId}" checked="checked" />
</j:when>
<j:otherwise>
<input type="radio" id="tab-${tabBarId}-${tabIndex}" name="tab-group-${tabBarId}" />
</j:otherwise>
</j:choose>
<a href="${href}" class="${name.equals('+')?'addTab':''}">${name}</a>
<a href="${href}" class="${name.equals('+')?'addTab':''}" title="${attrs.title}">${attrs.name}</a>
</div>
<j:set scope="parent" var="tabIndex" value="${tabIndex+1}" />
</j:jelly>

0 comments on commit 0763ffd

Please sign in to comment.