summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
authorReed Loden <reed@reedloden.com>2010-07-05 09:42:01 +0200
committerReed Loden <reed@reedloden.com>2010-07-05 09:42:01 +0200
commitbf3e63a75b8fbc9d613ec3fd6289a178731692e4 (patch)
treee2e063f03682f85368cb462d525b35e3114053db /template/en/default/bug
parente598bc84cff9a281d312651332465c3899e3f49d (diff)
downloadbugzilla-bf3e63a75b8fbc9d613ec3fd6289a178731692e4.tar.gz
bugzilla-bf3e63a75b8fbc9d613ec3fd6289a178731692e4.tar.xz
Bug 455810 - Add autocomplete support to the keywords field
* Special thanks to Guy Pyrzak for the original patch [r=mkanat a=mkanat]
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/create/create.html.tmpl11
-rw-r--r--template/en/default/bug/edit.html.tmpl9
-rw-r--r--template/en/default/bug/field.html.tmpl27
3 files changed, 32 insertions, 15 deletions
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index 0733de02a..fdac893c0 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -630,14 +630,11 @@ TUI_hide_default('expert_fields');
[% IF user.in_group('editbugs', product.id) %]
[% IF use_keywords %]
<tr>
- [% INCLUDE "bug/field-label.html.tmpl"
- field = bug_fields.keywords editable = 1
- desc_url = "describekeywords.cgi"
+ [% INCLUDE bug/field.html.tmpl
+ bug = default, field = bug_fields.keywords, editable = 1,
+ value = keywords, desc_url = "describekeywords.cgi",
+ value_span = 2
%]
- <td colspan="3">
- <input id="keywords" name="keywords" size="40"
- value="[% keywords FILTER html %]"> (optional)
- </td>
</tr>
[% END %]
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 0ef3cba8f..5520e7699 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -591,8 +591,13 @@
<label for="keywords" accesskey="k">
<b><a href="describekeywords.cgi"><u>K</u>eywords</a></b></label>:
</td>
- [% PROCESS input inputname => "keywords" size => 40 colspan => 2
- value => bug.keywords.join(', ') %]
+ <td class="field_value" colspan="2">
+ [% INCLUDE bug/field.html.tmpl
+ bug = bug, field = bug_fields.keywords, value = bug.keywords
+ editable = bug.check_can_change_field("keywords", 0, 1),
+ no_tds = 1
+ %]
+ </td>
</tr>
[% END %]
[% END %]
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index 97d38661c..2417ce39b 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -18,6 +18,8 @@
# Contributor(s): Myk Melez <myk@mozilla.org>
# Max Kanat-Alexander <mkanat@bugzilla.org>
# Elliotte Martin <elliotte_martin@yahoo.com>
+ # Guy Pyrzak <guy.pyrzak@gmail.com>
+ # Reed Loden <reed@reedloden.com>
#%]
[%# INTERFACE:
@@ -165,22 +167,35 @@
[% FOREACH url = value %]
<li>
<a href="[% url FILTER html %]">[% url FILTER html %]</a>
- [% IF editable %]
- <label><input type="checkbox" value="[% url FILTER html %]"
- name="remove_[% field.name FILTER html %]">
- Remove</label>
- [% END %]
+ <label><input type="checkbox" value="[% url FILTER html %]"
+ name="remove_[% field.name FILTER html %]">
+ Remove</label>
</li>
[% END %]
[% '</ul>' IF value.size %]
- [% IF editable && Param('use_see_also') %]
+ [% IF Param('use_see_also') %]
<label for="[% field.name FILTER html %]">
<strong>Add [% terms.Bug %] URLs:</strong>
</label><br>
<input type="text" id="[% field.name FILTER html %]" size="40"
class="text_input" name="[% field.name FILTER html %]">
[% END %]
+ [% CASE constants.FIELD_TYPE_KEYWORDS %]
+ <div id="keyword_container">
+ <input type="text" id="[% field.name FILTER html %]" size="40"
+ class="text_input" name="[% field.name FILTER html %]"
+ value="[% value FILTER html %]">
+ <div id="keyword_autocomplete"></div>
+ </div>
+ <script type="text/javascript" defer="defer">
+ YAHOO.bugzilla.keyword_array = [
+ [%- FOREACH keyword = all_keywords %]
+ [%-# %]"[% keyword.name FILTER js %]"
+ [%- "," IF NOT loop.last %][% END %]];
+ YAHOO.bugzilla.keywordAutocomplete.init('[% field.name FILTER js %]',
+ 'keyword_autocomplete');
+ </script>
[% END %]
[% ELSIF field.type == constants.FIELD_TYPE_TEXTAREA %]
<div class="uneditable_textarea">[% value FILTER wrap_comment(60)