[Rt-commit] r5318 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Thu Jun 1 19:34:30 EDT 2006


Author: ruz
Date: Thu Jun  1 19:34:29 2006
New Revision: 5318

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditScrip

Log:
 r3134 at cubic-pc:  cubic | 2006-06-01 05:18:25 +0400
 * use 10 lines by default for custom code
 * custom boxes grow proportional to the code size


Modified: rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditScrip
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditScrip	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditScrip	Thu Jun  1 19:34:29 2006
@@ -45,7 +45,6 @@
 %# END BPS TAGGED BLOCK }}}
 <& /Elements/ListActions, actions => \@actions &>
 
-  
 <form method="post" action="Scrip.html">
 <input type="hidden" class="hidden" name="id" value="<%$id%>" />
 <input type="hidden" class="hidden" name="Queue" value="<%$Queue%>" />
@@ -103,27 +102,30 @@
 </td>
 </tr>
 <tr>
-<td class="labeltop">
-<&|/l&>Custom condition</&>:
-</td>
+<td class="labeltop"><&|/l&>Custom condition</&>:</td>
 <td>
-<textarea cols="80" rows="5" name="Scrip-<%$id%>-CustomIsApplicableCode"><%$scrip->CustomIsApplicableCode%></textarea>
+% my $code = $scrip->CustomIsApplicableCode;
+% my $lines = @{[ $code =~ /\n/gs ]} + 3;
+% $lines = $min_lines if $lines < $min_lines;
+<textarea cols="80" rows="<% $lines %>" name="Scrip-<%$id%>-CustomIsApplicableCode"><% $code %></textarea>
 </td>
 </tr>
 <tr>
-<td class="labeltop">
-<&|/l&>Custom action preparation code</&>:
-</td>
+<td class="labeltop"><&|/l&>Custom action preparation code</&>:</td>
 <td>
-<textarea cols="80" rows="5" name="Scrip-<%$id%>-CustomPrepareCode"><%$scrip->CustomPrepareCode%></textarea>
+% $code = $scrip->CustomPrepareCode;
+% $lines = @{[ $code =~ /\n/gs ]} + 3;
+% $lines = $min_lines if $lines < $min_lines;
+<textarea cols="80" rows="<% $lines %>" name="Scrip-<%$id%>-CustomPrepareCode"><% $code %></textarea>
 </td>
 </tr>
 <tr>
-<td class="labeltop">
-<&|/l&>Custom action cleanup code</&>:
-</td>
+<td class="labeltop"><&|/l&>Custom action cleanup code</&>:</td>
 <td>
-<textarea cols="80" rows="5" name="Scrip-<%$id%>-CustomCommitCode"><%$scrip->CustomCommitCode%></textarea>
+% $code = $scrip->CustomCommitCode;
+% $lines = @{[ $code =~ /\n/gs ]} + 3;
+% $lines = $min_lines if $lines < $min_lines;
+<textarea cols="80" rows="<% $lines %>" name="Scrip-<%$id%>-CustomCommitCode"><% $code %></textarea>
 </td>
 </tr>
 </table>
@@ -187,6 +189,8 @@
     $id = 'new';
 }
 
+my $min_lines = 10;
+
 # }}}
 </%init>
 


More information about the Rt-commit mailing list