layout.jelly 12.2 KB
Newer Older
K
kohsuke 已提交
1 2 3
<!--
The MIT License

4
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
5 6
Daniel Dyer, Seiji Sogabe, Tom Huybrechts, Manufacture Francaise des Pneumatiques
Michelin, Romain Seguy
K
kohsuke 已提交
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

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.
-->
26
<?jelly escape-by-default='true'?>
27
<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">
K
kohsuke 已提交
28 29
  <st:documentation>
    Outer-most tag for a normal (non-AJAX) HTML rendering.
K
kohsuke 已提交
30
    This is used with nested &lt;header>, &lt;side-panel>, and &lt;main-panel>
31
    to form Jenkins's basic HTML layout.
K
kohsuke 已提交
32 33 34 35 36 37 38 39 40 41 42

    <st:attribute name="title" use="required">
      Title of the HTML page. Rendered into &lt;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.,
43 44

      {noformat}&lt;l:layout css="/plugin/mysuperplugin/css/myneatstyle.css">{noformat}
K
kohsuke 已提交
45 46

      This was originally added to allow plugins to load their stylesheets, but
47
      *the use of thie attribute is discouraged now.*
K
kohsuke 已提交
48 49 50 51 52 53 54 55
      plugins should now do so by inserting &lt;style> elements and/or &lt;script> elements
      in &lt;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>
56
<st:header name="Expires" value="0" />
57
<st:header name="Cache-Control" value="no-cache,must-revalidate" />
58
<st:header name="X-Hudson-Theme" value="default" />
59
<st:contentType value="text/html;charset=UTF-8" />
60
<!-- The path starts with a "/" character but does not end with a "/" character. -->
K
kohsuke 已提交
61 62
<j:set var="rootURL" value="${request.contextPath}" />
<j:new var="h" className="hudson.Functions" /><!-- instead of JSP functions -->
63 64 65 66 67 68 69
<!--
  depending on what tags are used, we can later end up discovering that we needed a session,
  but it's too late because the headers are already committed. so ensure we always have a session.
  this also allows us to configure HttpSessionContextIntegrationFilter not to create sessions,
  which I suspect can end up creating sessions for wrong resource types (such as static resources.)
-->
<j:set var="_" value="${request.getSession()}"/>
K
kohsuke 已提交
70
<j:set var="_" value="${h.configureAutoRefresh(request, response, attrs.norefresh!=null)}"/>
71 72 73 74
<!--
  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
75
  problem when the user upgrades to new Jenkins. Stapler also sets a long
76 77 78 79
  future expiration dates for such static resources.
-->
<j:set var="resURL"  value="${rootURL}${h.resourcePath}" />
<j:set var="imagesURL"  value="${rootURL}${h.resourcePath}/images" />
80 81 82
  <j:if test="${request.servletPath=='/' || request.servletPath==''}">
    <st:header name="X-Hudson" value="1.395"/>
    <st:header name="X-Jenkins" value="${servletContext.getAttribute('version')}"/>
K
Kohsuke Kawaguchi 已提交
83
    <st:header name="X-Jenkins-Session" value="${app.SESSION_HASH}"/>
84 85 86 87
    <j:if test="${app.tcpSlaveAgentListener!=null}">
      <!-- advertise the CLI TCP port -->
      <st:header name="X-Hudson-CLI-Port" value="${app.tcpSlaveAgentListener.port}"/>
      <st:header name="X-Jenkins-CLI-Port" value="${app.tcpSlaveAgentListener.port}"/>
88
      <st:header name="X-Jenkins-CLI2-Port" value="${app.tcpSlaveAgentListener.port}"/>
89
      <st:header name="X-Jenkins-CLI-Host" value="${app.tcpSlaveAgentListener.CLI_HOST_NAME}"/>
90 91 92 93 94
    </j:if>
    <j:forEach var="pd" items="${h.pageDecorators}">
      <st:include it="${pd}" page="httpHeaders.jelly" optional="true"/>
    </j:forEach>
  </j:if>
95 96
<x:doctype name="html" />
<html>
K
kohsuke 已提交
97
  <head>
98
    ${h.checkPermission(it,permission)}
99

