layout.jelly 11.9 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
<st:setHeader name="Expires" value="0" />
K
Kohsuke Kawaguchi 已提交
57
<st:setHeader name="Cache-Control" value="no-cache,no-store,must-revalidate" />
K
Kohsuke Kawaguchi 已提交
58
<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
<!--
  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.)
-->
T
tfennelly 已提交
69
<j:set var="isMSIE" value="${userAgent.contains('MSIE')}"/>
70
<j:set var="_" value="${request.getSession()}"/>
71
<j:set var="_" value="${h.configureAutoRefresh(request, response, attrs.norefresh!=null and !attrs.norefresh.equals(false))}"/>
72
  <j:set var="extensionsAvailable" value="${h.extensionsAvailable}"/>
73
  <j:if test="${request.servletPath=='/' || request.servletPath==''}">
K
Kohsuke Kawaguchi 已提交
74
    ${h.advertiseHeaders(response)}
75 76 77 78 79
    <j:if test="${extensionsAvailable}">
      <j:forEach var="pd" items="${h.pageDecorators}">
        <st:include it="${pd}" page="httpHeaders.jelly" optional="true"/>
      </j:forEach>
    </j:if>
80
  </j:if>
81 82
<x:doctype name="html" />
<html>
83
  <head resURL="${resURL}">
84
    ${h.checkPermission(it,permission)}
85

T
tfennelly 已提交
86 87 88 89
    <j:if test="${isMSIE}">
      <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    </j:if>

90
    <title>${h.appendIfNotNull(title, ' [Jenkins]', 'Jenkins')}</title>
91 92
    <link rel="stylesheet" href="${resURL}/css/style.css" type="text/css" />
    <link rel="stylesheet" href="${resURL}/css/color.css" type="text/css" />
T
tfennelly 已提交
93
    <link rel="stylesheet" href="${resURL}/css/responsive-grid.css" type="text/css" />
K
kohsuke 已提交
94
    <j:if test="${attrs.css!=null}">
J
Jesse Glick 已提交
95
      <link rel="stylesheet" href="${resURL}${attrs.css}" type="text/css" />
96
    </j:if>
97
    <link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
98 99

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

102 103 104 105 106 107
    <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"/>
108

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

129
    <script src="${resURL}/scripts/hudson-behavior.js" type="text/javascript"></script>
130
    <script src="${resURL}/scripts/sortable.js" type="text/javascript"/>
131

132 133 134 135 136
    <j:if test="${extensionsAvailable}">
      <script>
          crumb.init("${h.getCrumbRequestField()}", "${h.getCrumb(request)}");
      </script>
    </j:if>
137

K
typo.  
kohsuke 已提交
138
    <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/container.css" type="text/css"/>
K
kohsuke 已提交
139
    <link rel="stylesheet" href="${resURL}/scripts/yui/assets/skins/sam/skin.css" type="text/css" />
140
    <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/skins/sam/container.css" type="text/css"/>
K
kohsuke 已提交
141
    <link rel="stylesheet" href="${resURL}/scripts/yui/button/assets/skins/sam/button.css" type="text/css" />
K
kohsuke 已提交
142
    <link rel="stylesheet" href="${resURL}/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" />
143
    <!--link rel="stylesheet" href="${resURL}/scripts/yui/editor/assets/skins/sam/editor.css" type="text/css" /-->
K
kohsuke 已提交
144

145 146 147
    <l:hasPermission permission="${app.READ}">
      <link rel="search" type="application/opensearchdescription+xml" href="${rootURL}/opensearch.xml" title="Jenkins" />
    </l:hasPermission>
K
kohsuke 已提交
148 149 150
    <meta name="ROBOTS" content="INDEX,NOFOLLOW" />
    <j:set var="mode" value="header" />
    <d:invokeBody />
