From: Tara L Andrews Date: Fri, 2 Mar 2012 12:37:14 +0000 (+0100) Subject: fix last bugs, make stexaminer work under new regime X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0737e7ddd147f7cc1c9b5ef087ca04dcce238b54;p=scpubgit%2Fstemmaweb.git fix last bugs, make stexaminer work under new regime --- diff --git a/lib/stemmaweb/Controller/Stexaminer.pm b/lib/stemmaweb/Controller/Stexaminer.pm index 46c0359..1449ad2 100644 --- a/lib/stemmaweb/Controller/Stexaminer.pm +++ b/lib/stemmaweb/Controller/Stexaminer.pm @@ -3,7 +3,7 @@ use Moose; use namespace::autoclean; use File::Temp; use JSON; -use Text::Tradition::Analysis qw/ run_analysis /; +use Text::Tradition::Analysis qw/ run_analysis wit_stringify /; BEGIN { extends 'Catalyst::Controller' } @@ -38,6 +38,15 @@ sub index :Path :Args(1) { $c->stash->{template} = 'stexaminer.tt'; # TODO Run the analysis as AJAX from the loaded page. my $t = run_analysis( $tradition ); + # Stringify the reading groups + foreach my $loc ( @{$t->{'variants'}} ) { + my $mst = wit_stringify( $loc->{'missing'} ); + $loc->{'missing'} = $mst; + foreach my $rhash ( @{$loc->{'readings'}} ) { + my $gst = wit_stringify( $rhash->{'group'} ); + $rhash->{'group'} = $gst; + } + } $c->stash->{variants} = $t->{'variants'}; $c->stash->{total} = $t->{'variant_count'}; $c->stash->{genealogical} = $t->{'genealogical_count'}; diff --git a/root/src/stexaminer.tt b/root/src/stexaminer.tt index 2e2ad71..4298e0b 100644 --- a/root/src/stexaminer.tt +++ b/root/src/stexaminer.tt @@ -29,7 +29,7 @@ [% FOREACH reading IN row.readings -%] [% SET cellclass = 'clickable conflict' IF reading.conflict -%] [% SET cellclass = 'clickable' IF !reading.conflict -%] - [% reading.text %] + [% reading.text %] [% END -%] [% FILTER repeat( row.empty ) -%]