KMAIN-403 - Mockups for bib record links in manage authorities
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:07:04 +0000 (17:07 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: eb75b2c

KCLS/openils/var/templates_kcls/cat/authority/list.tt2
KCLS/openils/var/templates_kcls/cat/authority/list_id.tt2
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/Authority.pm
Open-ILS/web/js/ui/kcls/cat/authority/list.js
Open-ILS/web/js/ui/kcls/cat/authority/list_id.js

index b38f10a..1996863 100644 (file)
@@ -8,7 +8,6 @@
     .authEntry > *:first-child { float: left; width: 20%; }
     .authEntry > .text { float: left; width: 48%; }
     .authEntry > .authority-control-set { float: right; width: 16%; ; font-style: italic; }
-    .authEntry > .bibrecord { visibility: hidden }
     .authority-control-set .acs-name { font-weight: bold; }
     .authority-control-set .acs-id { }
 </style>
index cbc81fe..27a6b2f 100644 (file)
@@ -7,7 +7,6 @@
     .authEntry > *:first-child { float: left; width: 20%; }
     .authEntry > .text { float: left; width: 48%; }
     .authEntry > .authority-control-set { float: right; width: 16%; ; font-style: italic; }
-    .authEntry > .bibrecord { visibility: hidden }
     .authority-control-set .acs-name { font-weight: bold; }
     .authority-control-set .acs-id { }
 </style>
index 5252ed9..6a5f36e 100644 (file)
@@ -252,11 +252,12 @@ sub titled_linked_bibs {
        foreach my $bib (@{$response}){
                
                # add to auth's array if it's already there
-               if ($linked_bibs{${$bib}[0]}){
+               if (exists $linked_bibs{${$bib}[0]}){
                        
-                       my %oldAuth = $linked_bibs{${$bib}[0]};
+                       my %oldAuth = %{ $linked_bibs{${$bib}[0]} };
                        
                        $oldAuth{${$bib}[1]} = ${$bib}[2];
+            $linked_bibs{${$bib}[0]} = \%oldAuth;
                }
                
                # otherwise, make a new auth object
index f58b2c4..58556aa 100644 (file)
@@ -102,7 +102,7 @@ function displayAuthorities(data) {
             '<div class="authEntry" id="auth' + auth.id + '">' +
             '<div class="text" id="authLabel' + auth.id + '">' +
             '<span class="text" onclick="toggleBibsForAuthority('+ 
-                                       auth.id + ');">' + auth.text + '</span></div><div class="authority-control-set"><span>ID: ' +
+                                       auth.id + ');">' + auth.text + '</span><div id="auth' + auth.id + 'BibResults" class="forAuth' + auth.id + '" style="background-color:#DDD; padding-left:10px; margin-left:10px; overflow-y: auto; max-height:162px; margin-bottom:20px; display:none;"></div></div><div class="authority-control-set"><span>ID: ' +
             auth.id + '</span></div>' +
             '<div class="authority-control-set">Control Set: <span class="acs-name">' +
             fetch_control_set(auth.thesaurus).name() +
@@ -272,9 +272,9 @@ function getAssociatedBibs(authIds) {
                                        count ++;
                                        
                                        dojo.place('<div class="bibrecord forAuth' + 
-                                       authIds[i] + '"><a href="/eg/opac/record/' + bib + '" target="_blank"> - ' + msg[authIds[i]][bib] + 
+                                       authIds[i] + '" > - <a href="/eg/opac/record/' + bib + '" target="_blank">' + msg[authIds[i]][bib] + 
                                        '</a></div> ', 
-                                       'auth' + authIds[i], 
+                                       'auth' + authIds[i] + 'BibResults'
                                        'last');
                                }
                                
@@ -287,8 +287,7 @@ function getAssociatedBibs(authIds) {
                        
                        else{
                        
-                               dojo.place('<span class="bibcount">0</span> ', 'authLabel' + authIds[i], 'first');
-                               dojo.place('<div class="bibrecord"><span>-</span></div> ', 'auth' + authIds[i], 'last');
+                               dojo.place('<span class="bibcount" style="padding-left: 17px;"> 0 </span> ', 'authLabel' + authIds[i], 'first');
                        }
                }
     }
@@ -304,15 +303,15 @@ function toggleBibsForAuthority(authId){
                
                if (bibs[i] != undefined && bibs[i].style != undefined){
                        
-                       if (bibs[i].style.visibility == "" || bibs[i].style.visibility == "hidden"){
+                       if (bibs[i].style.display == "" || bibs[i].style.display == "none"){
                                
-                               bibs[i].style.visibility = "visible";
+                               bibs[i].style.display = "block";
                                show = true;
                        }
                        
                        else{
                                
-                               bibs[i].style.visibility = "hidden";
+                               bibs[i].style.display = "none";
                                show = false;
                        }
                }
index 6c9ef38..7da461c 100644 (file)
@@ -102,7 +102,7 @@ function displayAuthorities(data) {
             '<div class="authEntry" id="auth' + auth.id + '">' +
             '<div class="text" id="authLabel' + auth.id + '">' +
             '<span class="text" onclick="toggleBibsForAuthority('+
-                               auth.id + ');">' + auth.text + '</span></div><div class="authority-control-set"><span>ID: ' +
+                               auth.id + ');">' + auth.text + '</span><div id="auth' + auth.id + 'BibResults" class="forAuth' + auth.id + '" style="background-color:#EEE; padding-left:10px; margin-left:10px; overflow-y: auto; max-height:400px; margin-bottom:20px; display:none;"></div></div><div class="authority-control-set"><span>ID: ' +
             auth.id + '</span></div>' +
             '<div class="authority-control-set">Control Set: <span class="acs-name">' +
             fetch_control_set(auth.thesaurus).name() +
@@ -266,10 +266,9 @@ function getAssociatedBibs(authIds) {
                                var count = 0;
                                for (var bib in msg[authIds[i]]){
                                        count ++;
-                               dojo.place('<div class="bibrecord forAuth' +
-                                       authIds[i] + '"><a href="/eg/opac/record/' + authIds[i] + '" target="_blank"> - ' + msg[authIds[i]][bib] +
+                               dojo.place('<div class="bibrecord"> - <a href="/eg/opac/record/' + authIds[i] + '" target="_blank">' + msg[authIds[i]][bib] +
                                        '</a></div> ',
-                                       'auth' + authIds[i],
+                                       'auth' + authIds[i] + 'BibResults',
                                        'last');
                                }
                                dojo.place('<span class="bibcount" id="bibcount' + authIds[i] +
@@ -279,8 +278,7 @@ function getAssociatedBibs(authIds) {
                                        'authLabel' + authIds[i], 'first');
                        }
                        else{
-                               dojo.place('<span class="bibcount">0</span> ', 'authLabel' + authIds[i], 'first');
-                               dojo.place('<div class="bibrecord"><span>-</span></div> ', 'auth' + authIds[i], 'last');
+                               dojo.place('<span class="bibcount" style="padding-left: 17px;">0</span> ', 'authLabel' + authIds[i], 'first');
                        }
                }
     }
@@ -292,12 +290,12 @@ function toggleBibsForAuthority(authId){
        var show = true;
        for (var i in bibs){
                if (bibs[i] != undefined && bibs[i].style != undefined){
-                       if (bibs[i].style.visibility == "" || bibs[i].style.visibility == "hidden"){
-                               bibs[i].style.visibility = "visible";
+                       if (bibs[i].style.display == "" || bibs[i].style.display == "none"){
+                               bibs[i].style.display = "block";
                                show = true;
                        }
                        else{
-                               bibs[i].style.visibility = "hidden";
+                               bibs[i].style.display = "none";
                                show = false;
             }
         }