--- /dev/null
+package OpenILS::WWW::Beanstalk;
+use base q/OpenILS::WWW::EGCatLoader/;
+use strict; use warnings;
+use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERROR REDIRECT HTTP_BAD_REQUEST);
+
+
+sub load {
+ my $self = shift;
+
+ $self->init_ro_object_cache;
+ my $stat = $self->load_common;
+ return $stat unless $stat == Apache2::Const::OK;
+
+ $self->ctx->{opac_root} =~ s/opac/beanstalk/g;
+
+ my $path = $self->apache->path_info;
+
+ return $self->load_simple("home") if $path =~ m|beanstalk/home|;
+ return $self->load_rresults if $path =~ m|beanstalk/results|;
+
+ return Apache2::Const::OK;
+}
+
+1;
+
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns='http://www.w3.org/1999/xhtml' lang='[% ctx.locale %]' xml:lang='[% ctx.locale %]'>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ [% IF ctx.refresh %]
+ <meta http-equiv="refresh" content="[% ctx.refresh %]">
+ [% ELSIF ctx.authtime %]
+ <meta http-equiv="refresh" content="[% ctx.authtime %]; url=[% ctx.logout_page %]">
+ [% END %]
+ <title>[% l('Catalog - [_1]', ctx.page_title) %]</title>
+ </head>
+ <body>
+ [% content %]
+ </body>
+</html>
--- /dev/null
+[%
+ PROCESS 'opac/parts/header.tt2';
+ WRAPPER 'beanstalk/base.tt2';
+ PROCESS 'opac/parts/org_selector.tt2'
+%]
+<form action="[% ctx.opac_root %]/results" method="GET">
+ <div><img src='[% ctx.media_prefix %]/images/eg_tiny_logo.jpg'/></div>
+ <div>[% l('Search the Catalog') %]</div>
+ <div>
+ <input type="text" id="search_box" name="query"
+ value="[% CGI.param('query') | html %]"
+ autofocus x-webkit-speech />
+ </div>
+ <div>[% INCLUDE "opac/parts/qtype_selector.tt2" id="qtype" %]</div>
+ <div>[% INCLUDE build_org_selector show_loc_groups=1 %]</div>
+ </div>
+ <div><input type="submit" value="[% l('Search') %]" alt="[% l('Search') %]"/></div>
+</form>
+[% END %]
--- /dev/null
+[% PROCESS "opac/parts/header.tt2";
+ WRAPPER "beanstalk/base.tt2";
+ PROCESS "opac/parts/misc_util.tt2";
+
+ ctx.page_title = l("Search Results: ") _ CGI.param('query') | html;
+ page = CGI.param('page');
+ page = page.match('^\d+$') ? page : 0; # verify page is a sane value
+
+ page_count = ctx.page_size == 0 ? 1 : POSIX.ceil(ctx.hit_count / ctx.page_size);
+ ctx.result_start = 1 + ctx.page_size * page;
+ ctx.result_stop = ctx.page_size * (page + 1);
+ IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
+ result_count = ctx.result_start;
+
+%]
+
+<table>
+ [% FOR rec IN ctx.records;
+ attrs = {marc_xml => rec.marc_xml};
+ PROCESS get_marc_attrs args=attrs;
+ IF CGI.param('detail_record_view');
+ attrs.title = attrs.title_extended;
+ END
+ -%]
+ <tr class="result_table_row">
+ <td>
+ <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
+ [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]
+ >[% attrs.title | html %]</a>
+ </td>
+ </tr>
+[% END %]
+</table>
+
+[% END %]