layout.jelly 6.9 KB
Newer Older
K
kohsuke 已提交
1 2 3 4
<!--
  Outermost page layout. This is used with nested <side-panel> and <main-panel>
  to form Hudson's basic HTML layout.

K
kohsuke 已提交
5 6 7
  Attributes:
   title : controls the HTML page title. Mandatory.
   norefresh : set to "true" to disable auto refresh for this page.
8
   secured : set to "true" to fail unless the caller is admin.
9 10 11 12
   css :
     specify path that starts from "/" for loading additional CSS stylesheet.
     path is interprted as relative to the context root. e.g.,
     <l:layout css="/plugin/mysuperplugin/css/myneatstyle.css">
K
kohsuke 已提交
13
-->
14
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout">
K
kohsuke 已提交
15 16 17
<st:contentType value="text/html;charset=UTF-8" />
<j:set var="rootURL" value="${request.contextPath}" />
<j:new var="h" className="hudson.Functions" /><!-- instead of JSP functions -->
K
kohsuke 已提交
18
<j:set var="_" value="${h.configureAutoRefresh(request, response, attrs.norefresh!=null)}"/>
19 20 21 22 23 24 25 26 27
<!--
  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
  problem when the user upgrades to new Hudson. Stapler also sets a long
  future expiration dates for such static resources.
-->
<j:set var="resURL"  value="${rootURL}${h.resourcePath}" />
<j:set var="imagesURL"  value="${rootURL}${h.resourcePath}/images" />
K
kohsuke 已提交
28 29
<html>
  <head>
30 31 32
    <!-- if this page needs to be secured, make sure the user is admin -->
    ${h.adminCheck(request,response,secured)}

K
kohsuke 已提交
33
    <title>${h.appendIfNotNull(title, ' [Hudson]', 'Hudson')}</title>
34 35
    <link rel="stylesheet" href="${resURL}/css/style.css" type="text/css" />
    <link rel="stylesheet" href="${resURL}/css/color.css" type="text/css" />
K
kohsuke 已提交
36
    <j:if test="${attrs.css!=null}">
37 38
      <link rel="stylesheet" href="${rootURL}${attrs.css}" type="text/css" />
    </j:if>
39 40 41 42 43
    <link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
    <script src="${resURL}/scripts/prototype.js" type="text/javascript"></script>
    <script src="${resURL}/scripts/behavior.js" type="text/javascript"></script>
    <script src="${resURL}/scripts/sortable.js" type="text/javascript"></script>
    <script src="${resURL}/scripts/hudson-behavior.js" type="text/javascript"></script>
44

K
kohsuke 已提交
45
    <!-- To use the debug version of YUI, set the system property 'debug.YUI' to true -->
46
    <j:set var="yuiSuffix" value="${h.yuiSuffix}" />
47 48 49 50 51 52
    <l:yui module="yahoo" />
    <l:yui module="dom" />
    <l:yui module="event" />
    <l:yui module="container" />
    <l:yui module="connection" />
    <l:yui module="autocomplete" />
K
kohsuke 已提交
53 54 55
    <j:if test="${yuiSuffix=='debug'}">
      <l:yui module="logger" />
    </j:if>
56
    
K
typo.  
kohsuke 已提交
57
    <link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/container.css" type="text/css"/>
K
kohsuke 已提交
58
    <link rel="search" type="application/opensearchdescription+xml" href="${rootURL}/opensearch.xml" title="Hudson" />
K
kohsuke 已提交
59 60 61 62
    <meta name="ROBOTS" content="INDEX,NOFOLLOW" />
    <j:set var="mode" value="header" />
    <d:invokeBody />
  </head>
K
kohsuke 已提交
63
  <body class="yui-skin-sam">
K
kohsuke 已提交
64 65 66 67 68
    <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;">
69
              <a href="${rootURL}/"><img src="${imagesURL}/title.png" alt="title" /></a>
K
kohsuke 已提交
70
            </td><td style="vertical-align: middle; text-align: right; padding-right: 1em;">
K
kohsuke 已提交
71 72 73

              <!-- search box -->
              <j:set var="searchURL" value="${h.searchURL}"/>
74
              <form action="${searchURL}" method="get" style="position:relative; top:0.5em;">
K
kohsuke 已提交
75 76 77 78 79 80 81 82 83 84 85 86
                <!-- 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" value="search" id="search-box" class="has-default-text defaulted" />
                  <st:nbsp />
                  <a href="http://hudson.gotdns.com/wiki/display/HUDSON/Search+Box"><img src="${imagesURL}/16x16/help.png" /></a>
                  <div id="search-box-completion" />
                  <script>createSearchBox("${searchURL}");</script>
                </div>
              </form>
87
            </td><td style="vertical-align: middle; padding-right: 1em; width:1px; whtiespace:nowrap;">
K
kohsuke 已提交
88
              <!-- login field -->
K
kohsuke 已提交
89
              <j:if test="${app.useSecurity}">
K
kohsuke 已提交
90
                <st:nbsp/>
K
kohsuke 已提交
91
                <j:choose>
92
                  <j:when test="${request.userPrincipal!=null}">
K
kohsuke 已提交
93 94 95
                    <a style="color:white" href="${rootURL}/logout"><b>logout</b></a>
                  </j:when>
                  <j:otherwise>
96
                    <a style="color:white" href="${rootURL}/loginEntry?from=${request.requestURI}"><b>login</b></a>
K
kohsuke 已提交
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
                  </j:otherwise>
                </j:choose>
              </j:if>
            </td></tr>
          </table>
        </td>
      </tr>

      <tr id="top-nav">
        <td id="left-top-nav">
          <j:forEach var="anc" items="${request.ancestors}">
            <j:if test="${h.isModel(anc.object)}">
              <j:if test="${anc.prev!=null}">
                <j:whitespace> &#187; </j:whitespace>
              </j:if>
              <a href="${anc.url}/">
                ${anc.object.displayName}
              </a>
            </j:if>
          </j:forEach>
        </td>
        <td id="right-top-nav">
K
kohsuke 已提交
119 120 121 122 123 124 125 126 127 128 129 130
          <j:if test="${attrs.norefresh==null}">
            <span class="smallfont">
              <j:choose>
                <j:when test="${h.isAutoRefresh(request)}">
                  <a href="?auto_refresh=false">DISABLE AUTO REFRESH</a>
                </j:when>
                <j:otherwise>
                  <a href="?auto_refresh=true">ENABLE AUTO REFRESH</a>
                </j:otherwise>
              </j:choose>
            </span>
          </j:if>
K
kohsuke 已提交
131 132 133 134
        </td>
      </tr>
    </table>
    <table id="main-table" width="100%" height="70%" border="0"
135
        style="background-image: url(${imagesURL}/hudson.png);
K
kohsuke 已提交
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
               background-repeat: no-repeat; background-position: bottom left;">
      <tr>
        <td id="side-panel" width="20%">
          <div style="margin-left: 20px; margin-right: 20px; border-top: 1px solid #bbb"></div>
          <div id="navigation">
            <j:set var="mode" value="side-panel" />
            <d:invokeBody />
          </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">
        <a href="http://hudson.dev.java.net/">
K
kohsuke 已提交
154
          Hudson ver. ${h.version}
K
kohsuke 已提交
155 156 157 158 159 160
        </a>
      </td></tr>
    </table>
  </body>
</html>
</j:jelly>