[Rt-commit] r8091 -
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Tue Jul 10 17:44:12 EDT 2007
Author: ruz
Date: Tue Jul 10 17:44:12 2007
New Revision: 8091
Modified:
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/EditCustomFields
Log:
* get rid of Count call, use counter to figure out if we have even or odd number of CFs
* use less nested tables
Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/EditCustomFields
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/EditCustomFields (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/EditCustomFields Tue Jul 10 17:44:12 2007
@@ -46,22 +46,14 @@
%#
%# END BPS TAGGED BLOCK }}}
<table>
-<tr>
-<td valign="top" width="50%">
-<table>
-
% my $i = 0;
-% my $cfcount = $CustomFields->Count;
-% $cfcount++ if ($cfcount % 2) ; # if we have an odd number of
-% #custom fields, fudge it so we know where to put in the table break
-% while (my $CustomField = $CustomFields->Next()) {
-% if ($cfcount == 2 * $i) {
-</table>
-</td>
-<td valign="top" width="50%">
-<table>
-% }
+% while ( my $CustomField = $CustomFields->Next ) {
% $i++;
+% if ( $i % 2 ) {
+<tr>
+% }
+<td width="50%">
+<table>
<tr id="CF-<%$CustomField->id%>-EditRow">
<td class="labeltop">
<b><%$CustomField->Name%></b><br />
@@ -76,15 +68,25 @@
&>
% if (my $msg = $m->notes('InvalidField-' . $CustomField->Id)) {
<br />
- <em style="color: red"><% $msg %></em></td>
+ <em style="color: red"><% $msg %></em>
% }
+ </td>
</tr>
-% }
</table>
</td>
+
+% unless ( $i % 2 ) {
</tr>
-</table>
+% }
+
+% }
+%# close row if required
+% if ( $i % 2 ) {
+</tr>
+% }
+
+</table>
<%INIT>
my $CustomFields;
my $NamePrefix;
More information about the Rt-commit
mailing list