From: Tara L Andrews Date: Tue, 28 Aug 2012 12:15:01 +0000 (+0200) Subject: account for as-yet-uncalculated locations in stexaminer X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d35db27a247ec5886061f1c94e3518fdf888d833;p=scpubgit%2Fstemmaweb.git account for as-yet-uncalculated locations in stexaminer --- diff --git a/root/css/stexaminer.css b/root/css/stexaminer.css index a30416a..68a5cc1 100644 --- a/root/css/stexaminer.css +++ b/root/css/stexaminer.css @@ -60,6 +60,9 @@ .coincidental { background: #fff; } +.unsolved { + background: lightgrey; +} .conflict { background: #ff6666; } diff --git a/root/js/stexaminer.js b/root/js/stexaminer.js index b68c3c2..a6797e9 100644 --- a/root/js/stexaminer.js +++ b/root/js/stexaminer.js @@ -62,24 +62,33 @@ function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) { function show_stats( rs ) { var rshtml = $('#stats_template').clone(); rshtml.find('#statrank').append( rs.id ); - $.each( rs.readings, function( idx, rdghash ) { - var rdgstats = $('#reading_template').clone(); - rdgstats.find('.readinglabel').append( rdghash.text ); - rdgstats.find('.reading_copied').append( rdghash.followed ); - rdgstats.find('.reading_changed').append( rdghash.not_followed ); - rdgstats.find('.reading_unclear').append( rdghash.follow_unknown ); - rdgstats.find('.readingroots').append( rdghash.independent_occurrence ); - if( rdghash.is_reverted ) { - rdgstats.find('.reversionroots').append( rdghash.reversions ); - } else { - rdgstats.find('.readingreversions').empty(); - } - rdgstats.find('.reading_statistics').append( - fill_parent_template( rdghash, 'source' ) ); - rdgstats.find('.reading_statistics').append( - fill_parent_template( rdghash, 'reversion' ) ); - rshtml.append( rdgstats.contents() ); - }); + if( "unsolved" in rs ) { + rshtml.find('.solutionstatus').append( + "(Not yet calculated for this location - please try later)"); + } else { + $.each( rs.readings, function( idx, rdghash ) { + var rdgstats = $('#reading_template').clone(); + rdgstats.find('.readinglabel').append( rdghash.text ); + rdgstats.find('.reading_copied').append( rdghash.followed ); + rdgstats.find('.reading_changed').append( rdghash.not_followed ); + rdgstats.find('.reading_unclear').append( rdghash.follow_unknown ); + rdgstats.find('.readingroots').append( rdghash.independent_occurrence ); + if( rdghash.is_reverted ) { + rdgstats.find('.reversionroots').append( rdghash.reversions ); + } else { + rdgstats.find('.readingreversions').empty(); + } + var rdgsourcehtml = fill_parent_template( rdghash, 'source' ); + var rdgreverthtml = fill_parent_template( rdghash, 'reversion' ); + rdgstats.find('.reading_statistics').append( rdgsourcehtml ); + rdgstats.find('.reading_statistics').append( rdgreverthtml ); + // If neither, append a small spacer + if( !rdgsourcehtml && !rdgreverthtml ) { + rdgstats.find('.reading_statistics').append( '
' ); + } + rshtml.append( rdgstats.contents() ); + }); + } $('#row_statistics').empty(); $('#row_statistics').append( rshtml.contents() ); diff --git a/root/src/stexaminer.tt b/root/src/stexaminer.tt index d122ca0..379e9f9 100644 --- a/root/src/stexaminer.tt +++ b/root/src/stexaminer.tt @@ -42,6 +42,7 @@ var graphdot = '[% graphdot %]';

Statistics for readings at :

+
@@ -85,9 +86,10 @@ var graphdot = '[% graphdot %]'; [% BLOCK variantrow -%] -[% SET rowclass = 'class="coincidental"' -%] -[% SET rowclass = 'class="genealogical"' IF row.genealogical -%] - +[% SET rowclass = 'coincidental' -%] +[% SET rowclass = 'genealogical' IF row.genealogical -%] +[% SET rowclass = "$rowclass unsolved" IF row.unsolved -%] + [% row.id %] [% FOREACH reading IN row.readings -%] [% SET cellclass = 'clickable' -%]