100
    <title>${h.appendIfNotNull(title, ' [Jenkins]', 'Jenkins')}</title>
101 102
    <link rel="stylesheet" href="${resURL}/css/style.css" type="text/css" />
    <link rel="stylesheet" href="${resURL}/css/color.css" type="text/css" />
K
kohsuke 已提交
103
    <j:if test="${attrs.css!=null}">
104 105
      <link rel="stylesheet" href="${rootURL}${attrs.css}" type="text/css" />
    </j:if>
106
    <link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
107 108

    <!-- are we running as an unit test? -->
K
Kohsuke Kawaguchi 已提交
109
    <script>var isRunAsTest=${h.isUnitTest}; var rootURL="${rootURL}"; var resURL="${resURL}";</script>
110

111 112 113 114 115 116
    <script src="${resURL}/scripts/prototype.js" type="text/javascript"/>
    <script src="${resURL}/scripts/behavior.js" type="text/javascript"/>

    <!-- we include our own prototype.js, so don't let stapler pull in another. -->
    <st:adjunct assumes="org.kohsuke.stapler.framework.prototype.prototype"
                includes="org.kohsuke.stapler.bind"/>
117

K
kohsuke 已提交
118
    <!-- To use the debug version of YUI, set the system property 'debug.YUI' to true -->
119
    <j:set var="yuiSuffix" value="${h.yuiSuffix}" />
120 121 122
    <l:yui module="yahoo" />
    <l:yui module="dom" />
    <l:yui module="event" />
123 124 125
    <j:if test="${h.yuiSuffix=='debug'}">
      <l:yui module="logger" />
    </j:if>
126
    <l:yui module="animation" />
127
    <l:yui module="dragdrop" />
128 129
    <l:yui module="container" />
    <l:yui module="connection" />
O
OHTAKE Tomohiro 已提交
130
    <l:yui module="datasource" />
131
    <l:yui module="autocomplete" />
K
kohsuke 已提交
132
    <l:yui module="menu" />
O
OHTAKE Tomohiro 已提交
133
    <l:yui module="element" />
K
kohsuke 已提交
134
    <l:yui module="button" />
O
OHTAKE Tomohiro 已提交
135
    <l:yui module="storage" />
136
    <!--l:yui module="editor" suffix="-beta" /-->
K
kohsuke 已提交
137

138
    <script src="${resURL}/scripts/hudson-behavior.js" type="text/javascript"></script>
139
    <script src="${resURL}/scripts/sortable.js" type="text/javascript"/>
140 141 142 143

    <script>
        crumb.init("${h.getCrumbRequestField()}", "${h.getCrumb(request)}");
    </script>
144
    
K
typo.  
kohsuke 已提交
145
    <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/container.css" type="text/css"/>
K
kohsuke 已提交
146
    <link rel="stylesheet" href="${resURL}/scripts/yui/assets/skins/sam/skin.css" type="text/css" />
147
    <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/skins/sam/container.css" type="text/css"/>
K
kohsuke 已提交
148
    <link rel="stylesheet" href="${resURL}/scripts/yui/button/assets/skins/sam/button.css" type="text/css" />
K
kohsuke 已提交
149
    <link rel="stylesheet" href="${resURL}/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" />
150
    <!--link rel="stylesheet" href="${resURL}/scripts/yui/editor/assets/skins/sam/editor.css" type="text/css" /-->
K
kohsuke 已提交
151

152
    <link rel="search" type="application/opensearchdescription+xml" href="${rootURL}/opensearch.xml" title="Jenkins" />
K
kohsuke 已提交
153 154 155
    <meta name="ROBOTS" content="INDEX,NOFOLLOW" />
    <j:set var="mode" value="header" />
    <d:invokeBody />
156 157 158
    <j:forEach var="pd" items="${h.pageDecorators}">
      <st:include it="${pd}" page="header.jelly" optional="true" />
    </j:forEach>
K
kohsuke 已提交
159
  </head>
K
kohsuke 已提交
160
  <body class="yui-skin-sam">
161 162 163
    <!-- 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>

K
kohsuke 已提交
164 165 166 167 168
    <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;">
169
              <a href="${rootURL}/"><img src="${imagesURL}/title.png" alt="title" /></a>
