Skip to content

Commit

Permalink
Bug 1309884 - constants.CONCATENATE_ASSETS gets constant folded when …
Browse files Browse the repository at this point in the history
…true
  • Loading branch information
dylanwh committed Oct 18, 2016
1 parent 7d445a4 commit 14ee843
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 7 additions & 5 deletions Bugzilla/Template.pm
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,12 @@ sub css_files {
}
}

# build unified
$by_type{unified_standard_skin} = _concatenate_css($by_type{standard},
$by_type{skin});
$by_type{unified_custom} = _concatenate_css($by_type{custom});
# build concatenated
if (CONCATENATE_ASSETS) {
$by_type{concatenated_standard_skin} = _concatenate_css($by_type{standard},
$by_type{skin});
$by_type{concatenated_custom} = _concatenate_css($by_type{custom});
}

return \%by_type;
}
Expand Down Expand Up @@ -535,7 +537,7 @@ sub _concatenate_css {

sub _css_url_rewrite {
my ($source, $url) = @_;
# rewrite relative urls as the unified stylesheet lives in a different
# rewrite relative urls as the concatenated stylesheet lives in a different
# directory from the source
$url =~ s/(^['"]|['"]$)//g;
if (substr($url, 0, 1) eq '/' || substr($url, 0, 5) eq 'data:') {
Expand Down
12 changes: 5 additions & 7 deletions template/en/default/global/header.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
[% END %]

[% SET css_sets = css_files(style_urls, yui, yui_css) %]
[% IF constants.CONCATENATE_ASSETS %]
[% PROCESS format_css_link asset_url = css_sets.unified_standard_skin %]
[% IF css_sets.concatenated_standard_skin %]
[% PROCESS format_css_link asset_url = css_sets.concatenated_standard_skin %]
[% ELSE %]
[% FOREACH asset_url = css_sets.standard %]
[% PROCESS format_css_link %]
Expand All @@ -130,14 +130,12 @@
</style>
[% END %]

[% IF css_sets.unified_custom %]
[% IF constants.CONCATENATE_ASSETS %]
[% PROCESS format_css_link asset_url = css_sets.unified_custom %]
[% ELSE %]
[% IF css_sets.concatenated_custom %]
[% PROCESS format_css_link asset_url = css_sets.concatenated_custom %]
[% ELSE %]
[% FOREACH asset_url = css_sets.custom %]
[% PROCESS format_css_link %]
[% END %]
[% END %]
[% END %]

[% IF NOT no_yui %]
Expand Down

0 comments on commit 14ee843

Please sign in to comment.