my $name = $c->request->param('name') || 'Uploaded tradition';
my $lang = $c->request->param( 'language' ) || 'Default';
my $public = $c->request->param( 'public' ) ? 1 : undef;
+ my $direction = $c->request->param('direction') || 'LR';
+
my( $ext ) = $upload->filename =~ /\.(\w+)$/;
my %newopts = (
'name' => $name,
'language' => $lang,
'public' => $public,
- 'file' => $upload->tempname
+ 'file' => $upload->tempname,
+ 'direction' => $direction,
);
my $tradition;
public => $tradition->public || 0,
owner => $tradition->user ? $tradition->user->email : undef,
witnesses => [ map { $_->sigil } $tradition->witnesses ],
+ # TODO Send them all with appropriate parameters so that the
+ # client side can choose what to display.
+ reltypes => [ map { $_->name } grep { !$_->is_weak && $_->is_colocation }
+ $tradition->collation->relationship_types ]
};
## TODO Make these into callbacks in the other controllers maybe?
if( $tradition->can('language') ) {
$c->stash->{'result'} = $stemma->as_svg();
$c->forward('View::SVG');
} else { # JSON
- $c->stash->{'result'} = { _stemma_info( $stemma, $stemmaid ) };
+ $c->stash->{'result'} = _stemma_info( $stemma, $stemmaid );
$c->forward('View::JSON');
}
}