From df9f480900b6289b3924fd49e2e64996ff735d0c Mon Sep 17 00:00:00 2001 From: "travis%sedsystems.ca" Date: Tue, 18 Jan 2005 18:29:27 +0000 Subject: [PATCH] Bug 245282 : Flags should use nonbreaking hyphens or nowrap or somehow prevent hyphens from breaking flag names Patch by LpSolit@gmail.com r=wurblzap a=myk git-svn-id: svn://10.0.0.236/trunk@167948 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/Bugzilla/Template.pm | 8 ++++++++ mozilla/webtools/bugzilla/checksetup.pl | 1 + mozilla/webtools/bugzilla/t/004template.t | 1 + .../template/en/default/admin/flag-type/list.html.tmpl | 2 +- .../template/en/default/attachment/list.html.tmpl | 2 +- .../bugzilla/template/en/default/flag/list.html.tmpl | 6 +++--- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mozilla/webtools/bugzilla/Bugzilla/Template.pm b/mozilla/webtools/bugzilla/Bugzilla/Template.pm index cddd33ba47f..cb034478d44 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Template.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Template.pm @@ -249,6 +249,14 @@ sub create { return $var; }, + # Prevents line break on hyphens and whitespaces. + no_break => sub { + my ($var) = @_; + $var =~ s/ /\ /g; + $var =~ s/-/\‑/g; + return $var; + }, + xml => \&Bugzilla::Util::xml_quote , # This filter escapes characters in a variable or value string for diff --git a/mozilla/webtools/bugzilla/checksetup.pl b/mozilla/webtools/bugzilla/checksetup.pl index 9615beb7309..a01d0962a0c 100755 --- a/mozilla/webtools/bugzilla/checksetup.pl +++ b/mozilla/webtools/bugzilla/checksetup.pl @@ -1249,6 +1249,7 @@ END obsolete => sub { return $_; }, js => sub { return $_; }, html_linebreak => sub { return $_; }, + no_break => sub { return $_; }, url_quote => sub { return $_; }, xml => sub { return $_; }, quoteUrls => sub { return $_; }, diff --git a/mozilla/webtools/bugzilla/t/004template.t b/mozilla/webtools/bugzilla/t/004template.t index 86b505c285e..f35b5342568 100644 --- a/mozilla/webtools/bugzilla/t/004template.t +++ b/mozilla/webtools/bugzilla/t/004template.t @@ -93,6 +93,7 @@ foreach my $include_path (@include_paths) { FILTERS => { html_linebreak => sub { return $_; }, + no_break => sub { return $_; } , js => sub { return $_ } , inactive => [ sub { return sub { return $_; } }, 1] , closed => [ sub { return sub { return $_; } }, 1] , diff --git a/mozilla/webtools/bugzilla/template/en/default/admin/flag-type/list.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/admin/flag-type/list.html.tmpl index 44cbf36c29a..9638df89149 100644 --- a/mozilla/webtools/bugzilla/template/en/default/admin/flag-type/list.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/admin/flag-type/list.html.tmpl @@ -93,7 +93,7 @@ [% FOREACH type = types %] - [% type.name FILTER html %] + [% type.name FILTER html FILTER no_break %] [% type.description FILTER html %] Copy diff --git a/mozilla/webtools/bugzilla/template/en/default/attachment/list.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/attachment/list.html.tmpl index d5741d6a2cd..41115ab9cc5 100644 --- a/mozilla/webtools/bugzilla/template/en/default/attachment/list.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/attachment/list.html.tmpl @@ -59,7 +59,7 @@ [% IF flag.setter %] [% flag.setter.nick FILTER html %]: [% END %] - [%+ flag.type.name FILTER html %][% flag.status %] + [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %] [%+ IF flag.status == "?" && flag.requestee %] ([% flag.requestee.nick FILTER html %]) [% END %]
diff --git a/mozilla/webtools/bugzilla/template/en/default/flag/list.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/flag/list.html.tmpl index 08f8c5547ff..f660b15cada 100644 --- a/mozilla/webtools/bugzilla/template/en/default/flag/list.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/flag/list.html.tmpl @@ -98,7 +98,7 @@ [% flag.setter.nick FILTER html %]: - [% type.name FILTER html %] + [% type.name FILTER html FILTER no_break %] @@ -172,7 +172,7 @@ [% separator_displayed = 1 %] [% END %] - addl. [% type.name FILTER html %] + addl. [% type.name FILTER html FILTER no_break %]