From: Sam S. <ssc...@us...> - 2005-05-20 23:06:10
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22831/UI Modified Files: HTML.pm Log Message: Logins now forward to the original page that resulted in the password prompt. XPL reclassification should be nicer, and links directly to a page should work. Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.348 retrieving revision 1.349 diff -C2 -d -r1.348 -r1.349 *** HTML.pm 7 Apr 2005 19:54:49 -0000 1.348 --- HTML.pm 20 May 2005 23:05:58 -0000 1.349 *************** *** 620,626 **** if ( !defined( $session ) ) { ! $session = $self->password_page( $client ); if ( defined( $session ) ) { ! $self->http_redirect_( $client, '/', $session ); } --- 620,628 ---- if ( !defined( $session ) ) { ! my $continue; ! ($session, $continue) = $self->password_page( $client, $url ); ! $continue = '/' unless defined( $continue ); if ( defined( $session ) ) { ! $self->http_redirect_( $client, $continue , $session ); } *************** *** 2233,2236 **** --- 2235,2256 ---- my @corpus_data; + my $total_messages = $self->mcount__( $session ); + if ( $total_messages != 0 ) { + $templ->param( 'Corpus_If_Message_Count' => 1 ); + } + else { + $templ->param( 'Corpus_If_Message_Count' => 0 ); + } + my $total_words = 0; + for my $bucket (@buckets) { + $total_words += $self->classifier_()->get_bucket_word_count( $session, $bucket ); + } + $templ->param( 'Corpus_Word_Count' => $self->pretty_number( $total_words ) ); + if ( $total_words != 0 ) { + $templ->param( 'Corpus_If_Word_Count' => 1 ); + } + else { + $templ->param( 'Corpus_If_Word_Count' => 0 ); + } foreach my $bucket ( @buckets ) { my %row_data; *************** *** 2252,2255 **** --- 2272,2318 ---- $row_data{Localize_Apply} = $self->{language__}{Apply}; $row_data{Corpus_Loop_Loop_Colors} = \@color_data; + my $messages = $self->get_bucket_parameter__( $session, $bucket, 'count' ); + if ( $total_messages != 0 ) { + $row_data{Bucket_Message_Percent} = sprintf( "%.2f", ( 100 * ( $messages / $total_messages ) ) ); + } + else { + $row_data{Bucket_Message_Percent} = " "; + } + my $positives = $self->get_bucket_parameter__($session, $bucket, 'fpcount' ); + $row_data{Bucket_False_Positive} = $self->pretty_number( $positives ); + if ( ( $total_messages - $messages ) == 0 ) { + $row_data{Bucket_Strike_Rate} = "n/a"; + } + else { + $row_data{Bucket_Strike_Rate} = sprintf( "%.2f%%", ( 100 * ( $positives ) / ( $total_messages - $messages ) ) ); + } + my $negatives = $self->get_bucket_parameter__( $session, $bucket, 'fncount' ); + $row_data{Bucket_False_Negative} = $self->pretty_number( $negatives ); + if ( ( $messages + $negatives ) == 0 ) { + $row_data{Bucket_Hit_Rate} = "n/a"; + } + else { + $row_data{Bucket_Hit_Rate} = sprintf( "%.2f%%", ( 100 * ( $messages ) / ( $messages + $negatives ) ) ); + } + my $words = $self->classifier_()->get_bucket_word_count( $session, $bucket ); + $row_data{Bucket_Word_Count} = $self->pretty_number( $words ); + if ( $total_words != 0 ) { + $row_data{Bucket_Word_Percent} = sprintf( "%.2f", ( 100 * ( $words / $total_words ) ) ); + } + else { + $row_data{Bucket_Word_Percent} = " "; + } + if ( $messages != 0 ) { + $row_data{Bar_If_Message_Count} = 1; + } + else { + $row_data{Bar_If_Message_Count} = 0; + } + if ( $words != 0 ) { + $row_data{Bar_If_Word_Count} = 1; + } + else { + $row_data{Bar_If_Word_Count} = 0; + } push ( @corpus_data, \%row_data ); } *************** *** 3271,3274 **** --- 3334,3338 ---- # # $client The web browser to send the results to + # $url The higher level page the password prompt is to be embedded in # # Returns undef if login failed, or a session key value if it succeeded *************** *** 3277,3281 **** sub password_page { ! my ( $self, $client ) = @_; my $session; --- 3341,3345 ---- sub password_page { ! my ( $self, $client, $url ) = @_; my $session; *************** *** 3283,3286 **** --- 3347,3351 ---- $templ->param( 'Header_If_Password' => 1 ); + $templ->param( 'Next_Url' => $url ); if ( exists( $self->{form_}{username} ) && *************** *** 3291,3295 **** if ( defined( $session ) ) { ! return $session; } else { $self->error_message__( $templ, --- 3356,3360 ---- if ( defined( $session ) ) { ! return ($session, $self->{form_}{next}); } else { $self->error_message__( $templ, |