/[webpac2]/Webpacus2/lib/Webpacus/View.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

Annotation of /Webpacus2/lib/Webpacus/View.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 963 - (hide annotations)
Fri Nov 2 12:59:39 2007 UTC (16 years, 6 months ago) by dpavlin
File size: 1297 byte(s)
 r1469@llin:  dpavlin | 2007-11-02 13:59:39 +0100
 rewrote results handling in Template::Declare... Now individual hits
 are returned as Webpacus::Search::DS which is data_structure from
 normalization but with accessors to get it's values

1 dpavlin 946 package Webpacus::View;
2    
3     use strict;
4     use warnings;
5    
6     use Jifty::View::Declare -base;
7    
8     use Data::Dump qw/dump/;
9    
10    
11     template '/' => page {
12     my $action = new_action( class => 'Search' );
13     h1 { _("Search out data") },
14     form {
15     render_param( $action => 'field', default_value => get('field') ),
16     render_param( $action => 'query', default_value => get('query') ),
17     form_submit(
18     label => _('Search'),
19     );
20     };
21    
22     #warn dump( $action->result->content );
23    
24     if ( my $results = $action->result->content( 'results' ) ) {
25     ul {
26 dpavlin 963 while ( my $ds = $results->next ) {
27     warn "view :: ds = ",dump( $ds );
28 dpavlin 946 li {
29 dpavlin 962 div {
30 dpavlin 963 $ds->display( 'TitleProper' ) . '. ' . $ds->display( 'Series' )
31 dpavlin 962 }
32 dpavlin 963 div { $ds->display( 'DatePublication' ) }
33     my $po = $ds->display( 'PripadajuciOznaka' );
34 dpavlin 962 warn('$po=',dump($po));
35 dpavlin 963 my @po = $ds->display( 'PripadajuciOznaka' );
36 dpavlin 962 warn('@po=',dump(@po));
37     ul { attr { class => 'linked'};
38     foreach my $i ( @po ) {
39     warn("i=",dump($i));
40     foreach my $j ( @$i ) {
41     warn("j=",dump($j));
42     li { $j }
43     }
44     }
45     }
46 dpavlin 963 div { $ds->display( 'Fond' ) }
47     div { $ds->display( 'ISBN' ) }
48     tt { $ds->display( 'database' ) . '/' . $ds->display( 'input' ) . '/' . $ds->display( 'id' ) }
49 dpavlin 946 }
50     }
51     }
52     }
53    
54     };
55    
56     1;

  ViewVC Help
Powered by ViewVC 1.1.26