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