-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move the header parts in a taglib #9223
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
78 changes: 4 additions & 74 deletions
78
core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,8 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:i="jelly:fmt" xmlns:x="jelly:xml"> | ||
<j:jelly xmlns:j="jelly:core" xmlns:h="/lib/layout/header"> | ||
<header id="page-header" class="page-header"> | ||
<div class="page-header__brand"> | ||
<div class="logo"> | ||
<a id="jenkins-home-link" href="${rootURL}/"> | ||
<img id="jenkins-head-icon" src="${imagesURL}/svgs/logo.svg" alt="[${logoAlt}]" /> | ||
<img id="jenkins-name-icon" src="${imagesURL}/title.svg" alt="${title}" width="139" height="34" /> | ||
</a> | ||
</div> | ||
|
||
<a class="page-header__brand-link" href="${rootURL}/"> | ||
<img src="${imagesURL}/svgs/logo.svg" | ||
alt="[${logoAlt}]" | ||
class="page-header__brand-image" /> | ||
<span class="page-header__brand-name">Jenkins</span> | ||
</a> | ||
</div> | ||
|
||
<div class="searchbox hidden-xs"> | ||
<!-- search box --> | ||
<j:set var="searchURL" value="${h.searchURL}"/> | ||
<form action="${searchURL}" method="get" style="position:relative;" class="no-json" name="search" role="search"> | ||
<!-- this div is used to calculate the width of the text box --> | ||
<div id="search-box-sizer"/> | ||
<div id="searchform"> | ||
<input name="q" placeholder="${searchPlaceholder}" id="search-box" class="main-search__input" value="${request.getParameter('q')}" role="searchbox" /> | ||
|
||
<span class="main-search__icon-leading"> | ||
<l:icon src="symbol-search"/> | ||
</span> | ||
<a href="${searchHelpUrl}" class="main-search__icon-trailing"> | ||
<l:icon src="symbol-help-circle"/> | ||
</a> | ||
|
||
<div id="search-box-completion" data-search-url="${searchURL}" /> | ||
<st:adjunct includes="jenkins.views.JenkinsHeader.search-box" /> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<div class="login page-header__hyperlinks"> | ||
<div id="visible-am-insertion" class="page-header__am-wrapper" /> | ||
<div id="visible-sec-am-insertion" class="page-header__am-wrapper" /> | ||
|
||
<!-- user icon and login/logout links; only show if authentication is enabled and we're not handling a servlet error --> | ||
<j:if test="${app.useSecurity}"> | ||
<j:choose> | ||
<j:when test="${!h.isAnonymous()}"> | ||
<j:invokeStatic var="user" className="hudson.model.User" method="current" /> | ||
<j:choose> | ||
<j:when test="${user.fullName == null || user.fullName.trim().isEmpty()}"> | ||
<j:set var="userName" value="${user.id}"/> | ||
</j:when> | ||
<j:otherwise> | ||
<j:set var="userName" value="${user.fullName}"/> | ||
</j:otherwise> | ||
</j:choose> | ||
<a href="${rootURL}/${user.url}" class="model-link"> | ||
<l:icon src="symbol-person-circle" class="icon-md"/> | ||
<span class="hidden-xs hidden-sm">${userName}</span> | ||
</a> | ||
<j:if test="${app.securityRealm.canLogOut()}"> | ||
<a href="${rootURL}/logout"> | ||
<l:icon src="symbol-log-out" class="icon-md" /> | ||
<span class="hidden-xs hidden-sm">${logout}</span> | ||
</a> | ||
</j:if> | ||
</j:when> | ||
<j:otherwise> | ||
<st:include it="${app.securityRealm}" page="loginLink.jelly" /> | ||
</j:otherwise> | ||
</j:choose> | ||
</j:if> | ||
</div> | ||
<h:logo/> | ||
<h:searchbox/> | ||
<h:login/> | ||
</header> | ||
<script src="${resURL}/jsbundles/keyboard-shortcuts.js" type="text/javascript"/> | ||
</j:jelly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout"> | ||
<div class="login page-header__hyperlinks"> | ||
<div id="visible-am-insertion" class="page-header__am-wrapper" /> | ||
<div id="visible-sec-am-insertion" class="page-header__am-wrapper" /> | ||
|
||
<!-- user icon and login/logout links; only show if authentication is enabled and we're not handling a servlet error --> | ||
<j:if test="${app.useSecurity}"> | ||
<j:choose> | ||
<j:when test="${!h.isAnonymous()}"> | ||
<j:invokeStatic var="user" className="hudson.model.User" method="current" /> | ||
<j:choose> | ||
<j:when test="${user.fullName == null || user.fullName.trim().isEmpty()}"> | ||
<j:set var="userName" value="${user.id}"/> | ||
</j:when> | ||
<j:otherwise> | ||
<j:set var="userName" value="${user.fullName}"/> | ||
</j:otherwise> | ||
</j:choose> | ||
<a href="${rootURL}/${user.url}" class="model-link"> | ||
<l:icon src="symbol-person-circle" class="icon-md"/> | ||
<span class="hidden-xs hidden-sm">${userName}</span> | ||
</a> | ||
<j:if test="${app.securityRealm.canLogOut()}"> | ||
<a href="${rootURL}/logout"> | ||
<l:icon src="symbol-log-out" class="icon-md" /> | ||
<span class="hidden-xs hidden-sm">${logout}</span> | ||
</a> | ||
</j:if> | ||
</j:when> | ||
<j:otherwise> | ||
<st:include it="${app.securityRealm}" page="loginLink.jelly" /> | ||
</j:otherwise> | ||
</j:choose> | ||
</j:if> | ||
</div> | ||
</j:jelly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core"> | ||
<div class="page-header__brand"> | ||
<div class="logo"> | ||
<a id="jenkins-home-link" href="${rootURL}/"> | ||
<img id="jenkins-head-icon" src="${imagesURL}/svgs/logo.svg" alt="[${logoAlt}]" /> | ||
<img id="jenkins-name-icon" src="${imagesURL}/title.svg" alt="${title}" width="139" height="34" /> | ||
</a> | ||
</div> | ||
|
||
<a class="page-header__brand-link" href="${rootURL}/"> | ||
<img src="${imagesURL}/svgs/logo.svg" | ||
alt="[${logoAlt}]" | ||
class="page-header__brand-image" /> | ||
<span class="page-header__brand-name">Jenkins</span> | ||
</a> | ||
</div> | ||
</j:jelly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout"> | ||
<div class="searchbox hidden-xs"> | ||
<!-- search box --> | ||
<j:set var="searchURL" value="${h.searchURL}"/> | ||
<form action="${searchURL}" method="get" style="position:relative;" class="no-json" name="search" role="search"> | ||
<!-- this div is used to calculate the width of the text box --> | ||
<div id="search-box-sizer"/> | ||
<div id="searchform"> | ||
<input name="q" placeholder="${searchPlaceholder}" id="search-box" class="main-search__input" value="${request.getParameter('q')}" role="searchbox" /> | ||
|
||
<span class="main-search__icon-leading"> | ||
<l:icon src="symbol-search"/> | ||
</span> | ||
<a href="${searchHelpUrl}" class="main-search__icon-trailing"> | ||
<l:icon src="symbol-help-circle"/> | ||
</a> | ||
|
||
<div id="search-box-completion" data-search-url="${searchURL}" /> | ||
<st:adjunct includes="jenkins.views.JenkinsHeader.search-box" /> | ||
</div> | ||
</form> | ||
</div> | ||
<script src="${resURL}/jsbundles/keyboard-shortcuts.js" type="text/javascript"/> | ||
</j:jelly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Tag library that defines components for headers |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now public API. Are we confident a redesign doesn't just randomly change this anytime soon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any substantial change to the header would require a change of the header version in the PartialHeader so that plugins need to react. I might need to stick to the PartialHeader in the PR of my plugin (which is so far the only implementation of a header) https://github.com/jenkinsci/customizable-header-plugin/blob/295683015391e800be41c568b42ac80f6fd7c61b/src/main/java/io/jenkins/plugins/customizable_header/headers/LogoHeader.java#L9