From 9f9e989704b5274afba6a1de0b7bdcc6e7296314 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Mon, 27 Mar 2017 21:05:10 -0400 Subject: Bug 1350909 - Make index.cgi cache-friendly for logged out requests --- template/en/default/global/header.html.tmpl | 121 ++++++++++----------- .../en/default/global/per-bug-queries.html.tmpl | 40 ------- template/en/default/index.html.tmpl | 16 +-- 3 files changed, 57 insertions(+), 120 deletions(-) (limited to 'template') diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index 2e08a461d..07a980050 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -38,6 +38,7 @@ # generate_api_token: generate a token which can be used to make authenticated webservice calls # no_body: if true the body element will not be generated # allow_mobile: allow special CSS and viewport for detected mobile useragents + # use_login_page: display a link to the full login page, rather than an inline login. #%] [% IF message %] @@ -116,11 +117,37 @@ # 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 %] - +[%- js_BUGZILLA = { + param => { + cookiepath => Param('cookiepath'), + maxusermatches => Param('maxusermatches'), + }, + constant => { + COMMENT_COLS => constants.COMMENT_COLS, + }, + string => { + # Please keep these in alphabetical order. + + attach_desc_required => + '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" + } + }; + IF generate_api_token; + js_BUGZILLA.api_token = get_api_token(); + END; +%] - + [% Hook.process("start") %] [% title %] @@ -181,65 +208,18 @@ [% PROCESS format_js_link %] [% END %] - + [% END %] + [% IF inline_javascript.search("\\S") %] + + [% END %] [% FOREACH asset_url = concatenate_js(javascript_urls) %] [% PROCESS format_js_link %] @@ -347,14 +331,21 @@
  • New Account
  • [% END %] - [%# Only display one login form when we're on a LOGIN_REQUIRED page. That - # way, we're guaranteed that the user will use the form that has - # hidden_fields in it (the center form) instead of this one. Also, it's - # less confusing to have one form (as opposed to three) when you're - # required to log in. - #%] - [% IF user.authorizer.can_login && !Bugzilla.page_requires_login %] - [% PROCESS "account/auth/login-small.html.tmpl" qs_suffix = "_top" %] + [% IF use_login_page %] +
  • + | + Log In +
  • + [% ELSE %] + [%# Only display one login form when we're on a LOGIN_REQUIRED page. That + # way, we're guaranteed that the user will use the form that has + # hidden_fields in it (the center form) instead of this one. Also, it's + # less confusing to have one form (as opposed to three) when you're + # required to log in. + #%] + [% IF user.authorizer.can_login && !Bugzilla.page_requires_login %] + [% PROCESS "account/auth/login-small.html.tmpl" qs_suffix = "_top" %] + [% END %] [% END %] [% END %] diff --git a/template/en/default/global/per-bug-queries.html.tmpl b/template/en/default/global/per-bug-queries.html.tmpl index 71723c178..b5c2431e1 100644 --- a/template/en/default/global/per-bug-queries.html.tmpl +++ b/template/en/default/global/per-bug-queries.html.tmpl @@ -15,46 +15,6 @@ [% IF user.id && user.settings.per_bug_queries.value == "on" %]