Thesauri editor
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 21 Jun 2011 18:08:55 +0000 (14:08 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 11 Jul 2011 17:48:29 +0000 (13:48 -0400)
Open-ILS/web/js/dojo/openils/authority/nls/authority.js
Open-ILS/web/templates/default/cat/authority/control_set.tt2
Open-ILS/web/templates/default/cat/authority/thesaurus.tt2 [new file with mode: 0644]

index f7ea8a0..9fef602 100644 (file)
@@ -17,5 +17,6 @@
     "SAVE_RESULT_SUCCESS": "Record was saved.",
     "MERGE_RESULT_SUCCESS": "Record merge is complete.",
     "THESAURI": "Thesauri (${0})",
-    "AUTHORITY_FIELDS": "Authority Fields (${0})"
+    "AUTHORITY_FIELDS": "Authority Fields (${0})",
+    "CONTROL_SET_METADATA": "(${0}) ${1} / ${2}"
 }
index 095578d..d763b61 100644 (file)
                 acs_cache[id].authority_fields().length : 0;
 
             return "<a href='" + oilsBasePath +
-                "/conify/global/authority/thesaurus?id=" + id + "'>" +
+                "/cat/authority/thesaurus?acs=" + id + "'>" +
                 dojo.string.substitute(localeStrings.THESAURI, [tlen]) +
                 "</a> &nbsp;" + " <a href='" + oilsBasePath +
-                "/conify/global/authority/control_set_authority_field?id=" +
+                "/cat/authority/control_set_authority_field?acs=" +
                 id + "'>" +
                 dojo.string.substitute(localeStrings.AUTHORITY_FIELDS, [alen]) +
                 "</a>";
diff --git a/Open-ILS/web/templates/default/cat/authority/thesaurus.tt2 b/Open-ILS/web/templates/default/cat/authority/thesaurus.tt2
new file mode 100644 (file)
index 0000000..0c62dab
--- /dev/null
@@ -0,0 +1,72 @@
+[% WRAPPER default/base.tt2 %]
+<style type="text/css">
+    .control-set-metadata-holder { text-align: left }
+</style>
+[% ctx.page_title = "Configure Authority Thesauri" %]
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
+        <div>Thesauri</div>
+        <div>
+            <button dojoType="dijit.form.Button" onClick="at_grid.showCreateDialog()">New Thesaurus</button>
+            <button dojoType="dijit.form.Button" onClick="at_grid.deleteSelected()">Delete Selected</button>
+        </div>
+    </div>
+    <div id="control-set-metadata-holder" class="hidden">
+        Showing only thesauri linked to <a href="control_set">control set</a>:
+        <span id="control-set-metadata"></span>
+    </div>
+    <div>
+        <table  jsId="at_grid"
+                dojoType="openils.widget.AutoGrid"
+                autoHeight="true"
+                defaultCellWidth="'auto'"
+                fieldOrder="['code','control_set','name','description']"
+                suppressEditFields="['id']"
+                query="{id: '*'}"
+                fmClass="at"
+                editOnEnter="true">
+        </table>
+    </div>
+</div>
+
+<script type="text/javascript">
+    dojo.require("openils.widget.AutoGrid");
+    dojo.require("openils.CGI");
+    dojo.require("openils.PermaCrud");
+
+    dojo.requireLocalization("openils.authority", "authority");
+    var localeStrings =
+        dojo.i18n.getLocalization("openils.authority", "authority");
+
+    var cgi, pcrud;
+
+    function render_control_set_metadata(control_set) {
+        var span = dojo.byId("control-set-metadata");
+        span.innerHTML = dojo.string.substitute(
+            localeStrings.CONTROL_SET_METADATA, [
+                control_set.id(), control_set.name(), control_set.description()
+            ]
+        );
+        openils.Util.show("control-set-metadata-holder");
+    }
+
+    function my_init() {
+        var control_set;
+        var where = {"code": {"!=": null}};
+
+        cgi = new openils.CGI();
+        pcrud = new openils.PermaCrud();
+
+        control_set = cgi.param("acs");
+        if (control_set) {
+            control_set = pcrud.retrieve("acs", control_set);
+            where.control_set = control_set.id();
+            render_control_set_metadata(control_set);
+        }
+
+        at_grid.loadAll({"order_by": {"at": "code"}}, where);
+    }
+
+    openils.Util.addOnLoad(my_init);
+</script>
+[% END %]