diff options
author | travis%sedsystems.ca <> | 2005-01-19 03:29:25 +0100 |
---|---|---|
committer | travis%sedsystems.ca <> | 2005-01-19 03:29:25 +0100 |
commit | 61a49f228204e2991aea7970c44efdd433f8c71b (patch) | |
tree | 02f413c6b6600b62231883fa4b5baf121c5d96ac | |
parent | 00aa5409017d6e0f6607e09502c8d0d470077473 (diff) | |
download | bugzilla-61a49f228204e2991aea7970c44efdd433f8c71b.tar.gz bugzilla-61a49f228204e2991aea7970c44efdd433f8c71b.tar.xz |
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
-rw-r--r-- | Bugzilla/Template.pm | 8 | ||||
-rwxr-xr-x | checksetup.pl | 1 | ||||
-rw-r--r-- | t/004template.t | 1 | ||||
-rw-r--r-- | template/en/default/admin/flag-type/list.html.tmpl | 2 | ||||
-rw-r--r-- | template/en/default/attachment/list.html.tmpl | 2 | ||||
-rw-r--r-- | template/en/default/flag/list.html.tmpl | 6 |
6 files changed, 15 insertions, 5 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index cddd33ba4..cb034478d 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 9615beb73..a01d0962a 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 86b505c28..f35b53425 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 44cbf36c2..9638df891 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 %] <tr class="[% IF type.is_active %]active[% ELSE %]inactive[% END %]"> - <td><a href="editflagtypes.cgi?action=edit&id=[% type.id %]">[% type.name FILTER html %]</a></td> + <td><a href="editflagtypes.cgi?action=edit&id=[% type.id %]">[% type.name FILTER html FILTER no_break %]</a></td> <td>[% type.description FILTER html %]</td> <td> <a href="editflagtypes.cgi?action=copy&id=[% type.id %]">Copy</a> diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index d5741d6a2..41115ab9c 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 %]<br> diff --git a/template/en/default/flag/list.html.tmpl b/template/en/default/flag/list.html.tmpl index 08f8c5547..f660b15ca 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 %]: </td> <td> - [% type.name FILTER html %] + [% type.name FILTER html FILTER no_break %] </td> <td> <select id="flag-[% flag.id %]" name="flag-[% flag.id %]" @@ -137,7 +137,7 @@ [% IF (!type.flags || type.flags.size == 0) && type.is_active %] <tr> <td> </td> - <td>[% type.name FILTER html %]</td> + <td>[% type.name FILTER html FILTER no_break %]</td> <td> <select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]" onchange="toggleRequesteeField(this);"> @@ -172,7 +172,7 @@ [% separator_displayed = 1 %] [% END %] <tr> - <td colspan="2">addl. [% type.name FILTER html %]</td> + <td colspan="2">addl. [% type.name FILTER html FILTER no_break %]</td> <td> <select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]" onchange="toggleRequesteeField(this);"> |