more web work
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 8 Aug 2005 17:10:54 +0000 (17:10 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 8 Aug 2005 17:10:54 +0000 (17:10 +0000)
changed subject handling in ModsParser so subjects are now layed out as
a hash of key=subject, val=subject_count

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1626 dcc99617-32d9-48b4-a31d-7c20da2025e4

12 files changed:
Open-ILS/css/opac/opac.css
Open-ILS/src/javascript/lib/js/opac/config.js
Open-ILS/src/javascript/lib/js/opac/opac_utils.js
Open-ILS/src/javascript/lib/js/opac/result_common.js
Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm
Open-ILS/src/webxml/advanced.xml
Open-ILS/src/webxml/altcanvas.xml
Open-ILS/src/webxml/js_common.xml
Open-ILS/src/webxml/mresult.xml
Open-ILS/src/webxml/rdetail.xml [new file with mode: 0644]
Open-ILS/src/webxml/rresult.xml
Open-ILS/src/webxml/sidebar.xml

index b9982c7..238ca4a 100644 (file)
@@ -14,17 +14,10 @@ body table          { font-size: inherit; }
 
 /* Our color scheme */
 
-/*
-.color_1 { background: #FFE6D4; color: #000000; }
-.color_2 { background: #FFCDAA; color: #000000; }
-.color_3 { background: #FFE6D4; color: #000000; }
-*/
-
 .color_1 { background: #A7EA9D; color: #000000; }
 .color_2 { background: #64EA4F; color: #000000; }
 .color_3 { background: #D8B4BE; color: #000000; }
 
-
 /* ---------------------------------------------------------------------- */
 .canvas { float:right; width: 80%; text-align: left;}
 #loading_div { width: 100%;}
@@ -34,10 +27,14 @@ body table          { font-size: inherit; }
 .org_tree { height: 500px; padding-left: 2px; padding-right: 2px;
                                   overflow:-moz-scrollbars-vertical; overflow-y:scroll; overflow-x:hidden; }            
 
+.org_link { font-size: 92%; padding-right: 15px; }
+#org_link_container { margin-bottom: 5px; padding-left: 4px; padding-bottom: 3px; padding-top: 3px; width 100%; }
+
 /* ---------------------------------------------------------------------- */
 .sidebar_div { float: left; width: 19%; }
 .side_bar_item { padding-left: 15px; padding-right: 10px; padding-top: 5px; padding-bottom: 5px; }
 .sidebar_chunk {border-right: 1px solid lightgrey;}
+.sidebar_extra_item { font-size: 90%; padding: 3px; }
 
 /* ---------------------------------------------------------------------- */
 #searchbar { position: absolute; text-align: right; top: 2px; right: 3px; }
@@ -49,8 +46,6 @@ body table            { font-size: inherit; }
 .searchbar_tag { font-size: 90%; text-align: right;  
        padding-left: 5px; padding-right: 5px; padding-bottom: 3px; } 
 
-/*background: #68CE76; */
-
 #searchbar_main { text-align: right; 
        padding-top: 2px; padding-bottom: 3px; padding-right: 2px; padding-left: 3px; }
 
@@ -58,12 +53,10 @@ body table          { font-size: inherit; }
 #searchbar_table { border-collapse: collapse; }
 
 /* ---------------------------------------------------------------------- */
-
 #login_box { border-top: 1px solid #808080; 
        border-bottom: 1px solid #808080; width: 60%; padding: 5px;}
 
 .login_text { margin-left: 8px; }
-/*.login_links_div { padding-left: 30px; }*/
 
 /* ---------------------------------------------------------------------- */
 #result_table_div { text-align: left; width: 100%; }
@@ -95,7 +88,7 @@ body table            { font-size: inherit; }
 .result_table_subtbody { height: 100%; width: 100%; }
 .result_table_title_cell { text-align: left; }
 
-.copy_count_cell { font-size: 75%; width: 8%; text-align: center; padding: 0px; margin: 0px;}
+.copy_count_cell { font-size: 80%; width: 8%; text-align: center; padding: 0px; margin: 0px;}
 .copy_count_cell_even { border: 1px solid #E0E0E0; }
 
 .search_page_nav_link { margin-right: 5px; }
index c9a08d4..0366b2b 100644 (file)
@@ -159,6 +159,7 @@ config.ids.searchbar.location_tag   = 'search_location_tag_link';
 /*  sidebar */
 config.ids.sidebar = {};
 config.css.sidebar = {};
+config.names.sidebar = {};
 config.css.sidebar.item = {};
 config.ids.sidebar.home                                = 'home_link_div';
 config.ids.sidebar.advanced            = 'advanced_link_div';
@@ -172,6 +173,9 @@ config.ids.sidebar.logoutbox                = 'logout_link_div';
 config.ids.sidebar.loginbox            = 'login_link_div';
 config.ids.sidebar.logged_in_as        = 'logged_in_as_div';
 config.ids.sidebar.username_dest       = 'username_dest';
+config.ids.sidebar.subject                     = 'subject_sidebar';
+
+config.names.sidebar.subject           = "subject_item";
 
 
 
index 2fdbde1..ec796e2 100644 (file)
@@ -139,11 +139,8 @@ function cleanISBN(isbn) {
 /* ----------------------------------------------------------------------- */
 /* builds a link that goes to the title listings for a metarecord */
 function buildTitleLink(rec, link) {
-
-       var t = rec.title(); 
-       t = normalize(truncate(t, 65));
-       link.appendChild(text(t));
-
+       if(!rec) return;
+       link.appendChild(text(normalize(truncate(rec.title(), 65))));
        var args = {};
        args.page = RRESULT;
        args[PARAM_OFFSET] = 0;
@@ -152,11 +149,8 @@ function buildTitleLink(rec, link) {
 }
 
 function buildTitleDetailLink(rec, link) {
-
-       var t = rec.title(); 
-       t = normalize(truncate(t, 65));
-       link.appendChild(text(t));
-
+       if(!rec) return;
+       link.appendChild(text(normalize(truncate(rec.title(), 65))));
        var args = {};
        args.page = RDETAIL;
        args[PARAM_OFFSET] = 0;
@@ -166,11 +160,8 @@ function buildTitleDetailLink(rec, link) {
 
 /* builds an author search link */
 function buildAuthorLink(rec, link) {
-
-       var a = rec.author(); 
-       a = normalize(truncate(a, 65));
-       link.appendChild(text(a));
-
+       if(!rec) return; 
+       link.appendChild(text(normalize(truncate(rec.author(), 65))));
        var args = {};
        args.page = MRESULT;
        args[PARAM_OFFSET] = 0;
@@ -179,6 +170,17 @@ function buildAuthorLink(rec, link) {
        link.setAttribute("href", buildOPACLink(args));
 
 }
+
+function buildSubjectLink(subject, link) {
+       if(subject == null) return;
+       link.appendChild(text(normalize(truncate(subject, 35))));
+       var args = {};
+       args.page = MRESULT;
+       args[PARAM_OFFSET] = 0;
+       args[PARAM_STYPE] = STYPE_SUBJECT;
+       args[PARAM_TERM] = subject;
+       link.setAttribute("href", buildOPACLink(args));
+}
 /* ----------------------------------------------------------------------- */
 
 
index 11fcc25..6d6e341 100644 (file)
@@ -7,7 +7,9 @@ function resultSetInfo() {
        if( getDisplayCount() > (getHitCount() - getOffset()))  c = getHitCount();
        else c = getDisplayCount() + getOffset();
 
-       var pages = parseInt(getHitCount() / getDisplayCount()) + 1;
+       var pages = getHitCount() / getDisplayCount();
+       if(pages % 1) pages = parseInt(pages) + 1;
+
        G.ui.result.current_page.appendChild(text( (getOffset()/getDisplayCount()) + 1));
        G.ui.result.num_pages.appendChild(text(pages + ")"));
 
@@ -48,9 +50,7 @@ function resultSetInfo() {
 /* display the record info in the record display table */
 function resultDisplayRecord(rec, rowtemplate, is_mr) {
 
-       if(rec == null) rec = new mvr(); /* if we return we won't build some important UI components */
-
-       //alert("building record " + rec.title());
+       if(rec == null) rec = new mvr(); /* so the page won't die */
 
        /* hide the 'now loading...' message */
        hideMe(G.ui.common.loading);
@@ -60,7 +60,6 @@ function resultDisplayRecord(rec, rowtemplate, is_mr) {
        var pic = findNodeByName(r, config.names.result.item_jacket);
        pic.setAttribute("src", buildISBNSrc(cleanISBN(rec.isbn())));
 
-
        var title_link = findNodeByName(r, config.names.result.item_title);
        var author_link = findNodeByName(r, config.names.result.item_author);
 
index 4a1f5e5..083bc3e 100644 (file)
@@ -233,11 +233,16 @@ sub mods_values_to_mods_slim {
        }
 
        $tmp = $modsperl->{subject};
-       if(!$tmp) { $subject = []; } 
+       if(!$tmp) { $subject = {}; } 
        else {
                for my $key( keys %{$tmp}) {
                        push(@$subject, @{$tmp->{$key}}) if ($tmp->{$key});
                }
+               my $subh = {};
+               for my $s (@$subject) {
+                       if(defined($subh->{$s})) { $subh->{$s->[0]}++ } else { $subh->{$s->[0]} = 1;}
+               }
+               $subject = $subh
        }
 
        $tmp = $modsperl->{'series'};
@@ -322,8 +327,16 @@ sub push_mods_batch {
        my $xmlperl = $self->modsdoc_to_values( $mods );
        $xmlperl = $self->mods_values_to_mods_slim( $xmlperl );
 
-       for my $subject( @{$xmlperl->{subject}} ) {
-               push @{$self->{master_doc}->{subject}}, $subject;
+       # for backwards compatibility, remove the array part when all is decided
+       if(ref($xmlperl->{subject}) eq 'ARRAY' ) {
+               for my $subject( @{$xmlperl->{subject}} ) {
+                       push @{$self->{master_doc}->{subject}}, $subject;
+               }
+       } else {
+               for my $subject ( keys %{$xmlperl->{subject}} ) {
+                       my $s = $self->{master_doc}->{subject};
+                       if(defined($s->{$subject})) { $s->{$subject}++; } else { $s->{$subject} = 1; }
+               }
        }
 
        push( @{$self->{master_doc}->{type_of_resource}}, 
index dad3f6d..860d27a 100644 (file)
@@ -9,7 +9,7 @@
        <head>
                <title>Evergreen: Advanced Search</title>
                <xi:include href="css_common.xml#xpointer(//link)"/>
-               <xi:include href="js_common.xml"/>
+               <xi:include href="js_common.xml#xpointer(//script)"/>
        </head>
 
        <body onload="init();">
index c393fac..a06beea 100644 (file)
@@ -9,6 +9,13 @@
        <xi:include href="login.xml"/> 
 
        <!-- the org tree -->
-       <div id='org_tree' class='org_tree hide_me'> </div>
+       <div id='org_container' class='hide_me'>
+               <div id='org_link_container' class='color_1'>
+                       <span class='org_link'><a onclick='orgTreeSelector.openAll();' href='javascript:void(0);'>Expand All</a></span>
+                       <span class='org_link'><a onclick='orgTreeSelector.closeAll();' href='javascript:void(0);'>Close All</a></span>
+                       <span class='org_link'><a onclick='showCanvas();' href='javascript:void(0);'>Exit</a></span>
+               </div>
+               <div id='org_tree' class='org_tree'> </div>
+       </div>
 
 </div>
index 17e6af3..0a1c29c 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version='1.0'?>
 
-<!-- Javascript shared accross all pages -->
+<!-- Javascript shared across all pages -->
 
 <div xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en" lang="en">
 
        <script language='javascript' src='/lib/js/opac/RemoteRequest.js'> </script>
        <script language='javascript' src='/lib/js/opac/JSON.js'> </script>
        <script language='javascript' src='/lib/js/opac/web_fieldmapper.js'> </script>
-       <script language='javascript' src='/lib/js/opac/methods.js'> </script>
        <script language='javascript' src='/lib/js/opac/OrgTree.js'> </script>
        <script language='javascript' src='/lib/js/opac/added_content.js'> </script>
-       <script language='javascript' src='/lib/js/opac/org_utils.js'> </script>
 
 </div>
 
index c46aa1d..833ac41 100644 (file)
@@ -7,7 +7,7 @@
        <head>
                <title>Evergreen: Title Groups</title>
                <xi:include href="css_common.xml#xpointer(//link)"/>
-               <xi:include href="js_common.xml"/>
+               <xi:include href="js_common.xml#xpointer(//script)"/>
                <script language='javascript' src='/lib/js/opac/mresult.js'> </script>
                <script language='javascript' src='/lib/js/opac/result_common.js'> </script>
        </head>
diff --git a/Open-ILS/src/webxml/rdetail.xml b/Open-ILS/src/webxml/rdetail.xml
new file mode 100644 (file)
index 0000000..44bff28
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version='1.0'?>
+<!DOCTYPE x [ <!ENTITY % ent SYSTEM "locale/en-US/lang.dtd"> %ent; ] >
+
+<html xmlns="http://www.w3.org/1999/xhtml" 
+       xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en" lang="en">
+
+       <head>
+               <title>Evergreen: Titles</title>
+               <xi:include href="css_common.xml#xpointer(//link)"/>
+               <xi:include href="js_common.xml#xpointer(//script)"/>
+       </head>
+
+       <body onload="init();">
+               <xi:include href="header.xml"/> 
+               <div id='canvas' class='canvas'>
+                       <xi:include href="altcanvas.xml"/>
+                       <xi:include href="result_common.xml"/>
+               </div>
+       </body>
+
+</html>
index 11f4eeb..9b05ab4 100644 (file)
@@ -7,7 +7,7 @@
        <head>
                <title>Evergreen: Titles</title>
                <xi:include href="css_common.xml#xpointer(//link)"/>
-               <xi:include href="js_common.xml"/>
+               <xi:include href="js_common.xml#xpointer(//script)"/>
                <script language='javascript' src='/lib/js/opac/rresult.js'> </script>
                <script language='javascript' src='/lib/js/opac/result_common.js'> </script>
        </head>
index 06be024..1d2d87c 100644 (file)
 
        </div>
 
+
+       <div id='subject_sidebar' class='sidebar_chunk hide_me'> 
+               <div class='sidebar_extra_item'><a href='javascript:void(0)' name='subject_item'> </a></div>
+       </div>
+       
+
 </div>