ec4568d14f455627aa84b614bafb82b03a2edc8a
tdreszer
Fri May 6 14:35:35 2011 -0700
Fixes to spacing issues on hgTrackUi and hgFileUi where navlinks and description page resulted in extra lines. Created subheadingBar div to replace one of the many nested tables and use CSS.
diff --git src/hg/hgFileUi/hgFileUi.c src/hg/hgFileUi/hgFileUi.c
index d02fe86..7a4f1fb 100644
--- src/hg/hgFileUi/hgFileUi.c
+++ src/hg/hgFileUi/hgFileUi.c
@@ -1,160 +1,164 @@
#include "common.h"
#include "hash.h"
#include "cheapcgi.h"
#include "htmshell.h"
#include "jsHelper.h"
#include "trackDb.h"
#include "hdb.h"
#include "web.h"
#include "mdb.h"
#include "hCommon.h"
#include "hui.h"
#include "fileUi.h"
#define MAIN_FORM "mainForm"
#define WIGGLE_HELP_PAGE "../goldenPath/help/hgWiggleTrackHelp.html"
struct hash *trackHash = NULL; /* Hash of all tracks in database. */
void fileUi(struct cart *cart,struct trackDb *tdb, char *db, char *chrom, boolean ajax)
// Downloadable Files UI
{
if (!ajax)
{
jsIncludeFile("jquery.js", NULL);
webIncludeResourceFile("jquery-ui.css");
jsIncludeFile("jquery-ui.js", NULL);
jsIncludeFile("utils.js",NULL);
}
// QUESTION: Is this needed? Are we doing a submit on hgTrackUi to get here?? Probably not.
//if(tdbIsContainer(tdb) && !ajax)
// cartTdbTreeReshapeIfNeeded(cart,tdb);
printf("%s\n", tdb->longLabel);
// If Composite, link to the hgTrackUi. But if downloadsOnly then link to any superTrack.
#define LINK_TO_PARENT "%s(
%s)\n"
if (tdbIsComposite(tdb))
{
char *encodedTrackName = cgiEncode(tdb->track);
printf(LINK_TO_PARENT," ", hgTrackUiName(), cartSessionVarName(), cartSessionId(cart), chrom, encodedTrackName,tdb->shortLabel,"Track settings");
freeMem(encodedTrackName);
}
else if (tdb->parent) //Print link for parent track
{
char *encodedTrackName = cgiEncode(tdb->parent->track);
printf(LINK_TO_PARENT," ", hgTrackUiName(), cartSessionVarName(), cartSessionId(cart), chrom, encodedTrackName, tdb->parent->shortLabel, tdb->parent->shortLabel);
freeMem(encodedTrackName);
}
// NAVLINKS - Link to Description down below
if (tdb->html != NULL && tdb->html[0] != 0)
{
printf("");
// First put up a button to go to File Search
printf("File Search ",db);
// Now link to description
char *downArrow = "⇓";
enum browserType browser = cgiBrowser();
if (browser == btIE || browser == btFF)
downArrow = "↓";
printf("Description%s",downArrow);
printf("");
}
puts("
");
filesDownloadUi(db,cart,tdb);
// Print data version trackDB setting, if any */
char *version = trackDbSetting(tdb, "dataVersion");
if (version)
- printf("
Data version: %s
\n", version);
+ printf("
Data version: %s
\n", version);
// Print lift information from trackDb, if any
(void) trackDbPrintOrigAssembly(tdb, db);
if (tdb->html != NULL && tdb->html[0] != 0)
{
- htmlHorizontalLine();
- // include anchor for Description link
- puts("");
char *browserVersion;
if (btIE == cgiClientBrowser(&browserVersion, NULL, NULL) && *browserVersion < '8')
- printf("");
- else
- printf("");
+ htmlHorizontalLine();
+ else // Move line down, since Description (in ->html) is proceded by too much space
+ printf(" ");
+
+ printf("");
+ puts(""); // include anchor for Description link
+
+ // Add pennantIcon
+ printPennantIconNote(tdb);
+
puts(tdb->html);
- printf(" | ");
+ printf(" | "); // positions top link below line
makeTopLink(tdb);
- printf("  | ");
+ printf("  | ");
makeTopLink(tdb);
printf("  | ");
}
}
void doMiddle(struct cart *cart)
/* Write body of web page. */
{
struct trackDb *tdbList = NULL;
struct trackDb *tdb = NULL;
char *track;
char *ignored;
char *db = NULL;
track = cartString(cart, "g"); // QUESTION: Should this be 'f' ??
getDbAndGenome(cart, &db, &ignored, NULL);
char *chrom = cartUsualString(cart, "c", hDefaultChrom(db));
// QUESTION: Do We need track list ??? trackHash ??? Can't we just get one track and no children
// ANSWER: The way the code is set up now you will get the whole list. This is just to put all
// the logic for resolving loading parents and children in one place. We do occassionally pay the
// price of a 200 millisecond delay because of it though - JK.
trackHash = trackHashMakeWithComposites(db,chrom,&tdbList,FALSE);
tdb = tdbForTrack(db, track,&tdbList);
if (tdb == NULL)
{
errAbort("Can't find %s in track database %s", track, db);
return;
}
cartWebStart(cart, db, "%s %s", tdb->shortLabel, DOWNLOADS_ONLY_TITLE);
if (!tdbIsComposite(tdb) && !tdbIsDownloadsOnly(tdb))
{
warn("Track '%s' of type %s is not supported by hgFileUi.",track, tdb->type);
return;
}
// QUESTION: Do we need superTrack? If we have lnk to superTrack, then yes.
// ANSWER: No, you shouldn't need to do this here. The call that generated the
// tdbList already took care of this. -JK
#ifdef UNNEEDED
char *super = trackDbGetSupertrackName(tdb);
if (super)
{
if (tdb->parent) // configured as a supertrack member in trackDb
{
tdbMarkAsSuperTrack(tdb->parent);
trackDbSuperMemberSettings(tdb);
}
}
#endif /* UNNEEDED */
fileUi(cart, tdb, db, chrom, FALSE);
printf(" \n");
webEnd();
}
char *excludeVars[] = { "submit", "Submit", "g", NULL, "ajax", NULL,}; // HOW IS 'ajax" going to be supported?
int main(int argc, char *argv[])
/* Process command line. */
{
cgiSpoof(&argc, argv);
htmlSetBackground(hBackgroundImage());
cartEmptyShell(doMiddle, hUserCookie(), excludeVars, NULL);
return 0;
}
|
|