151 152 153 154 155
    <j:if test="${extensionsAvailable}">
      <j:forEach var="pd" items="${h.pageDecorators}">
        <st:include it="${pd}" page="header.jelly" optional="true" />
      </j:forEach>
    </j:if>
156 157 158 159 160

    <j:if test="${isMSIE}">
      <script src="${resURL}/scripts/msie.js" type="text/javascript"/>
    </j:if>

K
kohsuke 已提交
161
  </head>
162
  <body id="jenkins" class="yui-skin-sam jenkins-${h.version}" data-version="jenkins-${h.version}" data-model-type="${it.class.name}">
163 164 165
    <!-- 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>

166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
    <div id="page-head">
      <div id="header">
        <div class="logo">
          <a id="jenkins-home-link" href="${rootURL}/">
            <img id="jenkins-head-icon" src="${imagesURL}/headshot.png" alt="title" />
            <img id="jenkins-name-icon" src="${imagesURL}/title.png" alt="title" width="139" height="34" />
          </a>
        </div>
        <div class="login">
          <!-- login field -->
          <j:if test="${app.useSecurity}">
            <st:nbsp/>
            <j:choose>
              <j:when test="${!h.isAnonymous()}">
                <j:invokeStatic var="user" className="hudson.model.User" method="current" />
                <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>
                <span style="white-space:nowrap">
                  <a href="${rootURL}/user/${user.id}" class="model-link inside inverse"><b>${userName}</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>
        </div>
        <div class="searchbox hidden-xs">
          <!-- 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" placeholder="${%search}" id="search-box" class="has-default-text" value="${request.getParameter('q')}" />
              <st:nbsp />
              <a href="${%searchBox.url}"><l:icon class="icon-help icon-sm" /></a>
              <div id="search-box-completion" />
              <script>createSearchBox("${searchURL}");</script>
            </div>
          </form>
        </div>
T
tfennelly 已提交
220
      </div>
221 222 223 224 225
      <div id="breadcrumbBar">
        <l:breadcrumbBar>
          <j:set var="mode" value="breadcrumbs" />
          <d:invokeBody/>
        </l:breadcrumbBar>
T
tfennelly 已提交
226 227 228
      </div>
    </div>

229
    <div id="page-body">
T
tfennelly 已提交
230
      <div class="row">
231
        <div id="side-panel">
T
tfennelly 已提交
232
          <div id="side-panel-content">
K
kohsuke 已提交
233 234
            <j:set var="mode" value="side-panel" />
            <d:invokeBody />
K
kohsuke 已提交
235 236 237 238 239 240 241 242 243 244 245

            <!-- 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 已提交
246
          </div>
T
tfennelly 已提交
247 248
        </div>

249
        <div id="main-panel">
T
tfennelly 已提交
250 251 252 253 254 255 256 257 258 259
          <div id="main-panel-content">
            <j:set var="mode" value="main-panel" />
            <d:invokeBody/>
          </div>
        </div>
      </div>
    </div>
    <div id="footer-container" class="hidden-xs">
      <div id="footer">
        <span class="page_generated">
K
kohsuke 已提交
260 261 262
          ${%Page generated}:
          <i:formatDate value="${h.getCurrentTime()}" type="both" dateStyle="medium" timeStyle="medium"/>
        </span>
T
tfennelly 已提交
263 264 265 266 267 268
        <span class="rest_api">
          <a href="api/">REST API</a>
        </span>
        <span class="jenkins_ver">
          <a href="${h.getFooterURL()}">Jenkins ver. ${h.version}</a>
        </span>
269
        <j:if test="${extensionsAvailable}">
T
tfennelly 已提交
270 271 272
        <j:forEach var="pd" items="${h.pageDecorators}">
          <st:include it="${pd}" page="footer.jelly" optional="true" />
        </j:forEach>
273
        </j:if>
T
tfennelly 已提交
274 275
      </div>
    </div>
K
kohsuke 已提交
276 277
  </body>
</html>
278
</j:jelly>