From b5e148975a8fe5138652d90cfc8b0c95fd3155ae Mon Sep 17 00:00:00 2001 From: "Stephen V. Williams" Date: Fri, 31 May 2013 09:23:05 -0600 Subject: [PATCH] fixed a bug in the download that didn't allow it include limits such as Class when drilling down, added a slider that allows you to modify the maximum number of results returned and modified the csv template to include the sitename, query text, and date in its header --- webapp/web/js/searchDownload.js | 34 ++++++++++++++++--- .../body/search/search-csvResults.ftl | 8 +++-- .../body/search/search-pagedResults.ftl | 23 +++++++++---- .../body/search/search-xmlResults.ftl | 7 ++++ 4 files changed, 60 insertions(+), 12 deletions(-) diff --git a/webapp/web/js/searchDownload.js b/webapp/web/js/searchDownload.js index 7d9da55a8..1bcec1607 100644 --- a/webapp/web/js/searchDownload.js +++ b/webapp/web/js/searchDownload.js @@ -2,13 +2,23 @@ $(document).ready(function(){ // This function creates and styles the "qTip" tooltip that displays the resource uri and the rdf link when the user clicks the uri/rdf icon. - $('span#downloadResults').children('img#downloadIcon').each(function() + + $('span#downloadResults').children('img#downloadIcon').each(function() { $(this).qtip( { content: { prerender: true, // We need this for the .click() event listener on 'a.close' - text: '
Download the results from this search
download results in XML format
download results in CSV format

close' + text: '
' + +'

' + +'

' + +'
' + +'
' + +'
Download the results from this search
' + +'
download results in XML format
' + +'
download results in CSV format
' + +'
close
' + }, position: { corner: { @@ -28,17 +38,33 @@ $(document).ready(function(){ }, style: { padding: '1em', - width: 350, + width: 500, backgroundColor: '#f1f2ee' } }); + }); - + $( "#slider-vertical" ).slider({ + orientation: "vertical", + range: "min", + min: 10, + max: 1000, + value: 500, + slide: function( event, ui ) { + $( "#amount" ).val( ui.value ); + $('#csvDownload').attr("href", urlsBase + '/search?' + queryText +'&csv=1&hitsPerPage=' + ui.value); + $('#xmlDownload').attr("href", urlsBase + '/search?' + queryText +'&xml=1&hitsPerPage=' + ui.value); + } + }); + $( "#amount" ).val( $( "#slider-vertical" ).slider( "value" ) ); + // Prevent close link for URI qTip from requesting bogus '#' href $('a.close').click(function() { $('#downloadIcon').qtip("hide"); return false; }); + + }); \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/search/search-csvResults.ftl b/webapp/web/templates/freemarker/body/search/search-csvResults.ftl index 0656e8e6a..4b028ab01 100644 --- a/webapp/web/templates/freemarker/body/search/search-csvResults.ftl +++ b/webapp/web/templates/freemarker/body/search/search-csvResults.ftl @@ -1,5 +1,9 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -URI, Name +<#assign today = .now > +<#assign todayDate = today?date> +Results from ${siteName} for ${querytext} on ${todayDate} + +URI, Name, URL <#list individuals as individual> -"${individual.uri}","${individual.name}" +"${individual.uri}","${individual.name}","${individual.profileUrl}" diff --git a/webapp/web/templates/freemarker/body/search/search-pagedResults.ftl b/webapp/web/templates/freemarker/body/search/search-pagedResults.ftl index 5d96408bd..1fe395ec3 100644 --- a/webapp/web/templates/freemarker/body/search/search-pagedResults.ftl +++ b/webapp/web/templates/freemarker/body/search/search-pagedResults.ftl @@ -4,15 +4,23 @@ +

<#escape x as x?html> Search results for '${querytext}' <#if classGroupName?has_content>limited to type '${classGroupName}' <#if typeName?has_content>limited to type '${typeName}' -

@@ -105,9 +113,12 @@ -${stylesheets.add('')} +${stylesheets.add('', + '')} -${headScripts.add('', - '')} +${headScripts.add('', + '', + '' + )} ${scripts.add('')} diff --git a/webapp/web/templates/freemarker/body/search/search-xmlResults.ftl b/webapp/web/templates/freemarker/body/search/search-xmlResults.ftl index b96094453..5a47d3697 100644 --- a/webapp/web/templates/freemarker/body/search/search-xmlResults.ftl +++ b/webapp/web/templates/freemarker/body/search/search-xmlResults.ftl @@ -14,6 +14,13 @@ ${individual.uri?xml} ${individual.name?xml} + <#if individual.preferredTitle?has_content> + ${individual.preferredTitle?xml} + + <#if individual.email?has_content> + "${individual.email}" + + ${individual.profileUrl?xml}"