K
kohsuke 已提交
170
            </td><td style="vertical-align: middle; text-align: right; padding-right: 1em;">
K
kohsuke 已提交
171 172 173

              <!-- search box -->
              <j:set var="searchURL" value="${h.searchURL}"/>
174
              <form action="${searchURL}" method="get" style="position:relative;" class="no-json" name="search">
K
kohsuke 已提交
175 176 177 178 179
                <!-- 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">
180
                  <input name="q" value="${%search}" id="search-box" class="has-default-text defaulted" />
K
kohsuke 已提交
181
                  <st:nbsp />
182
                  <a href="${%searchBox.url}"><img src="${imagesURL}/16x16/help.png" alt="help for search" height="16" width="16" /></a>
K
kohsuke 已提交
183 184 185 186
                  <div id="search-box-completion" />
                  <script>createSearchBox("${searchURL}");</script>
                </div>
              </form>
187
            </td><td id="login-field"><span>
K
kohsuke 已提交
188
              <!-- login field -->
K
kohsuke 已提交
189
              <j:if test="${app.useSecurity}">
K
kohsuke 已提交
190
                <st:nbsp/>
K
kohsuke 已提交
191
                <j:choose>
192
                  <j:when test="${!h.isAnonymous()}">
193
                    <span style="white-space:nowrap">
194
                      <a href="${rootURL}/user/${app.authentication.name}" class="model-link"><b>${app.authentication.name}</b></a>
K
kohsuke 已提交
195 196 197 198
                      <j:if test="${app.securityRealm.canLogOut()}">
                        |
                        <a href="${rootURL}/logout"><b>${%logout}</b></a>
                      </j:if>
K
kohsuke 已提交
199
                    </span>
K
kohsuke 已提交
200 201
                  </j:when>
                  <j:otherwise>
202
                    <st:include it="${app.securityRealm}" page="loginLink.jelly" />
K
kohsuke 已提交
203 204 205
                  </j:otherwise>
                </j:choose>
              </j:if>
206
            </span></td></tr>
K
kohsuke 已提交
207 208 209
          </table>
        </td>
      </tr>
210 211 212 213
      <l:breadcrumbBar>
        <j:set var="mode" value="breadcrumbs" />
        <d:invokeBody />
      </l:breadcrumbBar>
K
kohsuke 已提交
214 215
    </table>
    <table id="main-table" width="100%" height="70%" border="0"
K
Kohsuke Kawaguchi 已提交
216
        style="background-image: url(${imagesURL}/jenkins.png);
K
kohsuke 已提交
217 218 219
               background-repeat: no-repeat; background-position: bottom left;">
      <tr>
        <td id="side-panel" width="20%">
220
          <div id="navigation" style="min-height: 323px; height: auto !important; height: 323px;">
K
kohsuke 已提交
221 222
            <j:set var="mode" value="side-panel" />
            <d:invokeBody />
K
kohsuke 已提交
223 224 225 226 227 228 229 230 231 232 233

            <!-- 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>
K
kohsuke 已提交
234 235 236 237 238 239 240 241 242 243
          </div>
        </td>
        <td id="main-panel" width="80%" height="100%">
          <j:set var="mode" value="main-panel" />
          <d:invokeBody/>
        </td>
      </tr>
    </table>
    <table width="100%">
      <tr><td id="footer">
K
kohsuke 已提交
244 245 246 247
        <span style="padding-right:2em; color:gray">
          ${%Page generated}:
          <i:formatDate value="${h.getCurrentTime()}" type="both" dateStyle="medium" timeStyle="medium"/>
        </span>
248 249 250 251 252
        <j:if test="${it.api!=null}">
          <span style="padding-right:2em">
            <a href="api/">REST API</a>
          </span>
        </j:if>
253
        <a href="${h.getFooterURL()}">Jenkins ver. ${h.version}</a>
K
kohsuke 已提交
254 255
      </td></tr>
    </table>
256 257 258
    <j:forEach var="pd" items="${h.pageDecorators}">
      <st:include it="${pd}" page="footer.jelly" optional="true" />
    </j:forEach>
K
kohsuke 已提交
259 260
  </body>
</html>
261
</j:jelly>