/hudson-core/src/main/resources/lib/layout/layout.jelly
http://github.com/hudson/hudson · Unknown · 275 lines · 256 code · 19 blank · 0 comment · 0 complexity · 72d8c87b61a17bffdb7b85173ab432ec MD5 · raw file
- <!--
- The MIT License
- Copyright (c) 2004-2011, Oracle Corporation, Kohsuke Kawaguchi, Nikita Levyankov,
- Daniel Dyer, Seiji Sogabe, Tom Huybrechts
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- 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:i="jelly:fmt">
- <st:documentation>
- Outer-most tag for a normal (non-AJAX) HTML rendering.
- This is used with nested <header>, <side-panel>, and <main-panel>
- to form Hudson's basic HTML layout.
- <st:attribute name="title" use="required">
- Title of the HTML page. Rendered into <title> tag.
- </st:attribute>
- <st:attribute name="norefresh">
- If non-null, auto refresh is disabled on this page.
- This is necessary for pages that include forms.
- </st:attribute>
- <st:attribute name="css" deprecated="true">
- specify path that starts from "/" for loading additional CSS stylesheet.
- path is interprted as relative to the context root. e.g.,
- {noformat}<l:layout css="/plugin/mysuperplugin/css/myneatstyle.css">{noformat}
- This was originally added to allow plugins to load their stylesheets, but
- *the use of thie attribute is discouraged now.*
- plugins should now do so by inserting <style> elements and/or <script> elements
- in <l:header/> tag.
- </st:attribute>
- <st:attribute name="permission">
- If given, this page is only made available to users that has the specified permission.
- (The permission will be checked against the "it" object.)
- </st:attribute>
- </st:documentation>
- <st:header name="Expires" value="0" />
- <st:header name="X-Hudson-Theme" value="default" />
- <st:contentType value="text/html;charset=UTF-8" />
- <!-- The path starts with a "/" character but does not end with a "/" character. -->
- <j:set var="rootURL" value="${request.contextPath}" />
- <j:new var="h" className="hudson.Functions" /><!-- instead of JSP functions -->
- <j:new var="cu" className="hudson.util.CascadingUtil"/> <!-- Utility for cascading functionality -->
- <j:set var="_" value="${h.configureAutoRefresh(request, response, attrs.norefresh!=null)}"/>
- <!--
- load static resources from the path dedicated to a specific version.
- This "/static/VERSION/abc/def.ghi" path is interpreted by stapler to be
- the same thing as "/abc/def.ghi", but this avoids the stale cache
- problem when the user upgrades to new Hudson. Stapler also sets a long
- future expiration dates for such static resources.
- -->
- <j:set var="resURL" value="${rootURL}${h.resourcePath}" />
- <j:set var="imagesURL" value="${rootURL}${h.resourcePath}/images" />
- <html>
- <head>
- ${h.checkPermission(it,permission)}
- <title>${h.appendIfNotNull(title, ' [Hudson]', 'Hudson')}</title>
- <link rel="stylesheet" href="${resURL}/css/style.css?${h.version}" type="text/css" />
- <link rel="stylesheet" href="${resURL}/css/color.css" type="text/css" />
- <j:if test="${attrs.css!=null}">
- <link rel="stylesheet" href="${rootURL}${attrs.css}" type="text/css" />
- </j:if>
- <link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
- <!-- are we running as an unit test? -->
- <script>var isRunAsTest=${h.isUnitTest}; var rootURL="${rootURL}";</script>
- <script src="${resURL}/scripts/prototype.js" type="text/javascript"></script>
- <script src="${resURL}/scripts/behavior.js" type="text/javascript"></script>
- <script src="${resURL}/scripts/sortable.js" type="text/javascript"></script>
- <script src="${resURL}/scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
- <script src="${resURL}/scripts/jquery.blockUI.js" type="text/javascript"></script>
- <!-- To use the debug version of YUI, set the system property 'debug.YUI' to true -->
- <j:set var="yuiSuffix" value="${h.yuiSuffix}" />
- <l:yui module="yahoo" />
- <l:yui module="dom" />
- <l:yui module="event" />
- <j:if test="${h.yuiSuffix=='debug'}">
- <l:yui module="logger" />
- </j:if>
- <l:yui module="animation" />
- <l:yui module="dragdrop" />
- <l:yui module="container" />
- <l:yui module="connection" />
- <l:yui module="autocomplete" />
- <l:yui module="menu" />
- <l:yui module="element" suffix="-beta" />
- <l:yui module="button" />
- <!--l:yui module="editor" suffix="-beta" /-->
- <script src="${resURL}/scripts/hudson-behavior.js?${h.version}" type="text/javascript"></script>
- <script src="${resURL}/scripts/cascading.js?${h.version}" type="text/javascript"></script>
- <script>
- crumb.init("${h.getCrumbRequestField()}", "${h.getCrumb(request)}");
- </script>
-
- <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/container.css" type="text/css"/>
- <link rel="stylesheet" href="${resURL}/scripts/yui/assets/skins/sam/skin.css" type="text/css" />
- <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/skins/sam/container.css" type="text/css"/>
- <link rel="stylesheet" href="${resURL}/scripts/yui/button/assets/skins/sam/button.css" type="text/css" />
- <link rel="stylesheet" href="${resURL}/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" />
- <!--link rel="stylesheet" href="${resURL}/scripts/yui/editor/assets/skins/sam/editor.css" type="text/css" /-->
- <link rel="search" type="application/opensearchdescription+xml" href="${rootURL}/opensearch.xml" title="Hudson" />
- <meta name="ROBOTS" content="INDEX,NOFOLLOW" />
- <j:set var="mode" value="header" />
- <d:invokeBody />
- <j:forEach var="pd" items="${h.pageDecorators}">
- <st:include it="${pd}" page="header.jelly" optional="true" />
- </j:forEach>
- </head>
- <body class="yui-skin-sam">
- <!-- for accessibility, skip the entire navigation bar and etc and go straight to the head of the content -->
- <a href="#skip2content" class="skiplink">Skip to content</a>
- <table id="header" cellpadding="0" cellspacing="0" width="100%" border="0">
- <tr>
- <td id="top-panel" colspan="2">
- <table cellpadding="0" cellspacing="0" width="100%" border="0">
- <tr><td style="font-weight:bold; font-size: 2em;">
- <a href="${rootURL}/"><img src="${imagesURL}/title.png" alt="title" /></a>
- </td><td style="vertical-align: middle; text-align: right; padding-right: 1em;">
- <!-- search box -->
- <j:set var="searchURL" value="${h.searchURL}"/>
- <form action="${searchURL}" method="get" style="position:relative;" class="no-json" name="search">
- <!-- this div determines the minimum width -->
- <div id="search-box-minWidth"/>
- <!-- this div is used to calculate the width of the text box -->
- <div id="search-box-sizer"/>
- <div id="searchform">
- <input name="q" value="search" id="search-box" class="has-default-text defaulted" />
- <st:nbsp />
- <l:searchPopup/>
- <a href="${%searchBox.url}"><img src="${imagesURL}/16x16/help.png" alt="help for search" /></a>
- <div id="search-box-completion" />
- <script>createSearchBox("${searchURL}");</script>
- </div>
- </form>
- </td><td id="login-field"><span>
- <!-- login field -->
- <j:if test="${app.useSecurity}">
- <st:nbsp/>
- <j:choose>
- <j:when test="${!h.isAnonymous()}">
- <span style="white-space:nowrap">
- <a href="${rootURL}/user/${app.authentication.name}"><b>${app.authentication.name}</b></a>
- <j:if test="${app.securityRealm.canLogOut()}">
- |
- <a href="${rootURL}/logout"><b>${%logout}</b></a>
- </j:if>
- </span>
- </j:when>
- <j:otherwise>
- <st:include it="${app.securityRealm}" page="loginLink.jelly" />
- </j:otherwise>
- </j:choose>
- </j:if>
- </span></td></tr>
- </table>
- </td>
- </tr>
- <tr id="top-nav">
- <td id="left-top-nav">
- <j:forEach var="anc" items="${request.ancestors}">
- <j:if test="${h.isModel(anc.object)}">
- <j:if test="${anc.prev.url!=anc.url}">
- <j:if test="${anc.prev!=null}">
- <j:whitespace> » </j:whitespace>
- </j:if>
- <a href="${anc.url}/">
- ${anc.object.displayName}
- </a>
- </j:if>
- </j:if>
- </j:forEach>
- </td>
- <td id="right-top-nav">
- <j:if test="${attrs.norefresh==null}">
- <span class="smallfont">
- <j:choose>
- <j:when test="${h.isAutoRefresh(request)}">
- <a href="?auto_refresh=false">${%DISABLE AUTO REFRESH}</a>
- </j:when>
- <j:otherwise>
- <a href="?auto_refresh=true">${%ENABLE AUTO REFRESH}</a>
- </j:otherwise>
- </j:choose>
- </span>
- </j:if>
- </td>
- </tr>
- </table>
- <table id="main-table" width="100%" height="70%" border="0"
- style="background-image: url(${imagesURL}/hudson.png);
- background-repeat: no-repeat; background-position: bottom left;">
- <tr>
- <td id="side-panel" width="20%">
- <div style="margin-left: 20px; margin-right: 20px; border-top: 1px solid #bbb"></div>
- <div id="navigation">
- <j:set var="mode" value="side-panel" />
- <d:invokeBody />
- <!-- add YUI logger if debugging YUI -->
- <j:if test="${h.yuiSuffix=='debug'}">
- <div id="yui-logreader" style="margin-top:1em"/>
- <script>
- Behaviour.addLoadEvent(function(){
- var logReader = new YAHOO.widget.LogReader("yui-logreader");
- logReader.collapse();
- });
- </script>
- </j:if>
- </div>
- </td>
- <td id="main-panel-container" width="80%" height="100%">
- <table width="100%" height="100%" border="0">
- <tr>
- <td id="global-messages" width="100%">
- <j:forEach var="globalMessage" items="${app.globalMessages}">
- <j:if test="${globalMessage.enabled}">
- <div class="global-message">
- <st:include page="detail.jelly" it="${globalMessage}"/>
- </div>
- </j:if>
- </j:forEach>
- </td>
- </tr>
- <tr>
- <td id="main-panel" width="100%" height="100%">
- <j:set var="mode" value="main-panel" />
- <d:invokeBody/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="100%">
- <tr><td id="footer">
- <span style="padding-right:2em; color:gray">
- ${%Page generated}:
- <i:formatDate value="${h.getCurrentTime()}" type="both" dateStyle="medium" timeStyle="medium"/>
- </span>
- <a href="http://hudson-ci.org/">Hudson ver. ${h.version}</a>
- </td></tr>
- </table>
- <j:forEach var="pd" items="${h.pageDecorators}">
- <st:include it="${pd}" page="footer.jelly" optional="true" />
- </j:forEach>
- </body>
- </html>
- </j:jelly>