From 7f3b2f2f1bf3cd0e49fba51df40d34dcae310625 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 8 Sep 2016 02:18:13 -0400 Subject: [PATCH] Revert to stock TPAC templates where possible Signed-off-by: Dan Scott --- .../opac/parts/advanced/numeric.tt2 | 29 -- Open-ILS/src/templates_conifer/opac/parts/base.tt2 | 42 --- .../opac/parts/qtype_selector.tt2 | 22 -- .../templates_conifer/opac/parts/record/extras.tt2 | 105 ------ .../templates_conifer/opac/parts/result/table.tt2 | 405 --------------------- .../opac/parts/record/copy_counts.tt2 | 50 --- .../opac/parts/record/subjects.tt2 | 86 ----- 7 files changed, 739 deletions(-) delete mode 100644 Open-ILS/src/templates_conifer/opac/parts/advanced/numeric.tt2 delete mode 100644 Open-ILS/src/templates_conifer/opac/parts/base.tt2 delete mode 100644 Open-ILS/src/templates_conifer/opac/parts/qtype_selector.tt2 delete mode 100644 Open-ILS/src/templates_conifer/opac/parts/record/extras.tt2 delete mode 100644 Open-ILS/src/templates_conifer/opac/parts/result/table.tt2 delete mode 100644 Open-ILS/src/templates_laurentian/opac/parts/record/copy_counts.tt2 delete mode 100644 Open-ILS/src/templates_laurentian/opac/parts/record/subjects.tt2 diff --git a/Open-ILS/src/templates_conifer/opac/parts/advanced/numeric.tt2 b/Open-ILS/src/templates_conifer/opac/parts/advanced/numeric.tt2 deleted file mode 100644 index 4644600568..0000000000 --- a/Open-ILS/src/templates_conifer/opac/parts/advanced/numeric.tt2 +++ /dev/null @@ -1,29 +0,0 @@ -
-
[% l("Numeric Search") %]
- - -
- - - - -
- [%- lib_select_id="numeric_search_library" -%] - -
- -
-
diff --git a/Open-ILS/src/templates_conifer/opac/parts/base.tt2 b/Open-ILS/src/templates_conifer/opac/parts/base.tt2 deleted file mode 100644 index b4a83dc190..0000000000 --- a/Open-ILS/src/templates_conifer/opac/parts/base.tt2 +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - [% IF ctx.refresh %] - - [% ELSIF ctx.authtime AND !ctx.is_staff %] - - [% END %] - - - - - [%- libname = ctx.get_aou(ctx.search_ou).name; - libname = libname | html; - libsname = ctx.get_aou(ctx.search_ou).shortname; %] - [% l('[_1] - [_2]', ctx.page_title, libname) %] - - [%-# Hook for page-specific metadata such as %] - [% metalinks; -%] - - [% IF want_dojo %] - - [% END %] - - [% INCLUDE 'opac/parts/goog_analytics.tt2' %] - [% PROCESS 'opac/parts/stripe.tt2' %] - - - [%#Each content page needs (at minimum) an

describing the content%] - [% content %] -

[% l('Additional Resources') %]

- [% INCLUDE 'opac/parts/footer.tt2' %] - [% INCLUDE 'opac/parts/js.tt2' %] - [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %] - [%- INCLUDE 'opac/parts/chilifresh.tt2' %] - [%- END %] - - diff --git a/Open-ILS/src/templates_conifer/opac/parts/qtype_selector.tt2 b/Open-ILS/src/templates_conifer/opac/parts/qtype_selector.tt2 deleted file mode 100644 index 4ed9e63041..0000000000 --- a/Open-ILS/src/templates_conifer/opac/parts/qtype_selector.tt2 +++ /dev/null @@ -1,22 +0,0 @@ -[% query_types = [ - {value => "keyword", label => l("Keyword")}, - {value => "title", label => l("Title"), plural_label => l("Titles"), browse => 1}, - {value => "jtitle", label => l("Journal Title")}, - {value => "author", label => l("Author"), plural_label => l("Authors"), browse => 1}, - {value => "subject", label => l("Subject"), plural_label => l("Subjects"), browse => 1}, - {value => "series", label => l("Series"), plural_label => l("Series"), browse => 1} -] %] - diff --git a/Open-ILS/src/templates_conifer/opac/parts/record/extras.tt2 b/Open-ILS/src/templates_conifer/opac/parts/record/extras.tt2 deleted file mode 100644 index 8a87a3d657..0000000000 --- a/Open-ILS/src/templates_conifer/opac/parts/record/extras.tt2 +++ /dev/null @@ -1,105 +0,0 @@ -[% - arrow_img = ctx.media_prefix _ '/images/rdetail_arrow.png'; - arrow_down_img = ctx.media_prefix _ '/images/rdetail_arrow_down.png'; -%] -
-
- [% - IF ctx.google_books_preview; - label = l('Google Preview'); - name = 'google_preview'; - href = 'javascript:GBDisplayPreview();'; - %] -
-
- -
-
- [% END %] - - [% # Hidden extras are not yet implemented. Some may require JS - - MACRO tab_is_active(tab) BLOCK; - exp_name = 'expand_' _ tab; - IF ctx.$exp_name OR ctx.expand_all; 1; END; - END; - - # Let's see if we should hide the content cafe / simple summary content - hide_summary = 1; - IF attrs.summaries.0; hide_summary = 0; ELSE; - # Expose content cafe if it's reasonable to do so. - # This approach only works when using embedded content cafe. - IF ENV.OILS_CONTENT_CAFE_USER; - ident = attrs.isbn_clean || attrs.upc; - IF ident; hide_summary = 0; END; - END; - END; - - # if no added content is available, hide the main tab. - # if any content is available, use the first tab as the default display tab. - default_ac = ''; - IF !tab_is_active('addedcontent'); - hide_ac = 1; - FOR type IN ctx.added_content.keys; - IF ctx.added_content.$type.status != '2'; # not available - hide_ac = 0; - END; - IF ctx.added_content.$type.status == '1'; - SET default_ac = type UNLESS default_ac; - END; - END; - END; - - extras = [ - {name => 'summaryplus', label => l('Summaries & More'), hide => hide_summary}, - {name => 'annotation', label => l('Annotation'), hide => 1}, - {name => 'awards', label => l('Awards, Reviews, & Suggested Reads'), hide => 1}, - {name => 'excerpt', label => l('Excerpt'), hide => 1}, - {name => 'issues', label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)}, - {name => 'preview', label => l('Preview'), hide => 1}, - {name => 'addedcontent', label => l('Additional Content'), hide => 1}, # hide if all content is known to not exist - {name => 'cnbrowse', label => l('Shelf Browser')}, - {name => 'marchtml', label => l('MARC Record')} - ]; - - FOREACH extra IN extras; - IF extra.hide; NEXT; END; - name = extra.name; - %] -
-
- -
-
- [% IF tab_is_active(name); - IF name == 'marchtml'; - ctx.marchtml; - ELSE; - # Load the template for the selected extra - INCLUDE "opac/parts/record/${name}.tt2"; - END; - END; - %] -
- [% END %] -
-
diff --git a/Open-ILS/src/templates_conifer/opac/parts/result/table.tt2 b/Open-ILS/src/templates_conifer/opac/parts/result/table.tt2 deleted file mode 100644 index b45ea10732..0000000000 --- a/Open-ILS/src/templates_conifer/opac/parts/result/table.tt2 +++ /dev/null @@ -1,405 +0,0 @@ -[% PROCESS "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; - -%] - -[% PROCESS "opac/parts/result/paginate.tt2" %] -[% ctx.results_count_header = PROCESS results_count_header; - ctx.results_count_header %] -[% IF ctx.bookbag %] -
-
[% ctx.bookbag.name | html %]
-
[% ctx.bookbag.description | html %]
-
-[% END %] -
-
-

[% l('Saved Searches') %]

- [% INCLUDE "opac/parts/staff_saved_searches.tt2" %] -

[% l('Search Results facets') %]

- [% INCLUDE 'opac/parts/result/facets.tt2' %] -

[% l('Search Results List') %]

-
-
- - - - - - - - - - [% 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; - # note: rec.id refers to the record identifier, regardless - # of the type of record. i.e. rec.id = mmr_id ? mmr_id : bre_id - IF rec.mmr_id; - IF rec.mr_constituent_count > 1; - # metarecords link to record list page - record_url = mkurl(ctx.opac_root _ '/results', - {metarecord => rec.mmr_id}, ['page']); - ELSE; - # for MR, bre_id refers to the master and in - # this case, only, record - record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id); - END; - hold_type = 'M'; - ELSE; - record_url = mkurl(ctx.opac_root _ '/record/' _ rec.bre_id); - hold_type = 'T'; - END; - -%] - - - - - - - [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %] - - - - - - - [%- END %] - [% END %] - -
[% l('Search result number') %][% l('Book jacket cover art') %][% l('Item details and Actions') %]
[% - result_count; result_count = result_count + 1 - %]. - [% l('Book cover') %]
-
- -
-
-[%- search_ou = ctx.search_ou; - num_holdable_copies = attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size || 0; - IF ctx.place_unfillable || - ( num_holdable_copies > 0 - && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0) - ) -%] - -[%- END -%] -
- [% IF ctx.user; - INCLUDE "opac/parts/bookbag_actions.tt2"; - %] - [% ELSE; - operation = ctx.mylist.grep(rec.id).size ? "delete" : "add"; - label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); - title_label = (operation == "add") ? - l("Add [_1] to my list", attrs.title) : - l("Remove [_1] from my list", attrs.title); - href = mkurl(ctx.opac_root _ '/mylist/' _ operation, - {record => rec.id, anchor => 'record_' _ rec.id}, 1); - %] - - - [% label %] - - [% END %] -
- [% IF ENV.OILS_CONTENT_CAFE_USER %] - [% ident = attrs.isbn_clean || attrs.upc %] - - [% END %] -
-
- -
- - -
- - -
-
-
- - diff --git a/Open-ILS/src/templates_laurentian/opac/parts/record/copy_counts.tt2 b/Open-ILS/src/templates_laurentian/opac/parts/record/copy_counts.tt2 deleted file mode 100644 index eaa08080ea..0000000000 --- a/Open-ILS/src/templates_laurentian/opac/parts/record/copy_counts.tt2 +++ /dev/null @@ -1,50 +0,0 @@ - -

[% l('Available copies') %]

-
    - [%- depths = ctx.copy_summary.size; - depth = 1; - displayed_ous = {}; - WHILE depth < depths; - ou_avail = ctx.copy_summary.$depth.available; - ou_id = ctx.copy_summary.$depth.org_unit; - cp_org_unit = ctx.get_aou(ou_id); - skip_me = !ou_hiding_disabled AND !ctx.org_within_hiding_scope(ou_id); - IF (cp_org_unit.opac_visible == 'f' AND !ctx.is_staff) OR skip_me; - depth = depth + 1; - NEXT; - END; - ou_name = cp_org_unit.name; - displayed_ous.$ou_name = 1; - %] -
  • - [% l('[quant,_1,copy,copies] at [_2].', ou_avail, ou_name) | html %] - [%- this_depth = ctx.get_aou(ou_id).ou_type.depth; - IF ou_avail > 0 && this_depth != ctx.copy_depth %] - - [%- l('(Show)'); %] - [%- END; %] -
  • - [%- depth = depth + 1; - END; - - depth = attrs.plib_copy_counts.size - 1; - ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name; - ou_id = attrs.plib_copy_counts.$depth.org_unit; - UNLESS depth < 0 || displayed_ous.exists(ou_name); - %] - [%- IF attrs.plib_copy_counts.$depth.count > 0; %] -
  • - [%- - l('[_1] of [quant,_2,copy,copies] available at [_3].', - attrs.plib_copy_counts.$depth.available, - attrs.plib_copy_counts.$depth.count, - ou_name) | html - %] [% - l('(Show preferred library)'); - %]
  • - [%- END %] - [%- END %] -
-
diff --git a/Open-ILS/src/templates_laurentian/opac/parts/record/subjects.tt2 b/Open-ILS/src/templates_laurentian/opac/parts/record/subjects.tt2 deleted file mode 100644 index 9ff5a0a03d..0000000000 --- a/Open-ILS/src/templates_laurentian/opac/parts/record/subjects.tt2 +++ /dev/null @@ -1,86 +0,0 @@ -[% - subjects = [ - { - label => l('Subject: '), - xpath => '//*[@tag="600" or @tag="610" or @tag="611" or @tag="630" or @tag="650" or @tag="651"]' - }, { - label => l('Genre: '), - xpath => '//*[@tag="655"]' - }, { - label => l('Topic Heading: '), - xpath => '//*[@tag="690"]' - }, { - label => l('Geographic Setting: '), - xpath => '//*[@tag="691"]' - }, { - label => l('Biographical Subject: '), - xpath => '//*[@tag="692"]' - }, { - label => l('Character Attributes: '), - xpath => '//*[@tag="693"]' - }, { - label => l('Setting: '), - xpath => '//*[@tag="698"]' - }, { - label => l('Time Period: '), - xpath => '//*[@tag="699"]' - } - ]; - - BLOCK render_subject; - xpath = xpath || '//*[starts-with(@tag,"6")]'; - FOR node IN ctx.marc_xml.findnodes(xpath); - ''; - all_terms = []; - graphics = []; - FOR subfield IN node.childNodes; - NEXT UNLESS subfield.nodeName == "subfield"; - code = subfield.getAttribute('code'); - IF code == '6'; - linked_fields = [subfield.textContent()]; - target_field = node.getAttribute('tag'); - get_linked_880s; - END; - NEXT UNLESS code.match('[a-z]'); - IF code.match('[vxyz]'); " > "; END; - # at this point, we actually have a partial term to use. - single_term = subfield.textContent | html; - all_terms.push(subfield.textContent.replace('\-', ' ').replace('[#"^$\+,\.:;&|\[\]()]', '')); - total_term = all_terms.join(" ").replace('\s+$', ''); - %] -[% single_term %] - [%- END; - IF all_terms.size; "
"; END; - FOREACH link880 IN graphics; - '
'; - link880.value | html; - '
'; - END; - '
'; - END; - END -%] - -[% BLOCK render_all_subjects; - FOREACH subj IN subjects; - content = PROCESS render_subject(xpath=subj.xpath); - IF content.match('\S'); -%] - - - - - - - -
[% subj.label %][% content %]
- [%- END; %] - [%- END; %] -[%- END %] - -[%- subject_html = PROCESS render_all_subjects; - IF subject_html.length > 0; -%] - -[%- subject_html %] -[%- END %] -- 2.11.0