+sub action_show {
+ my ($self) = @_;
+
+ if ($::request->type eq 'json') {
+ my $part_hash;
+ if (!$self->part) {
+ # TODO error
+ } else {
+ $part_hash = $self->part->as_tree;
+ $part_hash->{cvars} = $self->part->cvar_as_hashref;
+ }
+
+ $self->render(\ SL::JSON::to_json($part_hash), { layout => 0, type => 'json', process => 0 });
+ }
+}
+