From: Tara L Andrews Date: Tue, 4 Oct 2011 00:19:37 +0000 (+0200) Subject: add conflict styling to analysis table X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c52877edc72b6e277432b2c5bed47569a626b79;hp=f978c1b93616afa8b7de522c4b527336cc5d1358;p=scpubgit%2Fstemmatology.git add conflict styling to analysis table --- diff --git a/.gitignore b/.gitignore index 00c1605..74e46e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ *~ tla.bbprojectsettings +data +!/t/data +Makefile +Makefile.old +blib diff --git a/TreeOfTexts/Makefile.PL b/TreeOfTexts/Makefile.PL index 038e46b..3fa3531 100644 --- a/TreeOfTexts/Makefile.PL +++ b/TreeOfTexts/Makefile.PL @@ -12,7 +12,9 @@ all_from 'lib/TreeOfTexts.pm'; requires 'Catalyst::Runtime' => '5.90002'; requires 'Catalyst::Plugin::ConfigLoader'; requires 'Catalyst::Plugin::Static::Simple'; +requires 'Catalyst::Plugin::Unicode::Encoding'; requires 'Catalyst::Action::RenderView'; +requires 'Catalyst::Model::Adaptor'; requires 'Moose'; requires 'namespace::autoclean'; requires 'Config::General'; # This should reflect the config file format you've chosen diff --git a/TreeOfTexts/root/src/index.tt b/TreeOfTexts/root/src/index.tt index ff2c423..e6e133d 100644 --- a/TreeOfTexts/root/src/index.tt +++ b/TreeOfTexts/root/src/index.tt @@ -29,7 +29,9 @@ [% row.id %] [% FOREACH reading IN row.readings -%] - [% reading.text %] +[% SET cellclass = 'clickable conflict' IF reading.conflict -%] +[% SET cellclass = 'clickable' IF reading.conflict -%] + [% reading.text %] [% END -%] [% FILTER repeat( row.empty ) -%] diff --git a/lib/Text/Tradition/Analysis.pm b/lib/Text/Tradition/Analysis.pm index 7d1c7aa..c74b96d 100644 --- a/lib/Text/Tradition/Analysis.pm +++ b/lib/Text/Tradition/Analysis.pm @@ -104,12 +104,14 @@ sub run_analysis { # For all the groups with more than one member, collect the list of all # contiguous vertices needed to connect them. # TODO: deal with a.c. reading logic - my $sc = analyze_variant_location( $group_readings, $groups, $stemma->apsp ); - $variant_row->{'genealogical'} = keys %$sc ? 1 : undef; + my $conflict = analyze_variant_location( + $group_readings, $groups, $stemma->apsp ); + $variant_row->{'genealogical'} = keys %$conflict ? undef : 1; foreach my $grp ( sort keys %$group_readings ) { my $rdg = $group_readings->{$grp}; + my $in_conflict = exists $conflict->{$grp}; push( @{$variant_row->{'readings'}}, - { 'text' => $rdg, 'group' => $grp, + { 'text' => $rdg, 'group' => $grp, 'conflict' => $in_conflict, 'missing' => wit_stringify( $lacunose ) } ); }