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