layout.jelly 11.7 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

    <st:attribute name="title" use="required">
      Title of the HTML page. Rendered into &lt;title> tag.
    </st:attribute>
    <st:attribute name="norefresh">
37
      If non-null and not "false", auto refresh is disabled on this page.
K
kohsuke 已提交
38 39 40 41 42
      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.*
D
ddavison 已提交
48
      plugins should now do so by inserting &lt;style> elements and/or &lt;script> elements
K
kohsuke 已提交
49 50 51 52 53 54 55
      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>
K
Kohsuke Kawaguchi 已提交
56 57 58
<st:setHeader name="Expires" value="0" />
<st:setHeader name="Cache-Control" value="no-cache,must-revalidate" />
<st:setHeader name="X-Hudson-Theme" value="default" />
59
<st:contentType value="text/html;charset=UTF-8" />
K
Kohsuke Kawaguchi 已提交
60 61 62

  <j:new var="h" className="hudson.Functions" /><!-- instead of JSP functions -->
${h.initPageVariables(context)}
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()}"/>
70
<j:set var="_" value="${h.configureAutoRefresh(request, response, attrs.norefresh!=null and !attrs.norefresh.equals(false))}"/>
71
  <j:if test="${request.servletPath=='/' || request.servletPath==''}">
K
Kohsuke Kawaguchi 已提交
72
    ${h.advertiseHeaders(response)}
73 74 75 76
    <j:forEach var="pd" items="${h.pageDecorators}">
      <st:include it="${pd}" page="httpHeaders.jelly" optional="true"/>
    </j:forEach>
  </j:if>
77 78
<x:doctype name="html" />
<html>
K
kohsuke 已提交
79
  <head>
80
    ${h.checkPermission(it,permission)}
81

82
    <title>${h.appendIfNotNull(title, ' [Jenkins]', 'Jenkins')}</title>
83 84
    <link rel="stylesheet" href="${resURL}/css/style.css" type="text/css" />
    <link rel="stylesheet" href="${resURL}/css/color.css" type="text/css" />
K
kohsuke 已提交
85
    <j:if test="${attrs.css!=null}">
J
Jesse Glick 已提交
86
      <link rel="stylesheet" href="${resURL}${attrs.css}" type="text/css" />
87
    </j:if>
88
    <link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
89 90

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

93 94 95 96 97 98
    <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"/>
99

K
kohsuke 已提交
100
    <!-- To use the debug version of YUI, set the system property 'debug.YUI' to true -->
101
    <j:set var="yuiSuffix" value="${h.yuiSuffix}" />
102 103 104
    <l:yui module="yahoo" />
    <l:yui module="dom" />
    <l:yui module="event" />
105 106 107
    <j:if test="${h.yuiSuffix=='debug'}">
      <l:yui module="logger" />
    </j:if>
108
    <l:yui module="animation" />
109
    <l:yui module="dragdrop" />
110 111
    <l:yui module="container" />
    <l:yui module="connection" />
O
OHTAKE Tomohiro 已提交
112
    <l:yui module="datasource" />
113
    <l:yui module="autocomplete" />
K
kohsuke 已提交
114
    <l:yui module="menu" />
O
OHTAKE Tomohiro 已提交
115
    <l:yui module="element" />
K
kohsuke 已提交
116
    <l:yui module="button" />
O
OHTAKE Tomohiro 已提交
117
    <l:yui module="storage" />
118
    <!--l:yui module="editor" suffix="-beta" /-->
K
kohsuke 已提交
119

120
    <script src="${resURL}/scripts/hudson-behavior.js" type="text/javascript"></script>
121
    <script src="${resURL}/scripts/sortable.js" type="text/javascript"/>
122 123 124 125

    <script>
        crumb.init("${h.getCrumbRequestField()}", "${h.getCrumb(request)}");
    </script>
126
    
K
typo.  
kohsuke 已提交
127
    <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/container.css" type="text/css"/>
K
kohsuke 已提交
128
    <link rel="stylesheet" href="${resURL}/scripts/yui/assets/skins/sam/skin.css" type="text/css" />
129
    <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/skins/sam/container.css" type="text/css"/>
K
kohsuke 已提交
130
    <link rel="stylesheet" href="${resURL}/scripts/yui/button/assets/skins/sam/button.css" type="text/css" />
K
kohsuke 已提交
131
    <link rel="stylesheet" href="${resURL}/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" />
132
    <!--link rel="stylesheet" href="${resURL}/scripts/yui/editor/assets/skins/sam/editor.css" type="text/css" /-->
K
kohsuke 已提交
133

134
    <link rel="search" type="application/opensearchdescription+xml" href="${rootURL}/opensearch.xml" title="Jenkins" />
