e6100fa2819ed91841daa891e7c6bfa3d38ff5f6
braney
  Wed May 28 22:31:53 2014 -0700
some small fixes for hub search ui
diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c
index e2b6c47..7e54964 100644
--- src/hg/hgHubConnect/hgHubConnect.c
+++ src/hg/hgHubConnect/hgHubConnect.c
@@ -293,32 +293,37 @@
 struct trixSearchResult *tsList = trixSearch(trix, trixWordCount, trixWords, TRUE);
 for ( ; tsList != NULL; tsList = tsList->next)
     hashStore(urlSearchHash, tsList->itemId);
 
 return urlSearchHash;
 }
 
 static struct hash *outputPublicTable(struct sqlConnection *conn, char *publicTable, char *statusTable)
 /* Put up the list of public hubs and other controls for the page. */
 {
 char *trixFile = cfgOptionEnvDefault("HUBSEARCHTRIXFILE", "hubSearchTrixFile", "/gbdb/hubs/public.ix");
 char *hubSearchTerms = cartOptionalString(cart, hgHubSearchTerms);
 boolean haveTrixFile = fileExists(trixFile);
 struct hash *urlSearchHash = NULL;
 
+printf("<div id=\"publicHubs\" class=\"hubList\"> \n");
+
 if (haveTrixFile && !isEmpty(hubSearchTerms))
+    {
+    strLower(hubSearchTerms);
     urlSearchHash = getUrlSearchHash(trixFile, hubSearchTerms);
+    }
 
 // if we have search terms, put out the line telling the user so
 if (!isEmpty(hubSearchTerms))
     {
     printf("<BR>List restricted by search terms : %s\n", hubSearchTerms);
     puts("<input name=\"hubDeleteSearchButton\""
 	"onClick="
 	"\" document.searchHubForm.elements['hubSearchTerms'].value=\'\';"
 	"document.searchHubForm.submit();return true;\" "
 	"class=\"hubField\" type=\"button\" value=\"Delete Search Terms\">\n");
     printf("<BR>\n");
     }
 
 // if we have a trix file, draw the search box
 if (haveTrixFile)
@@ -354,31 +359,30 @@
     ++count;
     char *url = row[0], *shortLabel = row[1], *longLabel = row[2], 
     	  *dbList = row[3], *errorMessage = row[4], *descriptionUrl = row[6];
     int id = atoi(row[5]);
 
     if ((urlSearchHash != NULL) && (hashLookup(urlSearchHash, url) == NULL))
 	continue;
 
     struct slName *dbListNames = slNameListFromComma(dbList);
 
     if (gotAnyRows)
 	webPrintLinkTableNewRow();
     else
 	{
 	/* output header */
-	printf("<div id=\"publicHubs\" class=\"hubList\"> \n");
 
 	printf("<table id=\"publicHubsTable\"> "
 	    "<thead><tr> "
 		"<th>Display</th> "
 		"<th>Hub Name</th> "
 		"<th>Description</th> "
 		"<th>Assemblies</th> "
 	    "</tr></thead>\n");
 
 	// start first row
 	printf("<tbody> <tr>");
 	gotAnyRows = TRUE;
 
 	// allocate the hash to store hubUrl's
 	publicHash = newHash(5);
@@ -440,34 +444,33 @@
 	ourPrintCell(shortLabel);
     if (isEmpty(errorMessage))
 	ourPrintCell(longLabel);
     else
 	printf("<TD><span class=\"hubError\">ERROR: %s </span>"
 	    "<a href=\"../goldenPath/help/hgTrackHubHelp.html#Debug\">Debug</a></TD>", 
 	    errorMessage);
 
     printGenomeList(dbListNames, count); 
 
     hashStore(publicHash, url);
     }
 sqlFreeResult(&sr);
 
 if (gotAnyRows)
-    {
     printf("</TR></tbody></TABLE>\n");
+
 printf("</div>");
-    }
 return publicHash;
 }
 
 
 struct hash *hgHubConnectPublic()
 /* Put up the list of public hubs and other controls for the page. */
 {
 struct hash *retHash = NULL;
 struct sqlConnection *conn = hConnectCentral();
 char *publicTable = cfgOptionEnvDefault("HGDB_HUB_PUBLIC_TABLE", 
 	hubPublicTableConfVariable, defaultHubPublicTableName);
 char *statusTable = cfgOptionEnvDefault("HGDB_HUB_STATUS_TABLE", 
 	hubStatusTableConfVariable, defaultHubStatusTableName);
 if (!(sqlTableExists(conn, publicTable) && 
 	(retHash = outputPublicTable(conn, publicTable,statusTable)) != NULL ))