--- /dev/null
+[%-
+
+ PROCESS "opac/parts/header.tt2";
+ PROCESS "opac/parts/misc_util.tt2";
+ PROCESS "opac/parts/org_selector.tt2";
+ WRAPPER "opac/parts/base.tt2";
+ INCLUDE "opac/parts/topnav.tt2";
+
+ ctx.page_title = l("Browse Courses");
+ blimit = CGI.param('blimit') || ctx.opac_hits_per_page || 10;
+ display_idx = CGI.param('didx') || ctx.match_idx || 0;
+
+ upper_limit = 0;
+ lower_limit = 0;
+ depart_list = ['blimit', 'bterm', 'bpivot'];
+ ctx.metalinks.push('<meta name="robots" content="noindex,follow">');
+%]
+
+<h2 class="sr-only">[% l('Course Browse') %]</h2>
+
+<div id="content-wrapper" class="my-5">
+ <div class="container mx-auto w-75">
+ <div id="browse-for-courses">
+ <div id="browse-controls" class='row'>
+ <form method="get" onsubmit="$('browse-submit-spinner').className = ''; return true" class="mx-auto">
+ <input type="hidden" name="blimit"
+ value="[% blimit | html %]" />
+ [% control_qtype = INCLUDE "opac/parts/course_search/qtype_selector.tt2"
+ id="browse-search-class" browse_only=1 plural=1 %]
+
+ [% control_bterm = BLOCK %]
+ <input type="text" name="bterm" id="browse-term"
+ aria-label="[% l('Browse term') %]"
+ value="[% CGI.param('bterm') | html %]">
+ [% END; #control_bterm BLOCK %]
+
+ [% control_locg = INCLUDE build_org_selector id='browse-context'
+ show_log_groups=1 arialabel=l('Select owning Library') %]
+
+ [% l('Browse for [_1] starting with [_2] in [_3]',
+ control_qtype, control_bterm, control_locg) %]
+
+ <button id='search-submit-go' type="submit" class="btn btn-confirm my-2"><i class="fas fa-book-reader" aria-hidden="true"></i> [% l('Browse') %]</button>
+ <img id="browse-submit-spinner" class="hidden"
+ style="width: 16px; height: 16px;"
+ alt="[% l('Search in progress icon') %]"
+ src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif[% ctx.cache_key %]" />
+ </form>
+ </div>
+
+ [% BLOCK browse_pager %]
+ [%
+ pivot_lower = CGI.param('didx') - blimit;
+ pivot_higher = CGI.param('didx') + blimit;
+ IF pivot_lower < 0;
+ pivot_lower = 0;
+ END;
+ IF CGI.param('didx') <= 0;
+ lower_limit = 1;
+ ELSE;
+ lower_limit = 0;
+ END;
+
+ IF pivot_higher > ctx.browse_results.size;
+ pivot_higher = ctx.browse_results.size - (blimit + 1);
+ upper_limit = 1;
+ ELSE;
+ upper_limit = 0;
+ END;
+ %]
+ [% IF ctx.browse_results.size >= blimit %]
+ <div class="browse-pager">
+ [% IF lower_limit == 0 %]
+ <a class="opac-button" href="[% mkurl('', {didx => pivot_lower}) %]"
+ onclick="$('browse-pager-spinner-[% id %]').className = '';"
+ >← [%l ('Back') %]</a>
+ [% END %]
+ [% IF upper_limit == 0 %]
+ <a class="opac-button" href="[% mkurl('', {didx => pivot_higher}) %]"
+ onclick="$('browse-pager-spinner-[% id %]').className = '';"
+ >[%l ('Next') %] →</a>
+ [% END %]
+ <img id="browse-pager-spinner-[% id %]"
+ src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif[% ctx.cache_key %]"
+ class="hidden" style="width: 16px; height: 16px;"
+ alt="[% l('Search in progress icon') %]" />
+ </div>
+ [% END %]
+ [% END %]
+
+ [% PROCESS browse_pager id=0 %]
+
+ <div id="browse-results">
+ [% IF ctx.browse_error %]
+ <span class="browse-error">
+ [% l("An error occurred browsing records. " _
+ "Please try again in a moment or report the issue " _
+ "to library staff.") %]
+ </span>
+ [% ELSE %]
+ [% IF ctx.browse_leading_article_warning %]
+ <div class="browse-leading-article-warning">
+ [% l("Your browse term seems to begin with an article (a, an, the). You might get better results by omitting the article.") %]
+ [% IF ctx.browse_leading_article_alternative %]
+ <p>[% alternative_link = BLOCK %]
+ <a href="[% mkurl('', {bterm => ctx.browse_leading_article_alternative}, ['bpivot']) %]">[% ctx.browse_leading_article_alternative | html %]</a>
+ [%- END; # alternative_link BLOCK
+ l("Did you mean [_1]?", alternative_link);
+ END # IF %]
+ </p>
+ </div>
+ [% END # IF browse leading article warning %]
+
+ <ul class="browse-result-list">
+ [% FOR result IN ctx.browse_results %]
+ [% IF result.browse_index >= CGI.param('didx') &&
+ result.browse_index <= (CGI.param('didx') + blimit - 1) %]
+ <li class="browse-result">
+ <span class="browse-result-value[% result.match == 1 ? ' browse-result-best-match' : '' %]">
+ [% IF result.results_count > 0 %]
+ <a href="[% mkurl(ctx.opac_root _ '/course/results', {
+ 'query' => result.value, 'bool' => 'and'}
+ )%]">[% result.value | html %]</a>
+ <span class="browse-result-sources">([%
+ IF result.accurate == 'f';
+ l("At least"); " ";
+ END; #result.accurate IF
+ result.results_count %])</span>
+ [% ELSE %]
+ [% result.value | html %]
+ [% END; #result.sources IF %]
+ </span>
+ </li>
+ [% END %]
+ [% END; #result in browse_results %]
+ </ul>
+ [% END; #browse error ELSE %]
+ </div>
+
+ [% PROCESS browse_pager id=1 %]
+ </div>
+
+ <div class="common-full-pad"></div>
+ </div>
+</div>
+
+[% END %]
--- /dev/null
+[%- PROCESS "opac/parts/header.tt2";
+ WRAPPER "opac/parts/base.tt2";
+ INCLUDE "opac/parts/topnav.tt2";
+ ctx.page_title = l("Course Search");
+
+ PROCESS "opac/parts/misc_util.tt2";
+ PROCESS get_library;
+ ctx.metalinks.push('<meta name="robots" content="noindex,follow">');
+-%]
+
+<h2 class="sr-only">[% l('Course Search') %]</h2>
+
+<div id="content-wrapper">
+ <div id="main-content">
+ <form action="[% ctx.opac_root %]/course/results" method="get">
+ <!-- TODO: Refactor simple.js addSearchRow to better handle
+ tables with IDs that aren't adv_... -->
+ <div class="header_middle" id="adv_search_input">
+ [% l("Course Search Input") %]
+ </div>
+
+ <div id="adv_search_filters" class="adv_filter_block">
+ <div class="adv_filter_block_item">
+ <div>
+ <strong><label for="ord.id">[% l('Search Library') %]</label></strong>
+ </div>
+ <div>
+ [% PROCESS "opac/parts/org_selector.tt2" %]
+ [% INCLUDE build_org_selector show_loc_groups=1 id=org.id %]
+ <span class="course_search_archived">
+ <input type="checkbox" name="modifier" value="include_archived"
+ [% CGI.param('modifier').grep('include_archived').size ? ' checked="checked"' : '' %]
+ id="opac.course_result.include_archived" />
+ <label for="opac.course_result.include_archived">
+ [% l('Include Archived Courses?') %]
+ </label>
+ </span>
+ </div>
+ </div>
+ </div>
+
+ <div class="advanced_div">
+ <div id='adv_global_search' class='data_grid data_grid_center'>
+ <div id='adv_search_rows'>
+ <div class='adv_global_input_container'>
+ <table id="adv_global_input_table" role="presentation">
+ <tbody id='adv_global_tbody'>
+ [% INCLUDE "opac/parts/course_search/global_row.tt2" %]
+ <!-- add a new row -->
+ <tr id="adv_global_addrow">
+ <td class="td-search-left">
+ <a href="javascript:;" id="myopac_new_global_row"
+ onclick='addSearchRow();'>
+ [% l('Add Search Row') %]
+ </a>
+ </td>
+ </tr>
+ <tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ <div id='course_search_submit'>
+ <input type="hidden" name="_course" value="1" />
+ <span>
+ <input id='search-submit-go' type="submit" value="[% l('Search') %]" title="[% l('Search') %]" class="opac-button"
+ onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
+ <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif[% ctx.cache_key %]'
+ class='hidden' alt="[% l('Search in progress icon') %]"/>
+ </span>
+ <a href="[% mkurl(ctx.opac_root _ '/course_search', {$loc_name => loc_value}, 1) %]"
+ class="opac-button">[% l('Clear Form') %]</a>
+ </div>
+ </div>
+ </div>
+ <div class="common-full-pad"></div>
+ </form>
+ </div>
+</div>
+
+[% END %]
[%- END %]
<th scope='col'>[% l("Barcode") %]</th>
<th scope='col'>[% l("Shelving Location") %]</th>
- [%- IF ctx.is_staff %]
+ [%- IF ctx.is_staff || ctx.use_courses %]
<th scope='col'>[% l("Circulation Modifier") %]</th>
+ [%- END %]
+ [%- IF ctx.is_staff %]
<th scope='col'>[% l("Age Hold Protection") %]</th>
<th scope='col'>[% l("Active/Create Date") %]</th>
[%- END %]
[%- END %]
<th scope='col'>[% l("Status") %]</th>
<th scope='col'>[% l("Due Date") %]</th>
+ [%- IF ctx.use_courses %]
+ <th scope='col'>[% l("Courses") %]</th>
+ [%- END %]
</tr>
</thead>
<tbody>
END; -%]
</td>
<td property="availableAtOrFrom">[%- INCLUDE "opac/parts/location_name_link.tt2"; -%]</td>
- [%- IF ctx.is_staff %]
+ [% IF copy_info.courses.size > 0 || ctx.is_staff %]
<td>[% copy_info.circ_modifier | html %]</td>
+ [% ELSIF ctx.use_courses %]
+ <td></td>
+ [% END %]
+ [% IF ctx.is_staff %]
<td>
[% copy_info.age_protect ?
ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
ELSE;
'-';
END %]</td>
+ [%- IF ctx.use_courses %]
+ <td>[%- FOREACH course IN copy_info.courses %]
+ <div>[% course.course_number %]</div>
+ [% END %]</td>
+ [% END %]
</tr>
[% IF copy_info.notes; %]