columns => [ 'key', 'value' ],
data => [ map +{ key => $_, value => $data->{$_} }, sort keys %$data ],
}];
+ } elsif (ref($data) eq 'ARRAY') {
+ if (not grep { not ref($_) eq 'HASH' } @$data) {
+ my %key;
+ $key{$_} = 1
+ for map { keys %$_ } @$data;
+ return [{
+ columns => [sort keys %key],
+ show_columns => 1,
+ data => $data,
+ }];
+ }
} elsif (blessed($data) and $data->isa('IO::All::Dir')) {
return [{
columns => [ 'name', 'explore' ],
sub render_el {
my ($self, $whole, $key, $part) = @_;
if (ref($part) eq 'ARRAY') {
+ if ($key eq 'entries') {
+ if (grep { ref($_) eq 'HASH' } @$part) {
+ return $self->link_to($whole->{name}, $key);
+ }
+ }
return join(', ', @$part);
}
if (ref($part) eq 'HASH') {