diff options
author | Dave Lawrence <dkl@mozilla.com> | 2011-11-07 21:16:03 +0100 |
---|---|---|
committer | Dave Lawrence <dkl@mozilla.com> | 2011-11-07 21:16:03 +0100 |
commit | d1577fa0afc1dff7729c201879127d1c3609c0c7 (patch) | |
tree | e87094e2671a4c2e79b854203f3506f67dccbc93 | |
parent | a69987ae8fbc227ec1bf4633ad308be81c9f9ff3 (diff) | |
download | bugzilla-d1577fa0afc1dff7729c201879127d1c3609c0c7.tar.gz bugzilla-d1577fa0afc1dff7729c201879127d1c3609c0c7.tar.xz |
Bug 691672 - Apply the background color for security bugs to attachment details pages for those bugs as well
r=glob
-rw-r--r-- | extensions/BMO/Extension.pm | 5 | ||||
-rw-r--r-- | extensions/BMO/template/en/default/hook/global/header-start.html.tmpl | 31 | ||||
-rw-r--r-- | extensions/Splinter/template/en/default/pages/splinter.html.tmpl | 9 | ||||
-rw-r--r-- | skins/custom/show_bug.css | 25 | ||||
-rw-r--r-- | template/en/default/bug/show-header.html.tmpl | 3 |
5 files changed, 46 insertions, 27 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 909e1354b..bd00045e5 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -135,6 +135,11 @@ sub template_before_process { # to see if various field values should be available to the current user. $vars->{'default'} = Bugzilla::Extension::BMO::FakeBug->new($vars->{'default'} || {}); } + + if ($file =~ /^attachment\/diff-header\./) { + my $attachid = $vars->{attachid} ? $vars->{attachid} : $vars->{newid}; + $vars->{attachment} = Bugzilla::Attachment->new($attachid) if $attachid; + } } sub page_before_template { diff --git a/extensions/BMO/template/en/default/hook/global/header-start.html.tmpl b/extensions/BMO/template/en/default/hook/global/header-start.html.tmpl index 9c96ebffa..af6c63123 100644 --- a/extensions/BMO/template/en/default/hook/global/header-start.html.tmpl +++ b/extensions/BMO/template/en/default/hook/global/header-start.html.tmpl @@ -6,6 +6,37 @@ [% javascript_urls.push('extensions/BMO/web/js/sorttable.js') %] [% END %] +[% IF !bodyclasses %] + [% bodyclasses = [] %] +[% END %] + +[%# Change the background/border for bugs/attachments in certain bug groups %] +[% IF template.name == 'attachment/edit.html.tmpl' + || template.name == 'attachment/create.html.tmpl' + || template.name == 'attachment/diff-header.html.tmpl' %] + [% style_urls.push("skins/standard/bug_groups.css") %] + + [% IF template.name == 'attachment/edit.html.tmpl' + || template.name == 'attachment/diff-header.html.tmpl' %] + [% IF bodyclasses == 'no_javascript' %] + [% bodyclasses = ['no_javascript'] %] + [% END %] + [% FOREACH group = attachment.bug.groups_in %] + [% bodyclasses.push("bz_group_$group.name") %] + [% END %] + [% END %] + + [% IF template.name == 'attachment/create.html.tmpl' %] + [% FOREACH group = bug.groups_in %] + [% bodyclasses.push("bz_group_$group.name") %] + [% END %] + [% END %] +[% END %] + +[% IF template.name == 'bug/show-header.html.tmpl' %] +[% style_urls.push("skins/standard/bug_groups.css") %] +[% END %] + [% IF user.in_group('editusers') || user.bless_groups.size > 0 %] [% yui.push('container', 'menu') %] [% style_urls.push('js/yui/assets/skins/sam/menu.css') %] diff --git a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl index 0d2648e58..352c97d2f 100644 --- a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl +++ b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl @@ -18,13 +18,19 @@ # Contributor(s): Owen Taylor <otaylor@redhat.com> #%] +[% bodyclasses = [] %] +[% FOREACH group = bug.groups_in %] + [% bodyclasses.push("bz_group_$group.name") %] +[% END %] + [% PROCESS global/header.html.tmpl title = "Patch Review" header = "Patch Review" style_urls = [ "js/yui/assets/skins/sam/container.css", "js/yui/assets/skins/sam/button.css", "js/yui/assets/skins/sam/datatable.css", - "extensions/Splinter/web/splinter.css" ] + "extensions/Splinter/web/splinter.css", + "skins/standard/bug_groups.css" ] javascript_urls = [ "js/yui/element/element-min.js", "js/yui/container/container-min.js", "js/yui/button/button-min.js", @@ -32,6 +38,7 @@ "js/yui/datasource/datasource-min.js", "js/yui/datatable/datatable-min.js", "extensions/Splinter/web/splinter.js" ] + bodyclasses = bodyclasses %] [% can_edit = 0 %] diff --git a/skins/custom/show_bug.css b/skins/custom/show_bug.css index 6be078168..23839fe17 100644 --- a/skins/custom/show_bug.css +++ b/skins/custom/show_bug.css @@ -10,31 +10,6 @@ margin-left: 1em; } -/* colorize bugs in various groups */ -body[class*=bz_group_] { - background-color: #e0e0ff; - border-left: solid red 2px; - padding-left: 13px; -} - -body[class*=bz_group_] #bugzilla-body { - background-color: inherit; -} - -body.bz_group_webtools-security, -body.bz_group_websites-security, -body.bz_group_bugzilla-security { - background-color: #ffeeee; -} - -body.bz_group_client-services-security { - background-color: #ffff80; -} - -body.bz_group_core-security { - background-color: #ffe0b0; -} - #legal_disclaimer { width: 40em; padding: 1em; diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl index 54570911d..b84b9972c 100644 --- a/template/en/default/bug/show-header.html.tmpl +++ b/template/en/default/bug/show-header.html.tmpl @@ -48,7 +48,8 @@ [% javascript FILTER none %] [% END %] [% END %] -[% style_urls = [ "skins/standard/show_bug.css" ] %] +[% style_urls = [ "skins/standard/show_bug.css", + "skins/standard/bug_groups.css" ] %] [% doc_section = "bug_page.html" %] [% bodyclasses = ['bz_bug', "bz_status_$bug.bug_status", |