From 475abdfcbaa5609ccbc480afa2ab1670574387fd Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Thu, 13 May 2010 08:50:15 -0700 Subject: Bug 555850: Make fields.html help on enter_bug happen when the user hovers over the fields r=timello, a=mkanat --- template/en/default/bug/create/create.html.tmpl | 107 ++++++++++++------------ template/en/default/bug/field-help.none.tmpl | 17 +++- template/en/default/bug/field-label.html.tmpl | 53 ++++++++++++ template/en/default/bug/field.html.tmpl | 14 +--- template/en/default/filterexceptions.pl | 2 - template/en/default/pages/fields.html.tmpl | 7 +- 6 files changed, 124 insertions(+), 76 deletions(-) create mode 100644 template/en/default/bug/field-label.html.tmpl (limited to 'template/en') diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index e983b611b..983f12bb9 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -214,10 +214,13 @@ TUI_hide_default('expert_fields'); [%# We can't use the select block in these two cases for various reasons. %] - - - Component: - + [% component_desc_url = BLOCK -%] + describecomponents.cgi?product=[% product.name FILTER url_quote %] + [% END %] + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.component editable = 1 required = 1 + desc_url = component_desc_url + %] [%- FOREACH v = version %] @@ -321,8 +325,7 @@ TUI_hide_default('expert_fields'); [% IF Param('usetargetmilestone') && Param('letsubmitterchoosemilestone') %] - [% sel = { description => 'Target Milestone', name => 'target_milestone' } %] - [% INCLUDE select %] + [% INCLUDE select field = bug_fields.target_milestone %] [% ELSE %]   [% END %] @@ -343,15 +346,10 @@ TUI_hide_default('expert_fields'); -[% IF bug_status.size <= 1 %] - - Initial State: - [% display_value("bug_status", default.bug_status) FILTER html %] -[% ELSE %] - [% sel = { description => 'Initial State', name => 'bug_status' } %] - [% INCLUDE select %] -[% END %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = bug_fields.bug_status, + editable = (bug_status.size > 1), value = default.bug_status + override_legal_values = bug_status %]   [%# Calculate the number of rows we can use for flags %] @@ -382,7 +380,9 @@ TUI_hide_default('expert_fields'); - Assign To: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.assigned_to editable = 1 + %] [% INCLUDE global/userselect.html.tmpl id => "assigned_to" @@ -399,8 +399,9 @@ TUI_hide_default('expert_fields'); [% IF Param("useqacontact") %] - - [%- field_descs.qa_contact FILTER html %]: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.qa_contact editable = 1 + %] [% INCLUDE global/userselect.html.tmpl id => "qa_contact" @@ -417,8 +418,9 @@ TUI_hide_default('expert_fields'); [% END %] - - [%- field_descs.cc FILTER html %]: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.cc editable = 1 + %] [% INCLUDE global/userselect.html.tmpl id => "cc" @@ -445,8 +447,9 @@ TUI_hide_default('expert_fields'); [% IF user.is_timetracker %] - Estimated - Hours: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.estimated_time editable = 1 + %] @@ -464,8 +467,9 @@ TUI_hide_default('expert_fields'); [% IF Param("usebugaliases") %] - - [%- field_descs.alias FILTER html %]: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.alias editable = 1 + %] @@ -473,8 +477,9 @@ TUI_hide_default('expert_fields'); [% END %] - - [%- field_descs.bug_file_loc FILTER html %]: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.bug_file_loc editable = 1 + %] @@ -499,8 +504,9 @@ TUI_hide_default('expert_fields'); - - [%- field_descs.short_desc FILTER html %]: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.short_desc editable = 1 required = 1 + %] - Keywords: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.keywords editable = 1 + desc_url = "describekeywords.cgi" + %] (optional) @@ -599,15 +608,17 @@ TUI_hide_default('expert_fields'); [% END %] - - [%- field_descs.dependson FILTER html %]: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.dependson editable = 1 + %] - - [%- field_descs.blocked FILTER html %]: + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.blocked editable = 1 + %] @@ -678,30 +689,20 @@ TUI_hide_default('expert_fields'); [%############################################################################%] [% BLOCK select %] - [% IF sel.description %] - - [% sel.description %]: - - [% END %] + [% INCLUDE "bug/field-label.html.tmpl" + field = field editable = 1 + %] - + [%- FOREACH x = ${field.name} %] [% END %] - - [% IF sel.name == "bug_status" %] - - [% END %] [% END %] diff --git a/template/en/default/bug/field-help.none.tmpl b/template/en/default/bug/field-help.none.tmpl index 549a89002..a8129a1e3 100644 --- a/template/en/default/bug/field-help.none.tmpl +++ b/template/en/default/bug/field-help.none.tmpl @@ -149,8 +149,8 @@ status_whiteboard => _ " adding tags and status information.", target_milestone => - "The target_milestone field is used to define when the engineer" - _ " the $terms.bug is assigned to expects to fix it.", + "The $field_descs.target_milestone field is used to define when the" + _ " engineer the $terms.bug is assigned to expects to fix it.", version => "The version field defines the version of the software the" @@ -215,6 +215,19 @@ email1 => [% END %] [% FOREACH help_field = bug_fields.keys %] + + [%# Add help for custom fields. %] + [% IF !help_html.${help_field}.defined %] + [% SET field_type = bug_fields.${help_field}.type %] + [% field_type_desc = BLOCK -%] + [% field_types.$field_type FILTER html %] + [%- END %] + [% help_html.${help_field} = + "A custom $field_type_desc field in this installation" + _ " of ${terms.Bugzilla}." %] + [% END %] + + [%# Add help for the search types, for query.cgi. %] [% type_desc = BLOCK %] The type of [% field_descs.${help_field} FILTER html %] search you would like. diff --git a/template/en/default/bug/field-label.html.tmpl b/template/en/default/bug/field-label.html.tmpl new file mode 100644 index 000000000..c3a282701 --- /dev/null +++ b/template/en/default/bug/field-label.html.tmpl @@ -0,0 +1,53 @@ +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # The Initial Developer of the Original Code is Everything Solved, Inc. + # Portions created by the Initial Developer are Copyright (C) 2010 the + # Initial Developer. All Rights Reserved. + # + # Contributor(s): + # Max Kanat-Alexander + #%] + +[%# INTERFACE: + # field: a Bugzilla::Field object + # desc_url: An alternate link to help for the field. + # hidden: True if the field label should start hidden. + # required: True if this field must have a value. + # rowspan: a "rowspan" value for the label's . + #%] + +[% PROCESS "bug/field-help.none.tmpl" %] + + + + [% IF editable %] + ' IF editable %] + diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index 0656996bd..211f16b8e 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -47,19 +47,7 @@ [% END %] [% IF NOT no_tds %] - - [% IF editable %] - ' IF editable %] - + [% PROCESS "bug/field-label.html.tmpl" %] [% END %] [% IF NOT no_tds %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 07bd4dead..46132c892 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -316,8 +316,6 @@ ], 'bug/create/create.html.tmpl' => [ - 'sel.name', - 'sel.description', 'cloned_bug_id', ], diff --git a/template/en/default/pages/fields.html.tmpl b/template/en/default/pages/fields.html.tmpl index bb1deb8ed..b3583b568 100644 --- a/template/en/default/pages/fields.html.tmpl +++ b/template/en/default/pages/fields.html.tmpl @@ -267,12 +267,7 @@
[% field_desc FILTER html %]
[% SET help_text = field_help_map.${field_desc}.help %] - [% IF help_text %] - [% help_text FILTER none %] - [% ELSE %] - A custom [% field_types.${field_object.type} FILTER html %] field in - this installation of [% terms.Bugzilla %]. - [% END %] + [% help_text FILTER none %]
[% END %] -- cgit v1.2.3-24-g4f1b