add conflict styling to analysis table
Tara L Andrews [Tue, 4 Oct 2011 00:19:37 +0000 (02:19 +0200)]
.gitignore
TreeOfTexts/Makefile.PL
TreeOfTexts/root/src/index.tt
lib/Text/Tradition/Analysis.pm

index 00c1605..74e46e6 100644 (file)
@@ -1,2 +1,7 @@
 *~
 tla.bbprojectsettings
+data
+!/t/data
+Makefile
+Makefile.old
+blib
index 038e46b..3fa3531 100644 (file)
@@ -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
index ff2c423..e6e133d 100644 (file)
@@ -29,7 +29,9 @@
         <tr [% rowclass %]>
           <th><span class="rowid">[% row.id %]</span></th>
 [% FOREACH reading IN row.readings -%]
-          <td class="clickable"><span onclick="$('td.active_variant_cell').removeClass('active_variant_cell');$(this).parent().addClass('active_variant_cell');$('tr.active_variant_row').removeClass('active_variant_row');$(this).parents('tr').addClass('active_variant_row');color_nodes($(this).parent().index(), [% reading.group %], [% reading.missing %]);">[% reading.text %]</span></td>
+[% SET cellclass = 'clickable conflict' IF reading.conflict -%]
+[% SET cellclass = 'clickable' IF reading.conflict -%]
+          <td class="[% cellclass %]"><span onclick="$('td.active_variant_cell').removeClass('active_variant_cell');$(this).parent().addClass('active_variant_cell');$('tr.active_variant_row').removeClass('active_variant_row');$(this).parents('tr').addClass('active_variant_row');color_nodes($(this).parent().index(), [% reading.group %], [% reading.missing %]);">[% reading.text %]</span></td>
 [% END -%]
 [% FILTER repeat( row.empty ) -%]
           <td/>
index 7d1c7aa..c74b96d 100644 (file)
@@ -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 ) } );
                }