summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-08-06 18:08:36 +0200
committerlpsolit%gmail.com <>2009-08-06 18:08:36 +0200
commit6b309a04c2e57d0ba79dc15829ce7839efd3e72f (patch)
tree0ae1f62fad5ba725ac245972cbe87b0b784b7171 /template
parent360c780767308810e4f26010cb9feb84bde68fd2 (diff)
downloadbugzilla-6b309a04c2e57d0ba79dc15829ce7839efd3e72f.tar.gz
bugzilla-6b309a04c2e57d0ba79dc15829ce7839efd3e72f.tar.xz
Bug 508713: Remove duplicated code in flag/list.html.tmpl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=ghendricks a=LpSolit
Diffstat (limited to 'template')
-rw-r--r--template/en/default/flag/list.html.tmpl152
1 files changed, 60 insertions, 92 deletions
diff --git a/template/en/default/flag/list.html.tmpl b/template/en/default/flag/list.html.tmpl
index 1c1a25d4a..5681d0b1c 100644
--- a/template/en/default/flag/list.html.tmpl
+++ b/template/en/default/flag/list.html.tmpl
@@ -173,52 +173,8 @@
[%# Step 1b: Display UI for setting flag. %]
[% IF (!type.flags || type.flags.size == 0) && type.is_active %]
- <tr>
- <td>&nbsp;</td>
- <td>
- <label title="[% type.description FILTER html %]"
- for="flag_type-[% type.id %]">
- [%- type.name FILTER html FILTER no_break %]</label>
- </td>
- <td>
- <select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]"
- title="[% type.description FILTER html %]"
- [% " disabled=\"disabled\"" UNLESS (type.is_requestable && user.can_request_flag(type)) || user.can_set_flag(type) %]
- onchange="toggleRequesteeField(this);"
- class="flag_select">
- <option value="X"></option>
- [% IF type.is_requestable && user.can_request_flag(type) %]
- <option value="?">?</option>
- [% END %]
- [% IF user.can_set_flag(type) %]
- <option value="+">+</option>
- <option value="-">-</option>
- [% END %]
- </select>
- </td>
- [% IF any_flags_requesteeble %]
- <td>
- [% IF type.is_requestable && type.is_requesteeble %]
- <span style="white-space: nowrap;">
- [% IF Param('usemenuforusers') %]
- [% INCLUDE global/userselect.html.tmpl
- name => "requestee_type-$type.id"
- id => "requestee_type-$type.id"
- multiple => type.is_multiplicable * 3
- emptyok => !type.is_multiplicable
- value => ""
- custom_userlist => type.grant_list
- %]
- [% ELSE %]
- (<input type="text" size="30" maxlength="255"
- id="requestee_type-[% type.id %]"
- name="requestee_type-[% type.id %]">)
- [% END %]
- </span>
- [% END %]
- </td>
- [% END %]
- </tr>
+
+ [% PROCESS flag_row first_cell_empty = 1 addl_text = "" %]
[% END %]
[% END %]
@@ -229,53 +185,9 @@
<tr><td colspan="3"><hr></td></tr>
[% separator_displayed = 1 %]
[% END %]
- <tr>
- <td colspan="2">
- addl. <label title="[% type.description FILTER html %]"
- for="flag_type-[% type.id %]">
- [%- type.name FILTER html FILTER no_break %]</label>
- </td>
- <td>
- <select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]"
- title="[% type.description FILTER html %]"
- [% " disabled=\"disabled\"" UNLESS (type.is_requestable && user.can_request_flag(type)) || user.can_set_flag(type) %]
- onchange="toggleRequesteeField(this);"
- class="flag_select">
- <option value="X"></option>
- [% IF type.is_requestable && user.can_request_flag(type) %]
- <option value="?">?</option>
- [% END %]
- [% IF user.can_set_flag(type) %]
- <option value="+">+</option>
- <option value="-">-</option>
- [% END %]
- </select>
- </td>
- [% IF any_flags_requesteeble %]
- <td>
- [% IF type.is_requestable && type.is_requesteeble %]
- <span style="white-space: nowrap;">
- [% IF Param('usemenuforusers') %]
- [% INCLUDE global/userselect.html.tmpl
- name => "requestee_type-$type.id"
- id => "requestee_type-$type.id"
- multiple => type.is_multiplicable * 3
- emptyok => !type.is_multiplicable
- value => ""
- custom_userlist => type.grant_list
- %]
- [% ELSE %]
- (<input type="text" size="30" maxlength="255"
- id="requestee_type-[% type.id %]"
- name="requestee_type-[% type.id %]">)
- [% END %]
- </span>
- [% END %]
- </td>
- [% END %]
- </tr>
- [% END %]
+ [% PROCESS flag_row first_cell_empty = 0 addl_text = "addl." %]
+ [% END %]
</table>
[% ELSE %]
@@ -289,4 +201,60 @@
[% END %]<br>
[% END %]
[% END %]
+[% END %]
+
+[%# Display a table row for unset flags %]
+
+[% BLOCK flag_row %]
+ <tr>
+ [% IF first_cell_empty %]
+ <td>&nbsp;</td>
+ <td>
+ [% ELSE %]
+ <td colspan="2">
+ [% END %]
+
+ [% addl_text FILTER html %]
+ <label title="[% type.description FILTER html %]" for="flag_type-[% type.id %]">
+ [%- type.name FILTER html FILTER no_break %]</label>
+ </td>
+ <td>
+ <select id="flag_type-[% type.id %]" name="flag_type-[% type.id %]"
+ title="[% type.description FILTER html %]"
+ [% " disabled=\"disabled\"" UNLESS (type.is_requestable && user.can_request_flag(type)) || user.can_set_flag(type) %]
+ onchange="toggleRequesteeField(this);"
+ class="flag_select">
+ <option value="X"></option>
+ [% IF type.is_requestable && user.can_request_flag(type) %]
+ <option value="?">?</option>
+ [% END %]
+ [% IF user.can_set_flag(type) %]
+ <option value="+">+</option>
+ <option value="-">-</option>
+ [% END %]
+ </select>
+ </td>
+ [% IF any_flags_requesteeble %]
+ <td>
+ [% IF type.is_requestable && type.is_requesteeble %]
+ <span style="white-space: nowrap;">
+ [% IF Param('usemenuforusers') %]
+ [% INCLUDE global/userselect.html.tmpl
+ name => "requestee_type-$type.id"
+ id => "requestee_type-$type.id"
+ multiple => type.is_multiplicable * 3
+ emptyok => !type.is_multiplicable
+ value => ""
+ custom_userlist => type.grant_list
+ %]
+ [% ELSE %]
+ (<input type="text" size="30" maxlength="255"
+ id="requestee_type-[% type.id %]"
+ name="requestee_type-[% type.id %]">)
+ [% END %]
+ </span>
+ [% END %]
+ </td>
+ [% END %]
+ </tr>
[% END %] \ No newline at end of file