summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-07-18 04:57:35 +0200
committermkanat%bugzilla.org <>2006-07-18 04:57:35 +0200
commit47a9a892e8fe70863846c00a5858fceffc79b3d0 (patch)
tree1dc6d98a8f8090261ef43ae0ad5f919c490196e6 /template
parent643f05bd8c129b1a40b31665f8209d6935d8b961 (diff)
downloadbugzilla-47a9a892e8fe70863846c00a5858fceffc79b3d0.tar.gz
bugzilla-47a9a892e8fe70863846c00a5858fceffc79b3d0.tar.xz
Bug 344513: Make plain-text custom fields functional on all pages except enter_bug.cgi
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk
Diffstat (limited to 'template')
-rw-r--r--template/en/default/bug/edit.html.tmpl5
-rw-r--r--template/en/default/bug/field.html.tmpl39
-rw-r--r--template/en/default/bug/show-multiple.html.tmpl14
-rw-r--r--template/en/default/bug/show.html.tmpl2
-rw-r--r--template/en/default/global/field-descs.none.tmpl11
-rw-r--r--template/en/default/list/edit-multiple.html.tmpl8
6 files changed, 65 insertions, 14 deletions
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index dc80079d5..83bb5fb51 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -18,6 +18,7 @@
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Vaskin Kissoyan <vkissoyan@yahoo.com>
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
#%]
[% PROCESS global/variables.none.tmpl %]
@@ -498,7 +499,9 @@
[% USE Bugzilla %]
<table>
[% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1 }) %]
- [% PROCESS bug/field.html.tmpl value=bug.${field.name} %]
+ <tr>
+ [% PROCESS bug/field.html.tmpl value=bug.${field.name} editable=1 %]
+ </tr>
[% END %]
</table>
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index cbde9cf27..9c45b3e57 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -17,20 +17,33 @@
# Rights Reserved.
#
# Contributor(s): Myk Melez <myk@mozilla.org>
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
#%]
-<tr>
+[%# INTERFACE:
+ # field: a Bugzilla::Field object
+ # value: The value of the field for this bug.
+ # editable: Whether the field should be displayed as an editable
+ # <input> or as just the plain text of its value.
+ #%]
+
+<th class="field_label">
+ [% IF editable %]
+ <label for="[% field.name FILTER html %]">
+ [% END %]
+ [% field_descs.${field.name} FILTER html %]:
+ [% '</label>' IF editable %]
+</th>
+
+<td class="field_value">
+[% IF editable %]
[% SWITCH field.type %]
- [% CASE constants.FIELD_TYPE_FREETEXT %]
- <th align="right">
- <label for="[% field.name FILTER html %]">
- [% field.description FILTER html %]:
- </label>
- </th>
- <td>
- <input name="[% field.name FILTER html %]"
- value="[% value FILTER html %]"
- size="60">
- </td>
+ [% CASE constants.FIELD_TYPE_FREETEXT %]
+ <input name="[% field.name FILTER html %]"
+ value="[% value FILTER html %]"
+ size="60">
[% END %]
-</tr>
+[% ELSE %]
+ [% value FILTER html %]
+[% END %]
+</td>
diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl
index 22bc3db69..c76e07699 100644
--- a/template/en/default/bug/show-multiple.html.tmpl
+++ b/template/en/default/bug/show-multiple.html.tmpl
@@ -20,6 +20,7 @@
# Gervase Markham <gerv@gerv.net>
# Toms Baugis <toms@myrealbox.com>
# Olav Vitters <olav@bkor.dhs.org>
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
#%]
[% PROCESS "global/field-descs.none.tmpl" %]
@@ -164,6 +165,19 @@
[% PROCESS row cell = "status_whiteboard" fullrow = 1 %]
[% END %]
+ [% USE Bugzilla %]
+ [% field_counter = 0 %]
+ [% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1 }) %]
+ [% field_counter = field_counter + 1 %]
+ [%# Odd-numbered fields get an opening <tr> %]
+ [% '<tr>' IF field_counter % 2 %]
+ [% PROCESS bug/field.html.tmpl value=bug.${field.name} editable=0 %]
+ [%# Even-numbered fields get a closing <tr> %]
+ [% '</tr>' IF !(field_counter % 2) %]
+ [% END %]
+ [%# And we have to finish the row if we ended on an odd number. %]
+ [% '<th></th><td></td></tr>' IF field_counter % 2 %]
+
[% IF (bug.dependson.size || bug.blocked.size) %]
[% PROCESS dependencies name = "dependson" %]
[% PROCESS dependencies name = "blocked" %]
diff --git a/template/en/default/bug/show.html.tmpl b/template/en/default/bug/show.html.tmpl
index 99fd46660..eb7457a7c 100644
--- a/template/en/default/bug/show.html.tmpl
+++ b/template/en/default/bug/show.html.tmpl
@@ -19,6 +19,7 @@
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Vaskin Kissoyan <vkissoyan@yahoo.com>
# Bradley Baetz <bbaetz@student.usyd.edu.au>
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
#%]
[% PROCESS global/variables.none.tmpl %]
@@ -39,6 +40,7 @@
"bz_component_$bug.component",
"bz_bug_$bug.bug_id"
]
+ style_urls = ['skins/standard/show_bug.css']
%]
[% END %]
diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl
index 7a2725121..ba6f675e4 100644
--- a/template/en/default/global/field-descs.none.tmpl
+++ b/template/en/default/global/field-descs.none.tmpl
@@ -69,6 +69,17 @@
"votes" => "Votes",
"work_time" => "Hours Worked"} %]
+[%# Also include any custom fields or fields which don't have a
+ Description here, by copying their Description from the
+ database. If you want to override this for your language
+ or your installation, just use a hook. %]
+
+[% USE Bugzilla %]
+[% FOREACH field = Bugzilla.get_fields() %]
+ [% SET field_descs.${field.name} = field.description
+ IF !field_descs.${field_name}.exists %]
+[% END %]
+
[% status_descs = { "UNCONFIRMED" => "UNCONFIRMED",
"NEW" => "NEW",
"ASSIGNED" => "ASSIGNED",
diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl
index 92a083a68..958a95cf8 100644
--- a/template/en/default/list/edit-multiple.html.tmpl
+++ b/template/en/default/list/edit-multiple.html.tmpl
@@ -17,6 +17,7 @@
# Rights Reserved.
#
# Contributor(s): Myk Melez <myk@mozilla.org>
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
#%]
[% PROCESS global/variables.none.tmpl %]
@@ -206,6 +207,13 @@
</tr>
[% END %]
+ [% USE Bugzilla %]
+ [% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1 }) %]
+ <tr>
+ [% PROCESS bug/field.html.tmpl value=dontchange editable=1 %]
+ </tr>
+ [% END %]
+
</table>
<b><label for="comment">Additional Comments:</label></b><br>