[Rt-commit] rtir branch, 2.5-trunk, updated. 2.6.0-3-g7d27527

Jesse Vincent jesse at bestpractical.com
Thu Nov 18 15:36:02 EST 2010


The branch, 2.5-trunk has been updated
       via  7d275277df3233467005c9cf6a97295b0e99c36a (commit)
      from  ec0e666fa941990f5009d9f1a4a3e12d12b146ab (commit)

Summary of changes:
 html/RTIR/Tools/Elements/WHOISForm |   33 +++++++++++++++++++++++++++++++++
 html/RTIR/Tools/Lookup.html        |   27 ++-------------------------
 2 files changed, 35 insertions(+), 25 deletions(-)
 create mode 100644 html/RTIR/Tools/Elements/WHOISForm

- Log -----------------------------------------------------------------
commit 7d275277df3233467005c9cf6a97295b0e99c36a
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Thu Nov 18 15:36:03 2010 -0500

    Started to extract the WHOIS form into its own mason component, working
    toward generalization of the integrated tools

diff --git a/html/RTIR/Tools/Elements/WHOISForm b/html/RTIR/Tools/Elements/WHOISForm
new file mode 100644
index 0000000..56827c2
--- /dev/null
+++ b/html/RTIR/Tools/Elements/WHOISForm
@@ -0,0 +1,33 @@
+<form action="Lookup.html" method="get">
+  <input type="hidden" name="ticket" value="<% $ticket %>" />
+  <tr>
+    <td class="label">WHOIS:</td>
+    <td class="input">
+      <input size="30" name="q" value="<% $q %>" /> at 
+      <select name="server">
+<%PERL>
+foreach my $s ( sort grep $servers->{ $_ }, keys %{ $servers } ) {
+    my $srv = $servers->{ $s };
+    my ($host, $name) = ref $srv?
+        ($srv->{'Host'}, $srv->{'FriendlyName'}):
+        ($srv, '');
+
+    my $selected = '';
+    $selected = "selected" if $host eq $server;
+</%PERL>
+        <option value="<% $host %>" <% $selected %>><% $name || $host %></option>
+% }
+      </select>
+    </td>
+    <td align="left"><input type="submit" value="Go" /></td>
+  </tr>
+</form>
+
+<%args>
+$server => undef
+$ticket => undef
+$q => undef
+</%args>
+<%init>
+my $servers   = RT->Config->Get('whois');
+</%init>
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index 0100b80..769e757 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -97,30 +97,7 @@
 <h2><&|/l&>Look Up Information</&></h2>
 
 <table>
-<form action="Lookup.html" method="get">
-  <input type="hidden" name="ticket" value="<% $ticket %>" />
-  <tr>
-    <td class="label">WHOIS:</td>
-    <td class="input">
-      <input size="30" name="q" value="<% $q %>" /> at 
-      <select name="server">
-<%PERL>
-foreach my $s ( sort grep $servers->{ $_ }, keys %{ $servers } ) {
-    my $srv = $servers->{ $s };
-    my ($host, $name) = ref $srv?
-        ($srv->{'Host'}, $srv->{'FriendlyName'}):
-        ($srv, '');
-
-    my $selected = '';
-    $selected = "selected" if $host eq $server;
-</%PERL>
-        <option value="<% $host %>" <% $selected %>><% $name || $host %></option>
-% }
-      </select>
-    </td>
-    <td align="left"><input type="submit" value="Go" /></td>
-  </tr>
-</form>
+    <& Elements/WHOISForm, ticket => $ticket, q => $q, server => $server, servers => $servers &>
 
 <form action="Traceroute.html" method="get" target="_blank">
   <tr>
@@ -211,6 +188,7 @@ if ( $ARGS{'InvestigateTo'} ) {
     );
 }
 
+my $servers   = RT->Config->Get('whois');
 unless ( $server ) {
     # just pick the first one
     ($server) = map ref $servers->{$_}? $servers->{$_}->{'Host'}: $servers->{$_},
@@ -274,7 +252,6 @@ my $Format = RT->Config->Get('RTIRSearchResultFormats')->{$TicketType . 'Default
 
 </%INIT>
 <%ARGS>
-$servers   => RT->Config->Get('whois')
 $server    => undef
 $handparse => 1
 $q         => undef

-----------------------------------------------------------------------


More information about the Rt-commit mailing list