summaryrefslogtreecommitdiffstats
path: root/template/en/default/global/header.html.tmpl
blob: 4dcdb39311aa97f05e2f34f325cbd587bb18fe09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Gervase Markham <gerv@gerv.net>
  #                 Vaskin Kissoyan <vkissoyan@yahoo.com>
  #                 Vitaly Harisov <vitaly@rathedg.com>
  #                 Svetlana Harisova <light@rathedg.com>
  #%]

[%# INTERFACE:
  # (All the below interface elements are optional.)
  # title: string. Page title.
  # header: string. Main page header.
  # subheader: string. Page subheader.
  # header_addl_info: string. Additional header information.
  # bodyclasses: array of extra CSS classes for the <body>
  # onload: string. JavaScript code to run when the page finishes loading.
  # javascript: string. Javascript to go in the header.
  # javascript_urls: list. List of URLs to Javascript.
  # style: string. CSS style.
  # style_urls: list. List of URLs to CSS style sheets.
  # message: string. A message to display to the user. May contain HTML.
  # atomlink: Atom link URL, May contain HTML
  #%]

[% IF message %]
  [% PROCESS global/messages.html.tmpl %]
[% END %]

[% DEFAULT
  subheader = ""
  header_addl_info = ""
  onload = ""
  style_urls = []
%]

[%# We should be able to set the default value of the header variable
  # to the value of the title variable using the DEFAULT directive,
  # but that doesn't work if a caller sets header to the empty string
  # to avoid header inheriting the value of title, since DEFAULT
  # mistakenly treats empty strings as undefined and gives header the
  # value of title anyway.  To get around that problem we explicitly
  # set header's default value here only if it is undefined. %]
[% IF !header.defined %][% header = title %][% END %]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>[% title %]</title>

[%# Migration note: contents of the old Param 'headerhtml' would go here %]

    [% PROCESS "global/site-navigation.html.tmpl" %]

    [% PROCESS 'global/setting-descs.none.tmpl' %]

    [% IF javascript %]
      <script type="text/javascript">
        [% javascript %]
      </script>
    [% END %]
    
    [% IF javascript_urls %]
      [% FOREACH javascript_url = javascript_urls %]
        <script src="[% javascript_url FILTER html %]" type="text/javascript"></script>
      [% END %]
    [% END %]

    [%# Set up the skin CSS cascade:
      #  1. Standard Bugzilla stylesheet set (persistent)
      #  2. Standard Bugzilla stylesheet set (selectable)
      #  3. All third-party "skin" stylesheet sets (selectable)
      #  4. Page-specific styles
      #  5. Custom Bugzilla stylesheet set (persistent)
      # "Selectable" skin file sets may be either preferred or alternate.
      # Exactly one is preferred, determined by the "skin" user preference.
      #%]
    [% IF user.settings.skin.value != 'standard' %]
      [% user_skin = user.settings.skin.value %]
    [% END %]
    [% style_urls.unshift('skins/standard/global.css') %]

    [%# CSS cascade, part 1: Standard Bugzilla stylesheet set (persistent).
      # Always present.
      #%]
    [% FOREACH style_url = style_urls %]
      <link href="[% style_url FILTER html %]"
            rel="stylesheet"
            type="text/css">
    [% END %]
    <!--[if IE]>
      [%# Internet Explorer treats [if IE] HTML comments as uncommented.
        # Use it to import CSS fixes so that Bugzilla looks decent on IE, too.
        #%]
      <link href="skins/standard/IE-fixes.css"
            rel="stylesheet"
            type="text/css">
    <![endif]-->

    [%# CSS cascade, part 2: Standard Bugzilla stylesheet set (selectable)
      # Present if skin selection is enabled.
      #%]
    [% IF user.settings.skin.is_enabled %]
      [% FOREACH style_url = style_urls %]
        <link href="[% style_url FILTER html %]"
              rel="[% 'alternate ' IF user_skin %]stylesheet"
              title="[% setting_descs.standard FILTER html %]"
              type="text/css">
      [% END %]
      <!--[if IE]>
        [%# Internet Explorer treats [if IE] HTML comments as uncommented.
          # Use it to import CSS fixes so that Bugzilla looks decent on IE,
          # too.
          #%]
        <link href="skins/standard/IE-fixes.css"
              rel="[% 'alternate ' IF user_skin %]stylesheet"
              title="[% setting_descs.standard FILTER html %]"
              type="text/css">
      <![endif]-->
    [% END %]

    [%# CSS cascade, part 3: Third-party stylesheet set (selectable).
      # All third-party skins are present if skin selection is enabled.
      # The admin-selected skin is always present.
      #%]
    [% FOREACH contrib_skin = user.settings.skin.legal_values %]
      [% NEXT IF contrib_skin == 'standard' %]
      [% NEXT UNLESS contrib_skin == user_skin
                  OR user.settings.skin.is_enabled %]
      [% contrib_skin = contrib_skin FILTER url_quote %]
      [% IF contrib_skin.match('\.css$') %]
        [%# 1st skin variant: single-file stylesheet %]
        <link href="[% "skins/contrib/$contrib_skin" %]"
              rel="[% 'alternate ' UNLESS contrib_skin == user_skin %]stylesheet"
              title="[% contrib_skin FILTER html %]"
              type="text/css">
      [% ELSE %]
        [%# 2nd skin variant: stylesheet set %]
        [% FOREACH style_url = style_urls %]
          [% IF style_url.match('^skins/standard/') %]
            <link href="[% style_url.replace('^skins/standard/',
                                             "skins/contrib/$contrib_skin/") %]"
                  rel="[% 'alternate ' UNLESS contrib_skin == user_skin %]stylesheet"
                  title="[% contrib_skin FILTER html %]"
                  type="text/css">
          [% END %]
        [% END %]
        <!--[if IE]>
          [%# Internet Explorer treats [if IE] HTML comments as uncommented.
            # Use it to import CSS fixes so that Bugzilla looks decent on IE,
            # too.
            #%]
          <link href="skins/contrib/[% contrib_skin FILTER html %]/IE-fixes.css"
                rel="[% 'alternate ' UNLESS contrib_skin == user_skin %]stylesheet"
                title="[% contrib_skin FILTER html %]"
                type="text/css">
        <![endif]-->
      [% END %]
    [% END %]

    [%# CSS cascade, part 4: page-specific styles.
      #%]
    [% IF style %]
      <style type="text/css">
        [% style %]
      </style>
    [% END %]

    [%# CSS cascade, part 5: Custom Bugzilla stylesheet set (persistent).
      # Always present. Site administrators may override all other style
      # definitions, including skins, using custom stylesheets.
      #%]
    [% FOREACH style_url = style_urls %]
      [% IF style_url.match('^skins/standard/') %]
        <link href="[% style_url.replace('^skins/standard/', "skins/custom/")
                       FILTER html %]" rel="stylesheet" type="text/css">
      [% END %]
    [% END %]
    <!--[if IE]>
      [%# Internet Explorer treats [if IE] HTML comments as uncommented.
        # Use it to import CSS fixes so that Bugzilla looks decent on IE, too.
        #%]
      <link href="skins/custom/IE-fixes.css"
            rel="stylesheet"
            type="text/css">
    <![endif]-->

    [%# this puts the live bookmark up on firefox for the Atom feed %]
    [% IF atomlink %]
       <link rel="alternate" 
             type="application/atom+xml" title="Atom feed" 
             href="[% atomlink FILTER html %]">
    [% END %]

    [%# Required for the 'Autodiscovery' feature in Firefox 2 and IE 7. %]
    <link rel="search" type="application/opensearchdescription+xml"
                       title="[% terms.Bugzilla %]" href="./search_plugin.cgi">
  </head>

[%# Migration note: contents of the old Param 'bodyhtml' go in the body tag,
  # but set the onload attribute in the DEFAULT directive above.
  #%]

  <body onload="[% onload %]"
        class="[% urlbase.replace('^https?://','').replace('/$','').replace('[-~@:/.]+','-') %]
               [% FOREACH class = bodyclasses %]
                 [% ' ' %][% class FILTER css_class_quote %]
               [% END %]">

[%# Migration note: the following file corresponds to the old Param
  # 'bannerhtml'
  #%]


<div id="header">

[% INCLUDE global/banner.html.tmpl %]

<table border="0" cellspacing="0" cellpadding="0" id="titles">
<tr>
    <td id="title">
      <p>[% terms.Bugzilla %]
      [% " &ndash; $header" IF header %]</p>
    </td>

  [% IF subheader %]
    <td id="subtitle">
      <p class="subheader">[% subheader %]</p>
    </td>
  [% END %]

  [% IF header_addl_info %]
    <td id="information">
      <p class="header_addl_info">[% header_addl_info %]</p>
    </td>
  [% END %]
</tr>
</table>

[% PROCESS "global/common-links.html.tmpl" qs_suffix = "_top" %]

</div>

<div id="bugzilla-body">

[% IF Param('announcehtml') %]
[% Param('announcehtml') FILTER none %]
[% END %]

[% IF message %]
<div id="message">[% message %]</div>
[% END %]