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' }
$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'};
[% FOREACH reading IN row.readings -%]
[% SET cellclass = 'clickable conflict' IF reading.conflict -%]
[% SET cellclass = 'clickable' IF !reading.conflict -%]
- <td class="[% cellclass %]"><span onclick="color_nodes($(this).parent().index(), [% reading.group %], [% reading.missing %]);$(this).parents('tr').addClass('active_variant_row');$(this).parent().addClass('active_variant_cell cellb'+($(this).parent().index()-1))">[% reading.text %]</span></td>
+ <td class="[% cellclass %]"><span onclick="color_nodes($(this).parent().index(), [% reading.group %], [% row.missing %]);$(this).parents('tr').addClass('active_variant_row');$(this).parent().addClass('active_variant_cell cellb'+($(this).parent().index()-1))">[% reading.text %]</span></td>
[% END -%]
[% FILTER repeat( row.empty ) -%]
<td/>