]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/parts/library_name_link_from_ou.tt2
LP1615805 No inputs after submit in patron search (AngularJS)
[Evergreen.git] / Open-ILS / src / templates / opac / parts / library_name_link_from_ou.tt2
1 [%-
2     opac_root = ctx.opac_root;
3     IF ctx.kpac_root;
4         opac_root = ctx.kpac_root;
5     END;
6
7     # Requires a "fleshed_ou" (aou) object defined.
8     # Allow fleshed circ_libs
9     org_id = fleshed_ou.id;
10     org_name = fleshed_ou.name; 
11     org_sname = fleshed_ou.shortname;
12
13     lib_url = ctx.get_org_setting(org_id, 'lib.info_url');
14     prefer_external_url = ctx.get_org_setting(org_id, 'lib.prefer_external_url');
15     UNLESS lib_url && prefer_external_url;
16         lib_url = mkurl(opac_root _ '/library/' _ org_sname, {}, 1);
17     END; 
18     IF lib_url; '<a property="offeredBy" typeof="Library" href="'; lib_url | html; '">'; END;
19     '<span property="name">'; org_name | html; '</span>';
20     IF lib_url; '</a>'; END;
21 -%]
22