From: travis%sedsystems.ca <> Date: Wed, 19 Jan 2005 02:29:25 +0000 (+0000) Subject: Bug 245282 : Flags should use nonbreaking hyphens or nowrap or somehow prevent hyphen... X-Git-Tag: bugzilla-2.19.3~384 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61a49f228204e2991aea7970c44efdd433f8c71b;p=thirdparty%2Fbugzilla.git 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 --- diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index cddd33ba47..cb034478d4 100644 --- a/Bugzilla/Template.pm +++ b/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/checksetup.pl b/checksetup.pl index 9615beb730..a01d0962a0 100755 --- a/checksetup.pl +++ b/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/t/004template.t b/t/004template.t index 86b505c285..f35b534256 100644 --- a/t/004template.t +++ b/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/template/en/default/admin/flag-type/list.html.tmpl b/template/en/default/admin/flag-type/list.html.tmpl index 44cbf36c29..9638df8914 100644 --- a/template/en/default/admin/flag-type/list.html.tmpl +++ b/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/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index d5741d6a2c..41115ab9cc 100644 --- a/template/en/default/attachment/list.html.tmpl +++ b/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/template/en/default/flag/list.html.tmpl b/template/en/default/flag/list.html.tmpl index 08f8c5547f..f660b15cad 100644 --- a/template/en/default/flag/list.html.tmpl +++ b/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 %]