Bug 508713: Remove duplicated code in flag/list.html.tmpl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=ghendricks a=LpSolit
git-svn-id: svn://10.0.0.236/trunk@257963 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
0e073977b2
commit
e6d24416a6
@ -173,52 +173,8 @@
|
||||
|
||||
[%# Step 1b: Display UI for setting flag. %]
|
||||
[% IF (!type.flags || type.flags.size == 0) && type.is_active %]
|
||||
<tr>
|
||||
<td> </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> </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 %]
|
||||
Loading…
x
Reference in New Issue
Block a user