-vhost:
- name: 'Katalog elektronièkih èasopisa'
- description: 'dostupnih u zbirkama nabavljenim za potrebe visoko¹kolskih i znanstvenih ustanova Republike Hrvatske'
+# Encoding of this file must be UTF-8!
+vhost:
databases: 'Zbirke'
no_results: 'nema rezultata'
# - naslov: 'Naslov'
#
# operators:
-# - STRINC: 'Bilo koja rijeè'
-# - STRBW: 'Poèetak naslova'
+# - STRINC: 'Bilo koja riječ'
+# - STRBW: 'Početak naslova'
# - STREQ: 'Cijeli naslov'
#
databases:
ecas:
- name: 'Katalog elektronièkih èasopisa'
- description: 'dostupnih u zbirkama nabavljenim za potrebe visoko¹kolskih i znanstvenih ustanova Republike Hrvatske'
+ name: 'Katalog elektroničkih časopisa'
+ description: 'dostupnih u zbirkama nabavljenim za potrebe visokoškolskih i znanstvenih ustanova Republike Hrvatske'
input:
- name: 'ovid'
module: 'WebPAC::Input::Ovid'
my $entries_per_page = 30;
my $debug = param('debug');
-print header;
+print header(
+ -charset => 'utf-8',
+);
sub dump_yaml {
my $name = shift;
return
$pager->previous_page ? li_a_href( $pager->previous_page, $prev ) : qq|<li class=skip>$prev</li>|
, ( map {
- if ( $_ == $pager->current_page ) {
+ if ( $_ eq $pager->current_page ) {
qq|<li class=current_page>$_</li>|;
} elsif ( $_ eq '' ) {
qq|<li class=skip>...</li>|;
# -linebreak => 0,
),
textfield( -name => 'search' ),
+ popup_menu( -name => 'attr_operator', -values => [ '', 'STRBW', 'STREQ' ],
+ -labels => {
+ '' => 'Bilo koja riječ',
+ 'STRBW' => 'Početak',
+ 'STREQ' => 'Točan oblik',
+ },
+ ),
submit,
- textfield( -name => 'entries_per_page', -default => $entries_per_page ),
- textfield( -name => 'current_page', -default => 1 ),
+ hidden( -name => 'entries_per_page', -default => $entries_per_page ),
+ hidden( -name => 'current_page', -default => 1 ),
+ checkbox( -name => 'debug', -default => 0 ), # FIXME hidden?
;
print end_form;
dump_yaml( 'pager', $pager );
- my $cond = Search::Estraier::Condition->new;
+ my $cond = Search::Estraier::Condition->new( debug => $debug );
$cond->set_phrase( $search );
$cond->set_skip( $pager->skipped );
$cond->set_max( $pager->entries_per_page );
+
+ if ( my $op = param('attr_operator') ) {
+ $cond->add_attr( param('attr') . " $op " . param('search') );
+ }
+
my $nres = $node->search( $cond, 0 );
$pager->total_entries( $nres->hits );
-
dump_yaml( 'cond', $cond );
+ dump_yaml( 'nres', $nres );
if ( ! $nres ) {
my $no_results = "No results for search '%s'";
my $results = "%d results for search '%s' showing results %d - %d on page %d";
printf qq|<div class="message">$results</div>\n\n|, $nres->hits, $search, $pager->first, $pager->last, $pager->current_page;
- dump_yaml( 'pager html', show_pager( $pager ));
-
my $pager_html = join("\n", show_pager( $pager ));
print qq|<ul class="pager">$pager_html</ul>\n\n| if $pager_html;