]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/contents.tt2
lp1481844 Change Available Copies Display
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / record / contents.tt2
1 [%-
2 contents =  [
3     {
4         label => l('General Note: '),
5         xpath => '//*[@tag="500"]'
6     }, {
7         label => l('With Note: '),
8         xpath => '//*[@tag="501"]'
9     }, {
10         label => l('Dissertation Note: '),
11         xpath => '//*[@tag="502"]'
12     }, {
13         label => l('Bibliography, etc. Note: '),
14         xpath => '//*[@tag="504"]'
15     }, {
16         label => l('Formatted Contents Note: '),
17         xpath => '//*[@tag="505"]'
18     }, {
19         label => l('Restrictions on Access Note: '),
20         xpath => '//*[@tag="506"]'
21     }, {
22         label => l('Scale Note for Graphic Material: '),
23         xpath => '//*[@tag="507"]'
24     }, {
25         label => l('Creation/Production Credits Note: '),
26         xpath => '//*[@tag="508"]'
27     }, {
28         label => l('Citation/References Note: '),
29         xpath => '//*[@tag="510"]'
30     }, {
31         label => l('Participant or Performer Note: '),
32         xpath => '//*[@tag="511"]'
33     }, {
34         label => l('Type of Report and Period Covered Note: '),
35         xpath => '//*[@tag="513"]'
36     }, {
37         label => l('Data Quality Note: '),
38         xpath => '//*[@tag="514"]'
39     }, {
40         label => l('Numbering Peculiarities Note: '),
41         xpath => '//*[@tag="515"]'
42     }, {
43         label => l('Type of Computer File or Data Note: '),
44         xpath => '//*[@tag="516"]'
45     }, {
46         label => l('Date/Time and Place of an Event Note: '),
47         xpath => '//*[@tag="518"]'
48     }, {
49         label => l('Summary, etc.: '),
50         xpath => '//*[@tag="520"]'
51     }, {
52         label => l('Target Audience Note: '),
53         xpath => '//*[@tag="521"]'
54     }, {
55         label => l('Geographic Coverage Note: '),
56         xpath => '//*[@tag="522"]'
57     }, {
58         label => l('Preferred Citation of Described Materials Note: '),
59         xpath => '//*[@tag="524"]'
60     }, {
61         label => l('Supplement Note: '),
62         xpath => '//*[@tag="525"]'
63     }, {
64         label => l('Study Program Information Note: '),
65         xpath => '//*[@tag="526"]'
66     }, {
67         label => l('Additional Physical Form available Note: '),
68         xpath => '//*[@tag="530"]'
69     }, {
70         label => l('Reproduction Note: '),
71         xpath => '//*[@tag="533"]'
72     }, {
73         label => l('Original Version Note: '),
74         xpath => '//*[@tag="534"]'
75     }, {
76         label => l('Location of Originals/Duplicates Note: '),
77         xpath => '//*[@tag="535"]'
78     }, {
79         label => l('Funding Information Note: '),
80         xpath => '//*[@tag="536"]'
81     }, {
82         label => l('System Details Note: '),
83         xpath => '//*[@tag="538"]'
84     }, {
85         label => l('Terms Governing Use and Reproduction Note: '),
86         xpath => '//*[@tag="540"]'
87     }, {
88         label => l('Immediate Source of Acquisition Note: '),
89         xpath => '//*[@tag="541"]'
90     }, {
91         label => l('Information Relating to Copyright Status: '),
92         xpath => '//*[@tag="542"]'
93     }, {
94         label => l('Location of Other Archival Materials Note: '),
95         xpath => '//*[@tag="544"]'
96     }, {
97         label => l('Biographical or Historical Data: '),
98         xpath => '//*[@tag="545"]'
99     }, {
100         label => l('Language Note: '),
101         xpath => '//*[@tag="546"]'
102     }, {
103         label => l('Former Title Complexity Note: '),
104         xpath => '//*[@tag="547"]'
105     }, {
106         label => l('Issuing Body Note: '),
107         xpath => '//*[@tag="550"]'
108     }, {
109         label => l('Entity and Attribute Information Note: '),
110         xpath => '//*[@tag="552"]'
111     }, {
112         label => l('Cumulative Index/Finding Aids Note: '),
113         xpath => '//*[@tag="555"]'
114     }, {
115         label => l('Information About Documentation Note: '),
116         xpath => '//*[@tag="556"]'
117     }, {
118         label => l('Ownership and Custodial History: '),
119         xpath => '//*[@tag="561"]'
120     }, {
121         label => l('Copy and Version Identification Note: '),
122         xpath => '//*[@tag="562"]'
123     }, {
124         label => l('Binding Information: '),
125         xpath => '//*[@tag="563"]'
126     }, {
127         label => l('Case File Characteristics Note: '),
128         xpath => '//*[@tag="565"]'
129     }, {
130         label => l('Methodology Note: '),
131         xpath => '//*[@tag="567"]'
132     }, {
133         label => l('Linking Entry Complexity Note: '),
134         xpath => '//*[@tag="580"]'
135     }, {
136         label => l('Publications About Described Materials Note: '),
137         xpath => '//*[@tag="581"]'
138     }, {
139         label => l('Action Note: '),
140         xpath => '//*[@tag="583"]'
141     }, {
142         label => l('Accumulation and Frequency of Use Note: '),
143         xpath => '//*[@tag="584"]'
144     }, {
145         label => l('Exhibitions Note: '),
146         xpath => '//*[@tag="585"]'
147     }, {
148         label => l('Awards Note: '),
149         xpath => '//*[@tag="586"]'
150     }, {
151         label => l('Source of Description Note: '),
152         xpath => '//*[@tag="588"]'
153     } 
154 ];
155
156 BLOCK render_contents;
157     xpath = xpath || '//*[starts-with(@tag,"5")]';
158     FOR node IN ctx.marc_xml.findnodes(xpath);
159         all_content = [];
160         graphics = [];
161         FOR subfield IN node.childNodes;
162             NEXT UNLESS subfield.nodeName == "subfield";
163             code = subfield.getAttribute('code');
164             IF code == '6';
165                linked_fields = [subfield.textContent()];
166                target_field = node.getAttribute('tag');
167                get_linked_880s;
168             END;
169             NEXT UNLESS code.match('[a-z]');
170             all_content.push(subfield.textContent);
171         END;
172         total_contents = all_content.join(" ").replace('\s+$', '');
173         %] [% total_contents;
174         IF total_contents.size; "<br/>"; END;
175         FOREACH link880 IN graphics;
176             '<div class="graphic880"' _ link880.dir _ '>';
177             link880.value | html;
178             '</div>';
179         END;
180     END;
181 END 
182 %]
183 [%  BLOCK render_all_contents;
184     FOREACH cont IN contents;
185         content = PROCESS render_contents(xpath=cont.xpath);
186         IF content.match('\S');
187 -%]
188 <tr>
189     <td class='rdetail_content_type'>[% cont.label %]</td>
190     <td class='rdetail_content_value' property='keywords'>[% content %]</td>
191 </tr>
192         [%- END; %]
193     [%- END; %]
194 [%- END %]
195
196 [%-  content_html = PROCESS render_all_contents;
197     IF content_html.length > 0;
198 %]
199 <h2 class='rdetail_contents'>[% l('Content descriptions') %]</h2>
200 <table class='rdetail_content'>
201     <tbody>
202 [%- content_html %]
203     </tbody>
204 </table>
205 [%- END %]