]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_summary.xml
Show format icons in results and record detail pages
[working/Evergreen.git] / Open-ILS / web / opac / skin / default / xml / rdetail / rdetail_summary.xml
1
2 <abbr class="unapi-id" title='tag:<!--#echo var="HTTP_HOST"-->,<!--#echo var="OILS_TIME_YEAR"-->:biblio-record_entry/<!--#echo var="OILS_OPAC_RID"-->'></abbr>
3 <!-- This holds the record summary information -->
4 <div>
5         <!-- temporary hack to give IE somewhere to put these things; should just rip out from rdetail.js 
6                 See https://bugs.launchpad.net/evergreen/+bug/532217 -->
7         <span class='hide_me' id='rdetail_title'></span>
8         <table id='rdetail_details_table'>
9                 <tbody id='rdetail_details_tbody'>
10
11                         <tr>
12                                 <td id='rdetail_image_cell' rowspan='30'>
13                                         <a id='rdetail_img_link'>
14                                                 <img style='border: none;' id='rdetail_image' 
15                             onerror='
16                                 hideMe($("rdetail.jacket_attrib_div"));
17                                 hideMe($("rdetail_img_link"));'/>
18                                         </a>
19                     <!-- vendor attribution link -->
20                     <div class='jacket_attrib hide_me' id='rdetail.jacket_attrib_div'>
21                         <div>&opac.image_provided;</div>
22                         <div><a target='_blank' href='&vendor.base_link;' 
23                             class='classic_link' id='rdetail.jacket_attrib_link'>&vendor.name;</a></div>
24                     </div>
25                                 </td>
26                                 <td nowrap='nowrap' class='rdetail_desc'>&common.title;</td>            
27                 <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
28                      *** summary screen with more and/or different information.  In this case, the raw MARC 245. -->
29                 <td type='opac/slot-data' query='datafield[tag="245"]' class='rdetail_item'>
30                     <script type='opac/slot-format'><![CDATA[
31                         var out = '';
32                         var list = dojo.query( 'subfield', item );
33                         for (var i = 0; i < list.length; i++) {
34                             out += BT.textContent(list[i]) + ' ';
35                         }
36                         document.title += ': ' + out;
37                         return out;
38                     ]]></script>
39                 </td>
40                         </tr>
41
42                         <tr>
43                                 <td nowrap='nowrap' class='rdetail_desc'>&common.author;</td>           
44                                 <td class='rdetail_item'>
45                                         <a title='&rdetail.author.search;' id='rdetail_author'> </a>
46                                 </td>
47                         </tr>
48
49                         <tr>
50                                 <td nowrap='nowrap' class='rdetail_desc'>&common.isbn;</td>                     
51                                 <td class='rdetail_item' id='rdetail_isbn'> </td>
52                         </tr>
53
54                         <tr>
55                                 <td nowrap='nowrap' class='rdetail_desc'>&common.edition;</td>          
56                                 <td class='rdetail_item' id='rdetail_edition'> </td>
57                         </tr>
58
59                         <tr>
60                                 <td nowrap='nowrap' class='rdetail_desc'>&common.pubdate;</td>          
61                                 <td class='rdetail_item' id='rdetail_pubdate'> </td>
62                         </tr>
63
64                         <tr>
65                                 <td nowrap='nowrap' class='rdetail_desc'>&common.publisher;</td>                
66                                 <td class='rdetail_item' id='rdetail_publisher'> </td>
67                         </tr>
68
69
70                         <tr>
71                                 <td nowrap='nowrap' class='rdetail_desc'>&common.physical;</td>         
72                                 <td class='rdetail_item' id='rdetail_physical_desc'> </td>
73                         </tr>
74
75                         <tr>
76                                 <td nowrap='nowrap' class='rdetail_desc'>&common.format;</td>                   
77                                 <td class='rdetail_item'>
78                                         <img id='rdetail_tor_pic' class='tor_pic' />
79                                         <span id='rdetail_tor' style='padding-left: 5px;'> </span>
80                                 </td>
81                         </tr>
82
83                         <tr>
84                                 <td nowrap='nowrap' class='rdetail_desc'>&rdetail.detailMain.abstract;</td>     
85                                 <td class='rdetail_item' id='rdetail_abstract'> </td>
86                         </tr>
87
88             <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
89                  *** summary screen with complex information, such as new search links on subjects. -->
90             <tr>
91                 <td nowrap='nowrap' class='rdetail_desc'>&rdetail.summary.subjects;</td>
92                 <td type='opac/slot-data' query='datafield[tag^="6"]' class='rdetail_item'>
93                     <script type='opac/slot-format'><![CDATA[
94                         var cgi = new CGI();
95                         var other_params = [ 'd', 'l', 'r', 'av', 's', 'sd' ];
96                         var total = '';
97                         var output = [];
98                         var list = dojo.query( 'subfield', item );
99                         for (var i = 0; i < list.length; i++) {
100                             var sub_code = list[i].getAttribute('code');
101                             if ( sub_code.match(/[a-z]/i) ) {
102                                 var current = '';
103                                 if ( sub_code.match(/[vxyz]/) ) {
104                                     current += '&#x2d;&#x2d; ';
105                                 }
106                                 total += BT.textContent(list[i]) + ' ';
107                                 current += '<a href="rresult.xml?rt=subject&tp=subject&t=' + total.replace(/\s+$/, '');
108                                 for (var p in other_params) {
109                                     if (cgi.param(other_params[p]))
110                                         current += '&' + other_params[p] + '=' + cgi.param(other_params[p]);
111                                 }
112                                 current += '">' + BT.textContent(list[i]) + '</a>'
113                                 output.push(current);
114                             }
115                         }
116                         return '<span>' + output.join(' ') + '</span><br/>';
117                     ]]></script>
118                 </td>
119             </tr>
120
121                         <tr class='hide_me' id='rdetail_online_row'>
122                                 <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
123                                      *** summary screen with complex information, such as location-specific URIs (856$9). -->
124                                 <td nowrap='nowrap' class='rdetail_desc'>&rdetail.summary.online;
125                                         <span class='hide_me' type='opac/slot-data' query='datafield[tag="856"] subfield[code="9"]'>
126                                                 <script type='opac/slot-format'><![CDATA[
127                                                         // There exists at least one localized URI. Clear all links.
128                                                         dojo.query('*:not([type^="opac"])', 'rdetail_online').orphan();
129                                                         return '';
130                                                 ]]></script>
131                                         </span>
132                                 </td>
133                                 <td class='rdetail_item' id='rdetail_online' type='opac/slot-data' query='volumes volume uris uri' join=", ">
134                                         <script type='opac/slot-format'><![CDATA[
135                                                 var link = '<a href="' + item.getAttribute('href') + '">' + item.getAttribute('label') + '</a>';
136                                                 if (item.getAttribute('use_restriction'))
137                                                         link += ' (Use restriction: ' + item.getAttribute('use_restriction') + ')';
138                                                 return link;
139                                         ]]></script>
140                                 </td>
141                         </tr>
142                         <tr name="serial_holdings_label"
143                                 class="result_table_title_cell hide_me">
144                 <td class="rdetail_desc">&rdetail.summary.issues_held;</td>
145                 <td templated="true" type="opac/slot-data"
146                     query="datafield[tag='901'] subfield[code='c']"
147                     class="rdetail_item">
148                     ${holdingsStatement}
149                                         <span class="hide_me" name="holdingsStatement" type="opac/template-value"><![CDATA[
150                         if (fetchOrgSettingDefault(
151                             getLocation(),
152                             "opac.fully_compressed_serial_holdings"
153                         )) {
154                             var bibid = BT.textContent(item_list[0]);
155                             var blob = fieldmapper.standardRequest(
156                                 ["open-ils.serial",
157                                     "open-ils.serial.bib.summary_statements"],
158                                 [bibid, {
159                                     "orgid": getLocation(), "depth": getDepth()
160                                 }]
161                             );
162
163                             var fake = dojo.create("td");
164                             var something = false;
165
166                             for (var i in blob) {
167                                 if (!blob[i].length) continue;
168                                 if (something) dojo.create("br", null, fake);
169                                 something = true;
170
171                                 var a = dojo.create(
172                                     "a", {
173                                         "innerHTML": "[+]",
174                                         "href": "javascript:void(0);",
175                                         "onclick":
176                                             "rdetailDrawExpandedHoldings(this,"+
177                                             bibid + ",'" + i + "');",
178                                         "style": {"marginRight": "1.5em"}
179                                     }, fake
180                                 );
181                                 dojo.create(
182                                     "span", {
183                                         "innerHTML": blob[i].join(", ")
184                                     }, fake
185                                 );
186                                 dojo.create(
187                                     "span", {"id": "holding_type_" + i}, fake
188                                 );
189                             }
190
191                             if (something)
192                                 unHideMe(slot.parentNode);
193
194                             return fake.innerHTML;
195                         } else {
196                             return "";
197                         }
198                                         ]]></span>
199                                 </td>
200                         </tr>
201
202                 </tbody>
203         </table>
204
205         <!-- Empty span used for creating unAPI links -->
206         <abbr name="unapi" class="unapi-id">
207                 <!-- unAPI URI goes here -->
208         </abbr>
209
210         <script language='javascript' type='text/javascript'><![CDATA[
211
212                 config.ids.rdetail.details_body         = 'rdetail_details_body'; 
213                 config.ids.rdetail.title                                = 'rdetail_title';
214                 config.ids.rdetail.author                               = 'rdetail_author';
215                 config.ids.rdetail.isbn                                 = 'rdetail_isbn';
216                 config.ids.rdetail.edition                              = 'rdetail_edition';
217                 config.ids.rdetail.pubdate                              = 'rdetail_pubdate';
218                 config.ids.rdetail.publisher                    = 'rdetail_publisher';
219                 config.ids.rdetail.tor                                  = 'rdetail_tor';
220                 config.ids.rdetail.abstr                                = 'rdetail_abstract';
221                 config.ids.rdetail.image                                = 'rdetail_image';
222                 config.ids.rdetail.tor_pic                              = 'rdetail_tor_pic';
223
224         dojo.addOnLoad(function() {
225             setTimeout( function () {
226                 var here = findOrgUnit(getLocation());
227                 if (getDepth() > 0 || getDepth === 0 ) {
228                     while (getDepth() < findOrgDepth(here))
229                         here = findOrgUnit( here.parent_ou() );
230                 }
231     
232                 dojo.require('openils.BibTemplate');
233                 new openils.BibTemplate({ record : new CGI().param('r'), org_unit : here.shortname() }).render();
234             }, 0);
235         });
236         ]]></script>
237
238 </div> <!-- details_body -->
239