26 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
27 |
use Data::Structure::Util qw(unbless); |
use Data::Structure::Util qw(unbless); |
28 |
|
|
29 |
|
|
30 |
#method 'html' => positional( |
#method 'html' => positional( |
31 |
# isa => 'Continuity::RequestHolder', |
# isa => 'Continuity::RequestHolder', |
32 |
# required => 1, |
# required => 1, |
47 |
my @w; |
my @w; |
48 |
|
|
49 |
while ( my $u = $s->next ) { |
while ( my $u = $s->next ) { |
50 |
warn "# u = ",dump( $u ); |
my $w = Strix::View::User->new( %{ $u } ); |
51 |
my $w = Strix::View::User->new( |
$w->_fey( $u ); |
52 |
# FIXME this is cludge |
warn "# w = ",dump( $w ) if $self->debug; |
|
unbless( $u ) |
|
|
); |
|
|
warn "# w = ",dump( $w ); |
|
53 |
push @w, $w; |
push @w, $w; |
54 |
} |
} |
55 |
|
|
56 |
while ( 1 ) { |
while ( 1 ) { |
57 |
my $html = join('<hr/>', map { $_->process($f) } @w ); |
|
58 |
$req->print( $html ); |
warn "# got $#w elements: ",dump( map { $_->id } @w ); |
59 |
|
warn "<<< GOT REQUEST ",dump( $f ); |
60 |
|
|
61 |
|
warn "does last element have id? ",dump( $w[$#w]->id ); |
62 |
|
|
63 |
|
if ( $w[ $#w ]->_fey ) { |
64 |
|
warn "+++ added new widget\n"; |
65 |
|
push @w, Strix::View::User->new( render_as => 'edit' ); |
66 |
|
} |
67 |
|
|
68 |
|
my $form = join('<hr/>', map { $_->process($f) || '[deleted]' } @w ); |
69 |
|
my $doc = Continuity::Widget::DomNode->create( |
70 |
|
html => [ |
71 |
|
head => [ |
72 |
|
link => { rel=>"stylesheet", href=>"/static/form.css", type=>"text/css" } |
73 |
|
], |
74 |
|
body => [ |
75 |
|
h1 => [ 'Strix::User' ], |
76 |
|
form => { method=>'post' } => [ |
77 |
|
$form, |
78 |
|
], |
79 |
|
], |
80 |
|
] |
81 |
|
); |
82 |
|
|
83 |
|
$req->print( $doc->to_string ); |
84 |
$req->next; |
$req->next; |
85 |
|
|
86 |
|
$f = { $req->params }; |
87 |
} |
} |
88 |
|
|
89 |
warn "NO WAY OUT!"; |
warn "NO WAY OUT!"; |