From: Tara L Andrews Date: Wed, 11 Jul 2012 17:34:03 +0000 (+0200) Subject: add options for stexaminer re-analysis X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e217c221e9686dd0a819bdd72afa4861dfb99236;p=scpubgit%2Fstemmatology.git add options for stexaminer re-analysis --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm index e556e32..e7eee1b 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm @@ -39,8 +39,25 @@ sub index :Path :Args(1) { $c->stash->{graphdot} = $stemma->editable({ linesep => ' ' }); $c->stash->{text_title} = $tradition->name; $c->stash->{template} = 'stexaminer.tt'; + + # Get the analysis options + my( $use_type1, $ignore_sort ) = ( 0, 'none' ); + if( $c->req->method eq 'POST' ) { + $use_type1 = $c->req->param( 'show_type1' ) eq 'on' ? 1 : 0; + $ignore_sort = $c->req->param( 'ignore_variant' ); + } + $c->stash->{'show_type1'} = $use_type1; + $c->stash->{'ignore_variant'} = $ignore_sort; # TODO Run the analysis as AJAX from the loaded page. - my $t = run_analysis( $tradition, 'exclude_type1' => 1 ); + my %analysis_options; + $analysis_options{'exclude_type1'} = !$use_type1; + if( $ignore_sort eq 'spelling' ) { + $analysis_options{'collapse'} = [ qw/ spelling orthographic / ]; + } elsif( $ignore_sort eq 'orthographic' ) { + $analysis_options{'collapse'} = 'orthographic'; + } + + my $t = run_analysis( $tradition, %analysis_options ); # Stringify the reading groups foreach my $loc ( @{$t->{'variants'}} ) { my $mst = wit_stringify( $loc->{'missing'} ); diff --git a/stemmaweb/root/css/stexaminer.css b/stemmaweb/root/css/stexaminer.css index 760fbb2..5bf6401 100644 --- a/stemmaweb/root/css/stexaminer.css +++ b/stemmaweb/root/css/stexaminer.css @@ -1,5 +1,22 @@ +#options { + position: relative; + border: 1px #c6dcf1 solid; + margin-left: 20px; + margin-bottom: 20px; + padding: 10px; + width: 500px; +} +.optionformelement { + float: left; + padding-left: 15px; +} +#options_button { + position: absolute; + bottom: 20px; + right: 20px; +} #variants_table { - float: left; + clear: both; width: 90%; height: 190px; border: 1px #c6dcf1 solid; @@ -84,3 +101,25 @@ .cellb7 { border-right: 20px solid #ffd5e5; } + +/* Clearfix hack to make div container height work */ +.clearfix:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} + +.clearfix { + display: inline-block; +} + +html[xmlns] .clearfix { + display: block; +} + +* html .clearfix { + height: 1%; +} \ No newline at end of file diff --git a/stemmaweb/root/src/stexaminer.tt b/stemmaweb/root/src/stexaminer.tt index 25f1b32..de72766 100644 --- a/stemmaweb/root/src/stexaminer.tt +++ b/stemmaweb/root/src/stexaminer.tt @@ -10,6 +10,22 @@ var graphdot = '[% graphdot %]'; [% END -%]

Stexaminer

[% text_title %]

+
+

Analysis options:

+
+
+ Analyze all variation
+ Ignore orthographic variation
+ Ignore orthographic and spelling variation +
+
+ Include type-1 variation +
+
+ Re-analyze +
+
+
[% FOREACH row IN variants -%]