Commit 61a49f22 authored by travis%sedsystems.ca's avatar travis%sedsystems.ca

Bug 245282 : Flags should use nonbreaking hyphens or nowrap or somehow prevent…

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
parent 00aa5409
...@@ -249,6 +249,14 @@ sub create { ...@@ -249,6 +249,14 @@ sub create {
return $var; 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 , xml => \&Bugzilla::Util::xml_quote ,
# This filter escapes characters in a variable or value string for # This filter escapes characters in a variable or value string for
......
...@@ -1249,6 +1249,7 @@ END ...@@ -1249,6 +1249,7 @@ END
obsolete => sub { return $_; }, obsolete => sub { return $_; },
js => sub { return $_; }, js => sub { return $_; },
html_linebreak => sub { return $_; }, html_linebreak => sub { return $_; },
no_break => sub { return $_; },
url_quote => sub { return $_; }, url_quote => sub { return $_; },
xml => sub { return $_; }, xml => sub { return $_; },
quoteUrls => sub { return $_; }, quoteUrls => sub { return $_; },
......
...@@ -93,6 +93,7 @@ foreach my $include_path (@include_paths) { ...@@ -93,6 +93,7 @@ foreach my $include_path (@include_paths) {
FILTERS => FILTERS =>
{ {
html_linebreak => sub { return $_; }, html_linebreak => sub { return $_; },
no_break => sub { return $_; } ,
js => sub { return $_ } , js => sub { return $_ } ,
inactive => [ sub { return sub { return $_; } }, 1] , inactive => [ sub { return sub { return $_; } }, 1] ,
closed => [ sub { return sub { return $_; } }, 1] , closed => [ sub { return sub { return $_; } }, 1] ,
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
[% FOREACH type = types %] [% FOREACH type = types %]
<tr class="[% IF type.is_active %]active[% ELSE %]inactive[% END %]"> <tr class="[% IF type.is_active %]active[% ELSE %]inactive[% END %]">
<td><a href="editflagtypes.cgi?action=edit&amp;id=[% type.id %]">[% type.name FILTER html %]</a></td> <td><a href="editflagtypes.cgi?action=edit&amp;id=[% type.id %]">[% type.name FILTER html FILTER no_break %]</a></td>
<td>[% type.description FILTER html %]</td> <td>[% type.description FILTER html %]</td>
<td> <td>
<a href="editflagtypes.cgi?action=copy&amp;id=[% type.id %]">Copy</a> <a href="editflagtypes.cgi?action=copy&amp;id=[% type.id %]">Copy</a>
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
[% IF flag.setter %] [% IF flag.setter %]
[% flag.setter.nick FILTER html %]: [% flag.setter.nick FILTER html %]:
[% END %] [% END %]
[%+ flag.type.name FILTER html %][% flag.status %] [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %]
[%+ IF flag.status == "?" && flag.requestee %] [%+ IF flag.status == "?" && flag.requestee %]
([% flag.requestee.nick FILTER html %]) ([% flag.requestee.nick FILTER html %])
[% END %]<br> [% END %]<br>
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
[% flag.setter.nick FILTER html %]: [% flag.setter.nick FILTER html %]:
</td> </td>
<td> <td>
[% type.name FILTER html %] [% type.name FILTER html FILTER no_break %]
</td> </td>
<td> <td>
<select id="flag-[% flag.id %]" name="flag-[% flag.id %]" <select id="flag-[% flag.id %]" name="flag-[% flag.id %]"
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
[% IF (!type.flags || type.flags.size == 0) && type.is_active %] [% IF (!type.flags || type.flags.size == 0) && type.is_active %]
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>[% type.name FILTER html %]</td> <td>[% type.name FILTER html FILTER no_break %]</td>
<td> <td>
<select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]" <select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]"
onchange="toggleRequesteeField(this);"> onchange="toggleRequesteeField(this);">
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
[% separator_displayed = 1 %] [% separator_displayed = 1 %]
[% END %] [% END %]
<tr> <tr>
<td colspan="2">addl. [% type.name FILTER html %]</td> <td colspan="2">addl. [% type.name FILTER html FILTER no_break %]</td>
<td> <td>
<select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]" <select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]"
onchange="toggleRequesteeField(this);"> onchange="toggleRequesteeField(this);">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment