Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

c

  • Loading branch information...
commit 8e8c9733de3aabb83f111f7992d19b373e49831d 1 parent cc96448
f-marais authored August 11, 2012

Showing 1 changed file with 79 additions and 0 deletions. Show diff stats Hide diff stats

  1. 79  mojo/templates/showrs.html.ep
79  mojo/templates/showrs.html.ep
... ...
@@ -0,0 +1,79 @@
  1
+% use Data::Dumper;
  2
+% my %urlfor= ('tgt_ent_nm'=>  '/entdet?tgt=tgt_ent_nm',
  3
+%   'src_ent_nm'=>'/entdet?src=src_ent_nm');
  4
+% $Data::Dumper::Indent=1;
  5
+	<style>
  6
+     .th { font-family:"ARIAL"; font-size: 8pt; font-style:"BOLD";   mso-number-format: "\@" }
  7
+	  .tdtext1 { font-size: 8pt;   mso-number-format: "\@" }
  8
+	  .tdint1 { font-size: 8pt;   mso-number-format: \#\#\#0 }
  9
+	  .tdflt1 { font-size: 8pt;   mso-number-format: \#\,\#\#0\.00 }
  10
+	  .tdtext2 { font-size: 8pt;   mso-number-format: "\@" }
  11
+	  .tdint2 { font-size: 8pt;   mso-number-format: \#\#\#0 }
  12
+	  .tdflt2 { font-size: 8pt;   mso-number-format: \#\,\#\#0\.00 }
  13
+	  .xl25 {  WHITE-SPACE: normal; mso-number-format: "mmm\ d,\ yyyy" }
  14
+	</style><table class="Grid"><tr>
  15
+<br>
  16
+% my @cols=defined $rs->{attrs}->{columns} 
  17
+%        ?  @{$rs->{attrs}->{columns}} 
  18
+%        : $rs->result_source->columns;
  19
+% for my $col (@cols)
  20
+% {
  21
+%       my $hdg_col = $self->app->{config}->{cols}->{$col} || $col;
  22
+%    if ($rs->result_source->column_info($col)->{is_numeric})
  23
+%    {
  24
+        <th class="th" FILTER=ALL align=right> <%= $hdg_col %> </th>
  25
+%       	} else { 
  26
+        <th class="th" FILTER=ALL align=left> <%= $hdg_col %> </th>
  27
+%		}
  28
+%	}
  29
+</tr>
  30
+%   my ($dup_found,$dup_col);
  31
+%	while (my $row = $rs->next) {
  32
+<tr>
  33
+%       my $k=0;
  34
+%       for my $col (@cols)    {
  35
+%           if ($k==0) {
  36
+%               if (defined $dup_col && $dup_col eq $row->$col) 
  37
+%               {  $dup_found=1; }
  38
+%              else { $dup_found=0;$dup_col=$row->$col}
  39
+%           }
  40
+%           $k++;
  41
+%           if ($dup_found && defined $chk_blanks
  42
+%            && $k<=$chk_blanks) {
  43
+                       <td> </td>
  44
+%                   next;
  45
+%           }
  46
+%        if ($row->$col
  47
+%         && $row->$col=~/\x0a/m) {
  48
+            <td class="tdtext2"><PRE> <%= $row->$col %></PRE> </td>
  49
+%            next;
  50
+%        }
  51
+%        my $cel;
  52
+%        if ($url->{$col}) {
  53
+%          my $ul=$url->{$col};
  54
+%          $ul=~s/$_/$row->$_/eg for @cols;
  55
+%          $ul=url_for $ul;
  56
+%          $cel = '<a href=' . $ul . '>' . $row->$col . '</a>'; 
  57
+%        } elsif (exists $urlfor{$col} && defined $urlfor{$col} ) {
  58
+%          my $ul=$urlfor{$col};
  59
+%          $ul=~s/$col/$row->$col/eg;
  60
+%          $ul=url_for $ul;
  61
+%          $cel = '<a href=' . $ul . '>' . $row->$col . '</a>'; 
  62
+%         }
  63
+%        else { $cel=$row->$col }
  64
+%        if ($rs->result_source->column_info($col)->{is_numeric}) {
  65
+                <td  align=right> <%= $cel %> </td>      
  66
+%        }
  67
+%        else  { 
  68
+%           if ((exists $urlfor{$col} && defined $urlfor{$col})
  69
+%           || (exists $url->{$col} && defined $url->{$col})) {
  70
+                <td  align=left > <%== $cel %> </td> 
  71
+%           } else {
  72
+                <td  align=left > <%= $cel %> </td> 
  73
+%           }
  74
+%        }
  75
+%       }
  76
+</tr>
  77
+% }
  78
+</table>
  79
+

0 notes on commit 8e8c973

Please sign in to comment.
Something went wrong with that request. Please try again.