K
kohsuke 已提交
135 136 137
    <meta name="ROBOTS" content="INDEX,NOFOLLOW" />
    <j:set var="mode" value="header" />
    <d:invokeBody />
138 139 140
    <j:forEach var="pd" items="${h.pageDecorators}">
      <st:include it="${pd}" page="header.jelly" optional="true" />
    </j:forEach>
K
kohsuke 已提交
141
  </head>
142
  <body id="jenkins jenkins-${h.version}" class="yui-skin-sam">
143 144 145
    <!-- 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 已提交
146 147 148 149 150
    <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;">
151
              <a id="jenkins-home-link" href="${rootURL}/"><img id="jenkins-home-icon" src="${imagesURL}/title.png" alt="title" width="139" height="34" /></a>
K
kohsuke 已提交
152
            </td><td style="vertical-align: middle; text-align: right; padding-right: 1em;">
K
kohsuke 已提交
153 154 155

              <!-- search box -->
              <j:set var="searchURL" value="${h.searchURL}"/>
156
              <form action="${searchURL}" method="get" style="position:relative;" class="no-json" name="search">
K
kohsuke 已提交
157 158 159 160 161
                <!-- 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">
162
                  <input name="q" placeholder="${%search}" id="search-box" class="has-default-text" value="${request.getParameter('q')}" />
K
kohsuke 已提交
163
                  <st:nbsp />
164
                  <a href="${%searchBox.url}"><img src="${imagesURL}/16x16/help.png" alt="help for search" height="16" width="16" /></a>
K
kohsuke 已提交
165 166 167 168
                  <div id="search-box-completion" />
                  <script>createSearchBox("${searchURL}");</script>
                </div>
              </form>
169
            </td><td id="login-field"><span>
K
kohsuke 已提交
170
              <!-- login field -->
K
kohsuke 已提交
171
              <j:if test="${app.useSecurity}">
K
kohsuke 已提交
172
                <st:nbsp/>
K
kohsuke 已提交
173
                <j:choose>
174
                  <j:when test="${!h.isAnonymous()}">
O
Olivier Dagenais 已提交
175
                    <j:invokeStatic var="user" className="hudson.model.User" method="current" />
176 177 178 179 180 181 182 183
                    <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>
184
                    <span style="white-space:nowrap">
185
                      <a href="${rootURL}/user/${user.id}" class="model-link inside"><b>${userName}</b></a>
K
kohsuke 已提交
186 187 188 189
                      <j:if test="${app.securityRealm.canLogOut()}">
                        |
                        <a href="${rootURL}/logout"><b>${%logout}</b></a>
                      </j:if>
K
kohsuke 已提交
190
                    </span>
K
kohsuke 已提交
191 192
                  </j:when>
                  <j:otherwise>
193
                    <st:include it="${app.securityRealm}" page="loginLink.jelly" />
K
kohsuke 已提交
194 195 196
                  </j:otherwise>
                </j:choose>
              </j:if>
197
            </span></td></tr>
K
kohsuke 已提交
198 199 200
          </table>
        </td>
      </tr>
201 202 203 204
      <l:breadcrumbBar>
        <j:set var="mode" value="breadcrumbs" />
        <d:invokeBody />
      </l:breadcrumbBar>
K
kohsuke 已提交
205 206
    </table>
    <table id="main-table" width="100%" height="70%" border="0"
207
        style="background-image: url(${imagesURL}/jenkins.png);
K
kohsuke 已提交
208 209 210
               background-repeat: no-repeat; background-position: bottom left;">
      <tr>
        <td id="side-panel" width="20%">
211
          <div id="navigation" style="min-height: 323px; height: auto !important; height: 323px;">
K
kohsuke 已提交
212 213
            <j:set var="mode" value="side-panel" />
            <d:invokeBody />
K
kohsuke 已提交
214 215 216 217 218 219 220 221 222 223 224

            <!-- 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 已提交
225 226 227 228 229 230 231 232 233 234
          </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 已提交
235 236 237 238
        <span style="padding-right:2em; color:gray">
          ${%Page generated}:
          <i:formatDate value="${h.getCurrentTime()}" type="both" dateStyle="medium" timeStyle="medium"/>
        </span>
239 240 241 242 243
        <j:if test="${it.api!=null}">
          <span style="padding-right:2em">
            <a href="api/">REST API</a>
          </span>
        </j:if>
244
        <a href="${h.getFooterURL()}">Jenkins ver. ${h.version}</a>
K
kohsuke 已提交
245 246
      </td></tr>
    </table>
247 248 249
    <j:forEach var="pd" items="${h.pageDecorators}">
      <st:include it="${pd}" page="footer.jelly" optional="true" />
    </j:forEach>
K
kohsuke 已提交
250 251
  </body>
</html>
252
</j:jelly>