Commit 6b309a04 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 508713: Remove duplicated code in flag/list.html.tmpl - Patch by Fré©ric…

Bug 508713: Remove duplicated code in flag/list.html.tmpl - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=ghendricks a=LpSolit
parent 360c7807
...@@ -173,52 +173,8 @@ ...@@ -173,52 +173,8 @@
[%# Step 1b: Display UI for setting flag. %] [%# Step 1b: Display UI for setting flag. %]
[% IF (!type.flags || type.flags.size == 0) && type.is_active %] [% IF (!type.flags || type.flags.size == 0) && type.is_active %]
<tr>
<td>&nbsp;</td> [% PROCESS flag_row first_cell_empty = 1 addl_text = "" %]
<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>
[% END %] [% END %]
[% END %] [% END %]
...@@ -229,53 +185,9 @@ ...@@ -229,53 +185,9 @@
<tr><td colspan="3"><hr></td></tr> <tr><td colspan="3"><hr></td></tr>
[% separator_displayed = 1 %] [% separator_displayed = 1 %]
[% END %] [% 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> </table>
[% ELSE %] [% ELSE %]
...@@ -289,4 +201,60 @@ ...@@ -289,4 +201,60 @@
[% END %]<br> [% END %]<br>
[% END %] [% END %]
[% 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 %] [% END %]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment