summaryrefslogtreecommitdiffstats
path: root/template/en/default/global/header.html.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/global/header.html.tmpl')
-rw-r--r--template/en/default/global/header.html.tmpl240
1 files changed, 130 insertions, 110 deletions
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index 017701f..4030435 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -46,8 +46,41 @@
header_addl_info = ""
onload = ""
style_urls = []
+ yui = []
%]
+[% SET yui_css = {
+ autocomplete => 1,
+ calendar => 1,
+ datatable => 1,
+ button => 1,
+} %]
+
+[%# Note: This is simple dependency resolution--you can't have dependencies
+ # that depend on each other. You have to specify all of a module's deps,
+ # if that module is going to be specified in "yui".
+ #%]
+[% SET yui_deps = {
+ autocomplete => ['json', 'connection', 'datasource'],
+ datatable => ['json', 'connection', 'datasource', 'element'],
+} %]
+
+[%# When using certain YUI modules, we need to process certain
+ # extra JS templates.
+ #%]
+[% SET yui_templates = {
+ datatable => ['global/value-descs.js.tmpl'],
+} %]
+
+[%# These are JS URLs that are *always* on the page and come before
+ # every other JS URL.
+ #%]
+[% SET starting_js_urls = [
+ "js/yui/yahoo-dom-event/yahoo-dom-event.js",
+ "js/yui/cookie/cookie-min.js",
+] %]
+
+
[%# 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
@@ -70,96 +103,33 @@
[% PROCESS 'global/setting-descs.none.tmpl' %]
- [%# 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') %]
+ [% SET yui = yui_resolve_deps(yui, yui_deps) %]
+ [% SET css_sets = css_files(style_urls, yui, yui_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">
+ [%# This allows people to switch back to the "Classic" skin if they
+ # are in another skin.
+ #%]
+ <link href="[% 'skins/standard/global.css' FILTER mtime FILTER html %]"
+ rel="alternate stylesheet"
+ title="[% setting_descs.standard FILTER html %]">
+ [% FOREACH style_url = css_sets.standard %]
+ [% PROCESS format_css_link css_set_name = 'standard' %]
[% END %]
- <!--[if lte IE 7]>
- [%# Internet Explorer treats [if IE] HTML comments as uncommented.
- # Use it to import CSS fixes so that Bugzilla looks decent on IE 7
- # and below.
- #%]
- <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.
+ [%# CSS cascade, part 2 & 3: Third-party stylesheet set (selected and
+ # selectable). All third-party skins are present as alternate
+ # stylesheets, even if they are not currently in use.
#%]
- [% 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 lte IE 7]>
- [%# Internet Explorer treats [if IE] HTML comments as uncommented.
- # Use it to import CSS fixes so that Bugzilla looks decent on IE 7
- # and below.
- #%]
- <link href="skins/standard/IE-fixes.css"
- rel="[% 'alternate ' IF user_skin %]stylesheet"
- title="[% setting_descs.standard FILTER html %]"
- type="text/css">
- <![endif]-->
+ [% FOREACH style_url = css_sets.skin %]
+ [% PROCESS format_css_link css_set_name = user.settings.skin.value %]
[% 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 lte IE 7]>
- [%# Internet Explorer treats [if IE] HTML comments as uncommented.
- # Use it to import CSS fixes so that Bugzilla looks decent on IE 7
- # and below.
- #%]
- <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]-->
+ [% FOREACH alternate_skin = css_sets.alternate.keys %]
+ [% FOREACH style_url = css_sets.alternate.$alternate_skin %]
+ [% PROCESS format_css_link css_set_name = alternate_skin %]
[% END %]
[% END %]
@@ -175,29 +145,29 @@
# 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 %]
+ [% FOREACH style_url = css_sets.custom %]
+ [% PROCESS format_css_link css_set_name = 'standard' %]
[% END %]
- <!--[if lte IE 7]>
- [%# Internet Explorer treats [if IE] HTML comments as uncommented.
- # Use it to import CSS fixes so that Bugzilla looks decent on IE 7
- # and below.
- #%]
- <link href="skins/custom/IE-fixes.css"
- rel="stylesheet"
- type="text/css">
- <![endif]-->
-
- <script src="js/yui/yahoo-dom-event.js" type="text/javascript"></script>
- <script src="js/yui/cookie.js" type="text/javascript"></script>
- <script src="js/global.js" type="text/javascript"></script>
+
+ [%# YUI Scripts %]
+ [% FOREACH yui_name = yui %]
+ [% starting_js_urls.push("js/yui/$yui_name/${yui_name}-min.js") %]
+ [% END %]
+ [% starting_js_urls.push('js/global.js') %]
+
+ [% FOREACH javascript_url = starting_js_urls %]
+ [% PROCESS format_js_link %]
+ [% END %]
+
<script type="text/javascript">
<!--
YAHOO.namespace('bugzilla');
- if (YAHOO.env.ua.gecko) {
+ YAHOO.util.Event.addListener = function (el, sType, fn, obj, overrideContext) {
+ if ( ("onpagehide" in window || YAHOO.env.ua.gecko) && sType === "unload") { sType = "pagehide"; };
+ var capture = ((sType == "focusin" || sType == "focusout") && !YAHOO.env.ua.ie) ? true : false;
+ return this._addListener(el, this._getType(sType), fn, obj, overrideContext, capture);
+ };
+ if ( "onpagehide" in window || YAHOO.env.ua.gecko) {
YAHOO.util.Event._simpleRemove(window, "unload",
YAHOO.util.Event._unload);
}
@@ -219,24 +189,39 @@
#%]
var BUGZILLA = {
param: {
- cookiepath: '[% Param('cookiepath') FILTER js %]'
+ cookiepath: '[% Param('cookiepath') FILTER js %]',
+ maxusermatches: [% Param('maxusermatches') FILTER js %]
},
string: {
+ [%# Please keep these in alphabetical order. %]
+
attach_desc_required:
- 'You must enter a Description for this attachment.'
+ 'You must enter a Description for this attachment.',
+ component_required:
+ 'You must select a Component for this [% terms.bug %].',
+ description_required:
+ 'You must enter a Description for this [% terms.bug %].',
+ short_desc_required:
+ 'You must enter a Summary for this [% terms.bug %].',
+ version_required:
+ 'You must select a Version for this [% terms.bug %].'
}
};
+
+ [% FOREACH yui_name = yui %]
+ [% FOREACH yui_template = yui_templates.$yui_name %]
+ [% PROCESS $yui_template %]
+ [% END %]
+ [% END %]
[% IF javascript %]
[% javascript %]
[% END %]
// -->
</script>
- [% IF javascript_urls %]
- [% FOREACH javascript_url = javascript_urls %]
- <script src="[% javascript_url FILTER html %]" type="text/javascript"></script>
- [% END %]
+ [% FOREACH javascript_url = javascript_urls %]
+ [% PROCESS format_js_link %]
[% END %]
[%# this puts the live bookmark up on firefox for the Atom feed %]
@@ -251,7 +236,6 @@
title="[% terms.Bugzilla %]" href="./search_plugin.cgi">
<link rel="icon" type="image/png" href="https://www.mageia.org/g/favicon.png">
[% Hook.process("additional_header") %]
- <meta name="google-site-verification" content="upEZjJeSjjjVNCMOM2xZNi5PmRgMOY9SCtW3xmGY6nQ">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(["_setAccount", "UA-18603191-3"]);
@@ -274,13 +258,11 @@
class="[% urlbase.replace('^https?://','').replace('/$','').replace('[-~@:/.]+','-') %]
[% FOREACH class = bodyclasses %]
[% ' ' %][% class FILTER css_class_quote %]
- [% END %]">
+ [% END %] yui-skin-sam">
[%# Migration note: the following file corresponds to the old Param
# 'bannerhtml'
#%]
-
- [% PROCESS "global/mageia-global-navigation.html.tmpl" %]
<div id="header">
@@ -337,3 +319,41 @@
[% IF message %]
<div id="message">[% message %]</div>
[% END %]
+
+[% BLOCK format_css_link %]
+ [% IF style_url.match('/IE-fixes\.css') %]
+ <!--[if lte IE 7]>
+ [%# Internet Explorer treats [if IE] HTML comments as uncommented.
+ # We use it to import CSS fixes so that Bugzilla looks decent on IE 7
+ # and below.
+ #%]
+ [% END %]
+
+ [% IF css_set_name == 'standard'
+ OR css_set_name == user.settings.skin.value
+ %]
+ [% SET css_rel = 'stylesheet' %]
+ [% SET css_set_display_name = setting_descs.${user.settings.skin.value}
+ || user.settings.skin.value %]
+ [% ELSE %]
+ [% SET css_rel = 'alternate stylesheet' %]
+ [% SET css_set_display_name = setting_descs.$css_set_name || css_set_name %]
+ [% END %]
+
+ [% IF css_set_name == 'standard' %]
+ [% SET css_title_link = '' %]
+ [% ELSE %]
+ [% css_title_link = BLOCK ~%]
+ title="[% css_set_display_name FILTER html %]"
+ [% END %]
+ [% END %]
+
+ <link href="[% style_url FILTER html %]" rel="[% css_rel FILTER none %]"
+ type="text/css" [% css_title_link FILTER none %]>
+
+ [% '<![endif]-->' IF style_url.match('/IE-fixes\.css') %]
+[% END %]
+
+[% BLOCK format_js_link %]
+ <script type="text/javascript" src="[% javascript_url FILTER mtime FILTER html %]"></script>
+[% END %]