X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=stemmaweb%2Flib%2Fstemmaweb%2FController%2FRelation.pm;h=832a447862d5e232c7bdb51768e34df961147a8d;hb=31aaf446ae4de055a10acd20946d3449de7c5718;hp=54830aca09e3c2a4327ef92936dd8938df98b316;hpb=fe1854bed1c88e77d13c96313986cef065bbe76f;p=scpubgit%2Fstemmatology.git diff --git a/stemmaweb/lib/stemmaweb/Controller/Relation.pm b/stemmaweb/lib/stemmaweb/Controller/Relation.pm index 54830ac..832a447 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Relation.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Relation.pm @@ -97,9 +97,10 @@ sub relationships :Chained('text') :PathPart :Args(0) { my @all_relations; foreach my $p ( @pairs ) { my $relobj = $collation->relations->get_relationship( @$p ); - push( @all_relations, - { source => $p->[0], target => $p->[1], - type => $relobj->type, scope => $relobj->scope } ); + my $relhash = { source => $p->[0], target => $p->[1], + type => $relobj->type, scope => $relobj->scope }; + $relhash->{'note'} = $relobj->annotation if $relobj->has_annotation; + push( @all_relations, $relhash ); } $c->stash->{'result'} = \@all_relations; } elsif( $c->request->method eq 'POST' ) { @@ -110,8 +111,8 @@ sub relationships :Chained('text') :PathPart :Args(0) { my $scope = $c->request->param('scope'); my $opts = { 'type' => $relation, - 'scope' => $scope, - 'annotation' => $note }; + 'scope' => $scope }; + $opts->{'annotation'} = $note if $note; try { my @vectors = $collation->add_relationship( $node, $target, $opts );