From: Tara L Andrews Date: Fri, 20 Jan 2012 10:30:03 +0000 (+0100) Subject: start a real index page for traditions X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fb6e49b37b75d81a8a6c7935318a06a5c271b869;p=scpubgit%2Fstemmaweb.git start a real index page for traditions --- diff --git a/lib/stemmaweb/Controller/Root.pm b/lib/stemmaweb/Controller/Root.pm index 9d497c8..16075bd 100644 --- a/lib/stemmaweb/Controller/Root.pm +++ b/lib/stemmaweb/Controller/Root.pm @@ -51,17 +51,31 @@ sub directory :Local :Args(0) { my $user = $c->request->param( 'user' ) || 'ALL'; my @textlist; foreach my $id ( $m->tradition_ids ) { - my $data = { - 'id' => $id, - 'name' => $m->name( $id ), - }; - push( @textlist, $data ); + my $t = $m->info( $id ); + push( @textlist, $t ); } $c->stash->{texts} = \@textlist; $c->stash->{template} = 'directory.tt'; } +=head2 variantgraph + + GET /variantgraph/$textid + +Returns the variant graph for the text specified at $textid, in SVG form. + +=cut + +sub variantgraph :Local :Args(1) { + my( $self, $c, $textid ) = @_; + my $m = $c->model('Directory'); + my $collation = $m->tradition( $textid )->collation; + + $c->stash->{'result'} = $collation->as_svg; + $c->forward('View::SVG'); +} + =head2 alignment GET /alignment/$textid diff --git a/root/css/style.css b/root/css/style.css index 02984af..3a04989 100644 --- a/root/css/style.css +++ b/root/css/style.css @@ -1,4 +1,6 @@