/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

  1. <!--
  2. The MIT License
  3. Copyright (c) 2004-2011, Oracle Corporation, Kohsuke Kawaguchi, Nikita Levyankov,
  4. Daniel Dyer, Seiji Sogabe, Tom Huybrechts
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. THE SOFTWARE.
  20. -->
  21. <?jelly escape-by-default='true'?>
  22. <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:i="jelly:fmt">
  23. <st:documentation>
  24. Outer-most tag for a normal (non-AJAX) HTML rendering.
  25. This is used with nested &lt;header>, &lt;side-panel>, and &lt;main-panel>
  26. to form Hudson's basic HTML layout.
  27. <st:attribute name="title" use="required">
  28. Title of the HTML page. Rendered into &lt;title> tag.
  29. </st:attribute>
  30. <st:attribute name="norefresh">
  31. If non-null, auto refresh is disabled on this page.
  32. This is necessary for pages that include forms.
  33. </st:attribute>
  34. <st:attribute name="css" deprecated="true">
  35. specify path that starts from "/" for loading additional CSS stylesheet.
  36. path is interprted as relative to the context root. e.g.,
  37. {noformat}&lt;l:layout css="/plugin/mysuperplugin/css/myneatstyle.css">{noformat}
  38. This was originally added to allow plugins to load their stylesheets, but
  39. *the use of thie attribute is discouraged now.*
  40. plugins should now do so by inserting &lt;style> elements and/or &lt;script> elements
  41. in &lt;l:header/> tag.
  42. </st:attribute>
  43. <st:attribute name="permission">
  44. If given, this page is only made available to users that has the specified permission.
  45. (The permission will be checked against the "it" object.)
  46. </st:attribute>
  47. </st:documentation>
  48. <st:header name="Expires" value="0" />
  49. <st:header name="X-Hudson-Theme" value="default" />
  50. <st:contentType value="text/html;charset=UTF-8" />
  51. <!-- The path starts with a "/" character but does not end with a "/" character. -->
  52. <j:set var="rootURL" value="${request.contextPath}" />
  53. <j:new var="h" className="hudson.Functions" /><!-- instead of JSP functions -->
  54. <j:new var="cu" className="hudson.util.CascadingUtil"/> <!-- Utility for cascading functionality -->
  55. <j:set var="_" value="${h.configureAutoRefresh(request, response, attrs.norefresh!=null)}"/>
  56. <!--
  57. load static resources from the path dedicated to a specific version.
  58. This "/static/VERSION/abc/def.ghi" path is interpreted by stapler to be
  59. the same thing as "/abc/def.ghi", but this avoids the stale cache
  60. problem when the user upgrades to new Hudson. Stapler also sets a long
  61. future expiration dates for such static resources.
  62. -->
  63. <j:set var="resURL" value="${rootURL}${h.resourcePath}" />
  64. <j:set var="imagesURL" value="${rootURL}${h.resourcePath}/images" />
  65. <html>
  66. <head>
  67. ${h.checkPermission(it,permission)}
  68. <title>${h.appendIfNotNull(title, ' [Hudson]', 'Hudson')}</title>
  69. <link rel="stylesheet" href="${resURL}/css/style.css?${h.version}" type="text/css" />
  70. <link rel="stylesheet" href="${resURL}/css/color.css" type="text/css" />
  71. <j:if test="${attrs.css!=null}">
  72. <link rel="stylesheet" href="${rootURL}${attrs.css}" type="text/css" />
  73. </j:if>
  74. <link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
  75. <!-- are we running as an unit test? -->
  76. <script>var isRunAsTest=${h.isUnitTest}; var rootURL="${rootURL}";</script>
  77. <script src="${resURL}/scripts/prototype.js" type="text/javascript"></script>
  78. <script src="${resURL}/scripts/behavior.js" type="text/javascript"></script>
  79. <script src="${resURL}/scripts/sortable.js" type="text/javascript"></script>
  80. <script src="${resURL}/scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
  81. <script src="${resURL}/scripts/jquery.blockUI.js" type="text/javascript"></script>
  82. <!-- To use the debug version of YUI, set the system property 'debug.YUI' to true -->
  83. <j:set var="yuiSuffix" value="${h.yuiSuffix}" />
  84. <l:yui module="yahoo" />
  85. <l:yui module="dom" />
  86. <l:yui module="event" />
  87. <j:if test="${h.yuiSuffix=='debug'}">
  88. <l:yui module="logger" />
  89. </j:if>
  90. <l:yui module="animation" />
  91. <l:yui module="dragdrop" />
  92. <l:yui module="container" />
  93. <l:yui module="connection" />
  94. <l:yui module="autocomplete" />
  95. <l:yui module="menu" />
  96. <l:yui module="element" suffix="-beta" />
  97. <l:yui module="button" />
  98. <!--l:yui module="editor" suffix="-beta" /-->
  99. <script src="${resURL}/scripts/hudson-behavior.js?${h.version}" type="text/javascript"></script>
  100. <script src="${resURL}/scripts/cascading.js?${h.version}" type="text/javascript"></script>
  101. <script>
  102. crumb.init("${h.getCrumbRequestField()}", "${h.getCrumb(request)}");
  103. </script>
  104. <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/container.css" type="text/css"/>
  105. <link rel="stylesheet" href="${resURL}/scripts/yui/assets/skins/sam/skin.css" type="text/css" />
  106. <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/skins/sam/container.css" type="text/css"/>
  107. <link rel="stylesheet" href="${resURL}/scripts/yui/button/assets/skins/sam/button.css" type="text/css" />
  108. <link rel="stylesheet" href="${resURL}/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" />
  109. <!--link rel="stylesheet" href="${resURL}/scripts/yui/editor/assets/skins/sam/editor.css" type="text/css" /-->
  110. <link rel="search" type="application/opensearchdescription+xml" href="${rootURL}/opensearch.xml" title="Hudson" />
  111. <meta name="ROBOTS" content="INDEX,NOFOLLOW" />
  112. <j:set var="mode" value="header" />
  113. <d:invokeBody />
  114. <j:forEach var="pd" items="${h.pageDecorators}">
  115. <st:include it="${pd}" page="header.jelly" optional="true" />
  116. </j:forEach>
  117. </head>
  118. <body class="yui-skin-sam">
  119. <!-- for accessibility, skip the entire navigation bar and etc and go straight to the head of the content -->
  120. <a href="#skip2content" class="skiplink">Skip to content</a>
  121. <table id="header" cellpadding="0" cellspacing="0" width="100%" border="0">
  122. <tr>
  123. <td id="top-panel" colspan="2">
  124. <table cellpadding="0" cellspacing="0" width="100%" border="0">
  125. <tr><td style="font-weight:bold; font-size: 2em;">
  126. <a href="${rootURL}/"><img src="${imagesURL}/title.png" alt="title" /></a>
  127. </td><td style="vertical-align: middle; text-align: right; padding-right: 1em;">
  128. <!-- search box -->
  129. <j:set var="searchURL" value="${h.searchURL}"/>
  130. <form action="${searchURL}" method="get" style="position:relative;" class="no-json" name="search">
  131. <!-- this div determines the minimum width -->
  132. <div id="search-box-minWidth"/>
  133. <!-- this div is used to calculate the width of the text box -->
  134. <div id="search-box-sizer"/>
  135. <div id="searchform">
  136. <input name="q" value="search" id="search-box" class="has-default-text defaulted" />
  137. <st:nbsp />
  138. <l:searchPopup/>
  139. <a href="${%searchBox.url}"><img src="${imagesURL}/16x16/help.png" alt="help for search" /></a>
  140. <div id="search-box-completion" />
  141. <script>createSearchBox("${searchURL}");</script>
  142. </div>
  143. </form>
  144. </td><td id="login-field"><span>
  145. <!-- login field -->
  146. <j:if test="${app.useSecurity}">
  147. <st:nbsp/>
  148. <j:choose>
  149. <j:when test="${!h.isAnonymous()}">
  150. <span style="white-space:nowrap">
  151. <a href="${rootURL}/user/${app.authentication.name}"><b>${app.authentication.name}</b></a>
  152. <j:if test="${app.securityRealm.canLogOut()}">
  153. |
  154. <a href="${rootURL}/logout"><b>${%logout}</b></a>
  155. </j:if>
  156. </span>
  157. </j:when>
  158. <j:otherwise>
  159. <st:include it="${app.securityRealm}" page="loginLink.jelly" />
  160. </j:otherwise>
  161. </j:choose>
  162. </j:if>
  163. </span></td></tr>
  164. </table>
  165. </td>
  166. </tr>
  167. <tr id="top-nav">
  168. <td id="left-top-nav">
  169. <j:forEach var="anc" items="${request.ancestors}">
  170. <j:if test="${h.isModel(anc.object)}">
  171. <j:if test="${anc.prev.url!=anc.url}">
  172. <j:if test="${anc.prev!=null}">
  173. <j:whitespace> &#187; </j:whitespace>
  174. </j:if>
  175. <a href="${anc.url}/">
  176. ${anc.object.displayName}
  177. </a>
  178. </j:if>
  179. </j:if>
  180. </j:forEach>
  181. </td>
  182. <td id="right-top-nav">
  183. <j:if test="${attrs.norefresh==null}">
  184. <span class="smallfont">
  185. <j:choose>
  186. <j:when test="${h.isAutoRefresh(request)}">
  187. <a href="?auto_refresh=false">${%DISABLE AUTO REFRESH}</a>
  188. </j:when>
  189. <j:otherwise>
  190. <a href="?auto_refresh=true">${%ENABLE AUTO REFRESH}</a>
  191. </j:otherwise>
  192. </j:choose>
  193. </span>
  194. </j:if>
  195. </td>
  196. </tr>
  197. </table>
  198. <table id="main-table" width="100%" height="70%" border="0"
  199. style="background-image: url(${imagesURL}/hudson.png);
  200. background-repeat: no-repeat; background-position: bottom left;">
  201. <tr>
  202. <td id="side-panel" width="20%">
  203. <div style="margin-left: 20px; margin-right: 20px; border-top: 1px solid #bbb"></div>
  204. <div id="navigation">
  205. <j:set var="mode" value="side-panel" />
  206. <d:invokeBody />
  207. <!-- add YUI logger if debugging YUI -->
  208. <j:if test="${h.yuiSuffix=='debug'}">
  209. <div id="yui-logreader" style="margin-top:1em"/>
  210. <script>
  211. Behaviour.addLoadEvent(function(){
  212. var logReader = new YAHOO.widget.LogReader("yui-logreader");
  213. logReader.collapse();
  214. });
  215. </script>
  216. </j:if>
  217. </div>
  218. </td>
  219. <td id="main-panel-container" width="80%" height="100%">
  220. <table width="100%" height="100%" border="0">
  221. <tr>
  222. <td id="global-messages" width="100%">
  223. <j:forEach var="globalMessage" items="${app.globalMessages}">
  224. <j:if test="${globalMessage.enabled}">
  225. <div class="global-message">
  226. <st:include page="detail.jelly" it="${globalMessage}"/>
  227. </div>
  228. </j:if>
  229. </j:forEach>
  230. </td>
  231. </tr>
  232. <tr>
  233. <td id="main-panel" width="100%" height="100%">
  234. <j:set var="mode" value="main-panel" />
  235. <d:invokeBody/>
  236. </td>
  237. </tr>
  238. </table>
  239. </td>
  240. </tr>
  241. </table>
  242. <table width="100%">
  243. <tr><td id="footer">
  244. <span style="padding-right:2em; color:gray">
  245. ${%Page generated}:
  246. <i:formatDate value="${h.getCurrentTime()}" type="both" dateStyle="medium" timeStyle="medium"/>
  247. </span>
  248. <a href="http://hudson-ci.org/">Hudson ver. ${h.version}</a>
  249. </td></tr>
  250. </table>
  251. <j:forEach var="pd" items="${h.pageDecorators}">
  252. <st:include it="${pd}" page="footer.jelly" optional="true" />
  253. </j:forEach>
  254. </body>
  255. </html>
  256. </j:jelly>