82 |
|
|
83 |
$form = qq|<table>$form</table>| if $layout eq 'table'; |
$form = qq|<table>$form</table>| if $layout eq 'table'; |
84 |
|
|
85 |
|
my $layout_picker = join(' ', |
86 |
|
qq|<div class="layout">layout:|, |
87 |
|
map { |
88 |
|
if ( $layout eq $_ ) { |
89 |
|
qq|<em>$_</em>|; |
90 |
|
} else { |
91 |
|
qq|<a href="?layout=$_">$_</a>|; |
92 |
|
} |
93 |
|
} ( 'div', 'table' ), |
94 |
|
qq|</div>|, |
95 |
|
); |
96 |
|
|
97 |
my $doc = Continuity::Widget::DomNode->create( |
my $doc = Continuity::Widget::DomNode->create( |
98 |
html => [ |
html => [ |
101 |
], |
], |
102 |
body => [ |
body => [ |
103 |
h1 => [ 'Strix::User' ], |
h1 => [ 'Strix::User' ], |
104 |
$layout eq 'table' ? |
$layout_picker, |
|
# gen_link doesn't work since Widngets have it's own scope of layout |
|
|
# gen_link( 'div layout', sub { $layout = 'div' } ) : |
|
|
# gen_link( 'table layout', sub { $layout = 'table' } ), |
|
|
qq|<a href="?layout=div">div layout</a>| : |
|
|
qq|<a href="?layout=table">table layout</a>|, |
|
105 |
form => { method=>'post' } => [ |
form => { method=>'post' } => [ |
106 |
$form, |
$form, |
107 |
], |
], |