PageRenderTime 48ms CodeModel.GetById 43ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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