]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/js/ui/default/conify/global/cat/authority/common.js
LP 2061136 follow-up: ng lint --fix
[Evergreen.git] / Open-ILS / web / js / ui / default / conify / global / cat / authority / common.js
1 /* To be used by interfaces for editing child tables of acs. */
2 function render_control_set_metadata(control_set) {
3     var anchor = dojo.byId("control-set-metadata");
4     anchor.href = oilsBasePath +
5         "/conify/global/cat/authority/control_set?focus=" + control_set.id();
6     anchor.innerHTML = dojo.string.substitute(
7         localeStrings.CONTROL_SET_METADATA, [
8             control_set.id(), control_set.name(), control_set.description()
9         ]
10     );
11     openils.Util.show("control-set-metadata-holder");
12 }
13
14 /* To be used by interfaces for editing child tables of acsaf.  They not
15  * only want to know what acsaf they belong to, but for convenience they
16  * should also have handy the acs id to which their parent acsaf belongs,
17  * so they can provide the most helpful "back" link.
18  */
19 function render_authority_field_metadata(authority_field, control_set_id) {
20     var anchor = dojo.byId("authority-field-metadata");
21     var href = oilsBasePath +
22         "/conify/global/cat/authority/control_set_authority_field?focus=" +
23         authority_field.id();
24     if (control_set_id) href += "&acs=" + control_set_id;
25
26     anchor.href = href;
27     anchor.innerHTML = dojo.string.substitute(
28         localeStrings.AUTHORITY_FIELD_METADATA, [
29             "id", "tag", "sf_list", "name", "description"
30         ].map(function(k) {
31             var v = authority_field[k]();
32             return (v == null) ? "" : v;
33         })
34     );
35     openils.Util.show("authority-field-metadata-holder");
36 }