From: Tara L Andrews Date: Wed, 4 Jul 2012 10:28:32 +0000 (+0200) Subject: minor tweaks to display logic X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e41080b62247df50142675a091efb3b369d08f1d;p=scpubgit%2Fstemmatology.git minor tweaks to display logic --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm index d2aa261..e556e32 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm @@ -48,6 +48,11 @@ sub index :Path :Args(1) { foreach my $rhash ( @{$loc->{'readings'}} ) { my $gst = wit_stringify( $rhash->{'group'} ); $rhash->{'group'} = $gst; + my $roots = join( ', ', @{$rhash->{'independent_occurrence'}} ); + $rhash->{'independent_occurrence'} = $roots; + unless( $rhash->{'text'} ) { + $rhash->{'text'} = $rhash->{'readingid'}; + } } } # Values for TT rendering diff --git a/stemmaweb/root/js/stexaminer.js b/stemmaweb/root/js/stexaminer.js index b38d842..2a9e10e 100644 --- a/stemmaweb/root/js/stexaminer.js +++ b/stemmaweb/root/js/stexaminer.js @@ -63,17 +63,12 @@ function show_stats( rs ) { var rshtml = $('#stats_template').clone(); rshtml.find('#statrank').append( rs.id ); $.each( rs.readings, function( idx, rdghash ) { - var readinglabel = rdghash.readingid; - if( rdghash.text ) { - readinglabel = rdghash.text; - } - var readingroots = rdghash.independent_occurrence.join( ', ' ); var rdgstats = $('#reading_template').clone(); - rdgstats.find('.readinglabel').append( readinglabel ); + 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( readingroots ); + rdgstats.find('.readingroots').append( rdghash.independent_occurrence ); if( ! $.isEmptyObject( rdghash.reading_parents ) ) { var parentstats = $('#reading_parent_template').clone(); $.each( rdghash.reading_parents, function( parentid, pdata ) {