X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstemmaweb%2FController%2FRoot.pm;h=66a0d92bea1c67cef525c59776a3535145c53baf;hb=7e48fe7e26e40815f826968cf9d6b48f0aa21a1d;hp=c77212269e40a148818483be1b5a78138e96476a;hpb=8e26de0f2079f2b952536a2be1af1ba159eba5c5;p=scpubgit%2Fstemmaweb.git diff --git a/lib/stemmaweb/Controller/Root.pm b/lib/stemmaweb/Controller/Root.pm index c772122..66a0d92 100644 --- a/lib/stemmaweb/Controller/Root.pm +++ b/lib/stemmaweb/Controller/Root.pm @@ -123,12 +123,15 @@ sub newtradition :Local :Args(0) { 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; @@ -317,6 +320,10 @@ sub textinfo :Local :Args(1) { 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') ) { @@ -445,7 +452,7 @@ sub stemma :Local :Args(2) { $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'); } }