From: Bill Erickson Date: Tue, 16 Aug 2011 15:34:11 +0000 (-0400) Subject: Merged esi/template-toolkit-opac and repaired some merge conflicts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4fa33a9e8b20655709bb636c3c1cd22bb6478e41;p=contrib%2FConifer.git Merged esi/template-toolkit-opac and repaired some merge conflicts Note to self: the simple/detail view options on the results page will need some tweaking, particularly since many/most will want to see the detail view by default. Signed-off-by: Bill Erickson --- 4fa33a9e8b20655709bb636c3c1cd22bb6478e41 diff --cc Open-ILS/src/templates/default/opac/parts/coded_value_selector.tt2 index 92a96eea22,0000000000..ad46d794f5 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/coded_value_selector.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/coded_value_selector.tt2 @@@ -1,28 -1,0 +1,28 @@@ + +[%- + # If caller passes a list of possible attribute types, + # search all until we find some values + + IF !attr.size; attr = [attr]; END; + all_values = []; + attr_class = ''; + FOR attr_class IN attr; + all_values = ctx.search_ccvm('ctype', attr_class); + IF all_values.size > 0; LAST; END; + END; + name = name || "fi:" _ attr_class; + id = id || attr_class _ "_selector"; + values = values || CGI.param(name); +-%] + + + diff --cc Open-ILS/src/templates/default/opac/parts/result/table.tt2 index 0d20b9aa12,0000000000..6593342a08 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/result/table.tt2 @@@ -1,275 -1,0 +1,252 @@@ +[% PROCESS "default/opac/parts/misc_util.tt2"; + + USE ResolverResolver; + + 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; +%] + +
- [% BLOCK results_count_header %] -
- - - - - - -
[% l('Search Results') %] - [% |l(ctx.result_start, ctx.result_stop, ctx.hit_count) %] - Results [_1] - [_2] of [_3] - [% END %] - - [% |l(page + 1, page_count) %](page [_1] of [_2])[% END %] - - - - [% class = 'search_page_nav_link'; - href = '#'; - IF page > 0; - href = mkurl('', {page => page - 1}); - ELSE; class = class _ ' invisible'; END; - %] - [% l('Previous') %] - - - - [% class = 'search_page_nav_link'; - href = '#'; - IF (page + 1) < page_count; - href = mkurl('', {page => page + 1}); - ELSE; class = class _ ' invisible'; END; - %] - [% l('Next') %] - -
-
- [% END %] ++ ++[% PROCESS "default/opac/parts/result/paginate.tt2" %] +[% ctx.results_count_header = PROCESS results_count_header; + ctx.results_count_header %] ++ +
+ + + + + + +
+
SIDEBAR TODO +
+
+ + + [% FOR rec IN ctx.records; + attrs = {marc_xml => rec.marc_xml}; + PROCESS get_marc_attrs args=attrs %] + + + + [% END %] + +
+ + + + + + + + + + + + ++ ++ ++ + + + +
[% + result_count; result_count = result_count + 1 + %]. + [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] + [% l('Image of item') %]
+ [% END %] +
+ +
+
+ [% attrs.author | html_entity %] +    + [% attrs.pubdate %] +
+ - [% IF attrs.publisher %] - - - - - [% END %] - [% IF attrs.isbn.0 %] - - ++ - ++ + - [% END %] ++ ++ [% IF CGI.param('detail_record_view') %] ++ ++ ++ [% IF attrs.publisher %] ++ ++ ++ ++ ++ [% END %] ++ [% IF attrs.isbn.0 %] ++ ++ ++ ++ ++ [% END %] + [% IF openurl.enabled == 'true'; + FOR issn IN args.issns; + sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl); + FOR res IN sfx; + %] + + + + + [% END %] + [% END %] + [% END %] + - [% IF attrs.edition %] - - - - - [% END %] - [% IF attrs.phys_desc %] - - - - - [% END %] - [% FOR uri IN args.uris %] - - - - ++ [% IF attrs.edition %] ++ ++ ++ ++ + [% END %] - [% IF args.holdings.size > 0 %] - - - ++ [% IF args.holdings.size > 0 %] ++ ++ ++ + [% END %] ++ [% END %] +
- [% l('Publisher:') %] - [% attrs.publisher; %]
- [% l('ISBN:') %] ++
++ [% l('Call number:') %] + [% attrs.isbns.0 %][% args.holdings.0 %]
++ [% l('Publisher:') %] ++ [% attrs.publisher; %]
++ [% l('ISBN:') %] ++ [% attrs.isbns.0 %]
+ + [% res.public_name %] + [% res.target_coverage %]
- [% l('Edition:') %] - [% attrs.edition %]
- [% l('Phys. Desc.:') %] - - [% args.phys_desc %] -
- [% l('Electronic resource') %] - [% uri.link %][% ' - ' _ uri.note IF uri.note %]
++ [% l('Edition:') %] ++ [% attrs.edition %]
- - - - - - - - - [% FOR copy IN args.holdings %] - - - - - - ++ [% IF attrs.phys_desc %] ++ ++ ++ ++ ++ [% END %] ++ [% FOR uri IN args.uris %] ++ ++ ++ ++ + [% END %] - -
[% l('Library') %][% l('Shelving location') %][% l('Call number') %][% l('Status') %]
[% copy.library %][% copy.location %][% copy.label %][% copy.status %]
++ [% l('Phys. Desc.:') %] ++ ++ [% args.phys_desc %] ++
++ [% l('Electronic resource') %] ++ [% uri.link %][% ' - ' _ uri.note IF uri.note %]
-
++ ++ ++ ++ ++ ++ ++ ++ ++ [% FOR copy IN args.holdings %] ++ ++ ++ ++ ++ ++ ++ [% END %] ++ ++
[% l('Library') %][% l('Shelving location') %][% l('Call number') %][% l('Status') %]
[% copy.library %][% copy.location %][% copy.label %][% copy.status %]
++
+
+ [% l('[_1] of [quant,_2,copy,copies] available', + attrs.copy_counts.available, attrs.copy_counts.count) # XXX s/count/nshadow/ ? + #rec.copy_counts.available, rec.copy_counts.visible) + %] +
+
+
+ + + | + | + + + +
+
+ + [% IF attrs.format_icon %] + [% attrs.format_label %] + [% END %] + + + + + + + [% l("Browse in Google Books Search") %] + + + +
+
+ +
+ [% + operation = ctx.mylist.grep(rec.id).size ? "delete" : "add"; + label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); + %] + + + [% label %] + +
+
+
+
- - ++ +
++
++ + +
+
+
+
+
+ [% ctx.results_count_header %] +
diff --cc Open-ILS/src/templates/default/opac/parts/searchbar.tt2 index 116387f505,0000000000..047b3f5f4f mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/searchbar.tt2 @@@ -1,78 -1,0 +1,78 @@@ +[% PROCESS "default/opac/parts/org_selector.tt2" %] + diff --cc Open-ILS/src/templates/default/opac/results.tt2 index 9b2d2427d1,0000000000..5c0a620d52 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/results.tt2 +++ b/Open-ILS/src/templates/default/opac/results.tt2 @@@ -1,79 -1,0 +1,82 @@@ +[% PROCESS "default/opac/parts/header.tt2"; + USE POSIX; + + WRAPPER "default/opac/parts/base.tt2"; + INCLUDE "default/opac/parts/topnav.tt2"; + + IF is_advanced || is_special; + ctx.page_title = l("Search Results"); + ELSE; + ctx.page_title = l("Search Results: ") _ CGI.param('query') | html_entity; + END; + + page = CGI.param('page') || 0; + page_count = ctx.page_size == 0 ? 1 : POSIX.ceil(ctx.hit_count / ctx.page_size); +%] +
+
+ [% INCLUDE "default/opac/parts/printnav.tt2" %] + [% INCLUDE "default/opac/parts/searchbar.tt2" took_care_of_form=1 %] +
+
+
+
+
+ [% l('Another Search') %] +
+
+ [% l('Advanced Search') %] +
+ [% IF ctx.mylist.size %] +
+ View My List +
+ [% END %] +
+ [% UNLESS is_advanced || is_special %] +
Sort by
+ [% INCLUDE "default/opac/parts/filtersort.tt2" value=CGI.param('sort') %] +
- - ++ ++ ++
++ ++ ++ + + [% END %] +
+
+
+
+
+
+
+
+ [% path = "default/opac/parts/result/" _ + (ctx.records.size ? "table.tt2" : "lowhits.tt2"); + INCLUDE $path %] +
+
+
+
+[% END %]