/[A3C]/lib/A3C/View/Strix.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/View/Strix.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 221 by dpavlin, Mon Jun 23 00:12:56 2008 UTC revision 242 by dpavlin, Wed Oct 1 20:22:22 2008 UTC
# Line 45  template 'index.html' => page { Line 45  template 'index.html' => page {
45    
46  };  };
47    
48  =head2 name_diff  =head2 errors
49    
50  =cut  =cut
51    
52  template 'name_diff' => page {  template 'errors' => page {
53    
54          title is _('Strix name differences');          title is _('Strix errors');
55    
56          render_region(          render_region(
57                  name => 'selected-instances',                  name => 'selected-instances',
58                  path => '/strix/selected-instances'                  path => '/strix/selected-instances'
59          );          );
60    
61            h2 { _('Name differences') }
62    
63          my $name_diff = A3C::SQL->new({ query => qq{          my $name_diff = A3C::SQL->new({ query => qq{
64                  select                  select
65                          instance,hreduorgurl,                          instance,hreduorgurl,
# Line 92  template 'name_diff' => page { Line 94  template 'name_diff' => page {
94    
95  };  };
96    
97    =head2 instances
98    
99    =cut
100    
101    template 'instances' => page {
102    
103            title is _('Strix instances');
104    
105            my $sql = A3C::SQL->new({ query => qq{
106                    select
107                            hrEduOrgUrl, o, l, postalAddress, telephoneNumber, facsimileTelephoneNumber
108                    from strix_instances
109                    join hr_edu_orgs on cn = instance
110                    order by l,o
111            }});
112    
113            if ( $sql->count > 0 ) {
114    
115                    table {
116                            row {
117                                    th { _('hrEduOrgUrl') }
118                                    th { _('o') }
119                                    th { _('l') }
120                                    th { _('postalAddress') }
121                                    th { _('telephoneNumber') }
122                                    th { _('facsimileTelephoneNumber') }
123                            };
124                            while ( my $row = $sql->next ) {
125                                    row {
126                                            cell { outs_raw '<a href="http://' . $row->hrEduOrgUrl . '">' . $row->hrEduOrgUrl . '</a>' }
127                                            cell { $row->o }
128                                            cell { $row->l }
129                                            cell { $row->postalAddress }
130                                            cell { $row->telephoneNumber }
131                                            cell { $row->facsimileTelephoneNumber }
132                                    }
133                            }
134                    }
135    
136                    div { _("Found total of %1 strix instances", $sql->count) }
137    
138            } else {
139                    div { _("Can't find any strix instances") }
140            }
141    
142    };
143    
144  =head2 sql  =head2 sql
145    
146  Execute SQL query on instance  Execute SQL query on instance
# Line 122  sub strix { Line 171  sub strix {
171  sub strix_link {  sub strix_link {
172          my ( $url, $label ) = @_;          my ( $url, $label ) = @_;
173          hyperlink(          hyperlink(
174                  url => 'http://' . get('instance') . '.cms-qa.skole.hr' . $url,                  url => 'http://' . get('instance') . Jifty->config->app('strix')->{domain} . $url,
175                  label => $label || $url,                  label => $label || $url,
176                  target => 'strix',                  target => 'strix',
177          );          );

Legend:
Removed from v.221  
changed lines
  Added in v.242

  ViewVC Help
Powered by ViewVC 1.1.26