966c1787935292fcc55313bd0e0cc08dffb89762
Merge parents a3026fd 0e0258d
tdreszer
Mon Sep 19 13:30:46 2011 -0700
Fix merge conflict.
diff --cc src/hg/lib/hui.c
index a987a11,43c4e04..255cdd6
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@@ -3753,91 -3721,76 +3746,74 @@@
case cfgBedFilt: bedUi(tdb,cart,title, boxed);
break;
#ifdef USE_BAM
case cfgBam: bamCfgUi(cart, tdb, prefix, title, boxed);
break;
#endif
case cfgVcf: vcfCfgUi(cart, tdb, prefix, title, boxed);
break;
case cfgPsl: pslCfgUi(db,cart,tdb,prefix,title,boxed);
break;
default: warn("Track type is not known to multi-view composites. type is: %d ", cType);
break;
}
}
- char *encodeRestrictionDateDisplay(char *db,struct trackDb *trackDb)
+ char *encodeRestrictionDate(char *db,struct trackDb *trackDb,boolean excludePast)
/* Create a string for ENCODE restriction date of this track
if return is not null, then free it after use */
{
if (!trackDb)
return NULL;
- boolean addMonths = FALSE;
char *date = NULL;
if(metadataForTable(db,trackDb,NULL) != NULL)
{
- addMonths = FALSE;
date = cloneString((char *)metadataFindValue(trackDb,"dateUnrestricted"));
- if(date == NULL) // TODO: The logic to calculate date based upon dateSubmitted should be removed. However, I don't think we can do it until the mdb is used for all hg18 composites.
- {
- date = cloneString((char *)metadataFindValue(trackDb,"dateSubmitted"));
- addMonths = TRUE;
- }
- }
- if(date == NULL)
- {
- date = trackDbSetting(trackDb, "dateSubmitted");
- if(date)
- {
- addMonths = TRUE;
- date = cloneString(date); // all returns should be freeable memory
- }
- }
- if (date != NULL)
- {
- date = strSwapChar(date, ' ', 0); // Truncate time
- if(addMonths)
- date = dateAddTo(date, "%F", 0, 9, 0);
+ if (date != NULL)
+ date = strSwapChar(date, ' ', 0); // Truncate time (not expected, but just in case)
+
+ if (excludePast && !isEmpty(date) && dateIsOld(date,"%F"))
+ freez(&date);
}
return date;
}
+#ifndef SUBTRACK_CFG
static void cfgLinkToDependentCfgs(struct cart *cart, struct trackDb *tdb,char *prefix)
/* Link composite or view level controls to all associateled lower level controls */
{
if (!cartVarExists(cart, "ajax") && tdbIsComposite(tdb))
-#ifdef SUBTRACK_CFG_POPUP
- printf("\n",prefix);
-#else///ifndef SUBTRACK_CFG_POPUP
printf("\n",prefix);
-#endif///ndef SUBTRACK_CFG_POPUP
}
+#endif///ndef SUBTRACK_CFG
static void compositeUiSubtracks(char *db, struct cart *cart, struct trackDb *parentTdb,struct hash *trackHash)
/* Display list of subtracks and descriptions with checkboxes to control visibility and possibly other
* nice things including links to schema and metadata and a release date. */
{
struct trackDb *subtrack;
struct dyString *dyHtml = newDyString(SMALLBUF);
//char *colors[2] = { COLOR_BG_DEFAULT,
// COLOR_BG_ALTDEFAULT };
char *colors[2] = { "bgLevel1",
"bgLevel1" };
int colorIx = COLOR_BG_DEFAULT_IX; // Start with non-default allows alternation
-#ifndef SUBTRACK_CFG_POPUP
+#ifndef SUBTRACK_CFG
boolean dependentCfgsNeedBinding = FALSE;
-#endif///ndef SUBTRACK_CFG_POPUP
+#endif///ndef SUBTRACK_CFG
// Get list of leaf subtracks to work with
struct slRef *subtrackRef, *subtrackRefList = trackDbListGetRefsToDescendantLeaves(parentTdb->subtracks);
// Look for dividers, heirarchy, dimensions, sort and dragAndDrop!
char **lastDivide = NULL;
dividers_t *dividers = dividersSettingGet(parentTdb);
if (dividers)
lastDivide = needMem(sizeof(char*)*dividers->count);
hierarchy_t *hierarchy = hierarchySettingGet(parentTdb);
membersForAll_t* membersForAll = membersForAllSubGroupsGet(parentTdb,NULL);
int dimCount=0,di;
for(di=0;didimMax;di++) { if (membersForAll->members[di]) dimCount++; }
sortOrder_t* sortOrder = sortOrderGet(cart,parentTdb);
@@@ -4184,97 -4042,99 +4160,97 @@@
if (sortOrder != NULL)
{
int sIx=0;
for(sIx=0;sIxcount;sIx++)
{
ix = stringArrayIx(sortOrder->column[sIx], membership->subgroups, membership->count); // TODO: Sort needs to expand from subGroups to labels as well
if (ix >= 0)
{
char *titleRoot=NULL;
if (cvTermIsEmpty(sortOrder->column[sIx],membership->titles[ix]))
titleRoot = cloneString(" ");
else
titleRoot = labelRoot(membership->titles[ix],NULL);
// Each sortable column requires hidden goop (in the "abbr" field currently) which is the actual sort on value
printf ("
",subtrack->track,sortOrder->column[sIx],membership->membership[ix]);
- #ifdef SUBTRACK_CFG_POPUP
- dyStringPrintf(dyLabel,"%s ",titleRoot);
- if (cType != cfgNone && sameString("view",sortOrder->column[sIx])) // configure link is on view currenntly TODO: make a wrench next to check box/view
- {
- dyStringAppend(dyLabel,"Configuration");
- MAKE_CFG_SUBTRACK_LINK(subtrack->track,dyStringContents(dyLabel),titleRoot);
- }
- #else///ifndef SUBTRACK_CFG_POPUP
- if (cType != cfgNone && sameString("view",sortOrder->column[sIx]))
- MAKE_CFG_SUBTRACK_LINK(subtrack->track,titleRoot); // FIXME: Currently configurable under sort only supported when multiview
- #endif///ndef SUBTRACK_CFG_POPUP
+ #ifndef SUBTRACK_CFG
+ #define CFG_SUBTRACK_LINK "%s"
+ #define MAKE_CFG_SUBTRACK_LINK(table,title) printf(CFG_SUBTRACK_LINK, (table),(table),(title))
+ if (cType != cfgNone && sameString("view",sortOrder->column[sIx])) // configure link is on view currently
+ MAKE_CFG_SUBTRACK_LINK(subtrack->track,titleRoot);
else
+ #endif///ndef SUBTRACK_CFG
printf("%s",titleRoot);
puts ("
");
freeMem(titleRoot);
}
}
}
else // Non-sortable tables do not have sort by columns but will display a short label (which may be a configurable link)
{
printf ("
");
indentIfNeeded(hierarchy,membership);
- #ifdef SUBTRACK_CFG_POPUP
- if (cType != cfgNone && cType != cfgWigMaf) // FIXME: wigMaf restriction is temporary until configureByPopup off is set
- MAKE_CFG_SUBTRACK_LINK(subtrack->track,subtrack->shortLabel,subtrack->shortLabel);
- #else///ifndef SUBTRACK_CFG_POPUP
+ #ifndef SUBTRACK_CFG
if (cType != cfgNone)
MAKE_CFG_SUBTRACK_LINK(subtrack->track,subtrack->shortLabel);
- #endif///ndef SUBTRACK_CFG_POPUP
else
+ #endif///ndef SUBTRACK_CFG
printf("%s",subtrack->shortLabel);
puts ("
");
}
-#ifdef SUBTRACK_CFG_POPUP
- dyStringFree(&dyLabel);
-#endif///def SUBTRACK_CFG_POPUP
// The long label column (note that it may have a "..." that allows getting at all the metadata)
printf ("
%s", subtrack->longLabel);
if (trackDbSetting(parentTdb, "wgEncode") && trackDbSetting(subtrack, "accession"))
printf (" [GEO:%s]", trackDbSetting(subtrack, "accession"));
compositeMetadataToggle(db,subtrack,NULL,TRUE,FALSE, trackHash);
printf(" ");
-#ifndef SUBTRACK_CFG_POPUP
// Embedded cfg dialogs are within the TD that contains the longLabel. This allows a wide item to be embedded in the table
if (cType != cfgNone)
{
+ #ifdef SUBTRACK_CFG
+ // How to make this thing float to the left? Container is overflow:visible
+ // and contained (made in js) is position:relative; left: -{some pixels}
+ #define CFG_SUBTRACK_DIV ""
+ #define MAKE_CFG_SUBTRACK_DIV(table,view) printf(CFG_SUBTRACK_DIV,(table),(view)?(view):"noView")
+ char * view = NULL;
+ if (membersForAll->members[dimV] && -1 != (ix = stringArrayIx(membersForAll->members[dimV]->groupTag, membership->subgroups, membership->count)))
+ view = membership->membership[ix];
+ MAKE_CFG_SUBTRACK_DIV(subtrack->track,view);
+ #else///ifndef SUBTRACK_CFG
dependentCfgsNeedBinding = TRUE; // configurable subtrack needs to be bound to composite settings
- #define CFG_SUBTRACK_DIV "
");
+ #endif///ndef SUBTRACK_CFG
}
-#endif///ndef SUBTRACK_CFG_POPUP
// A schema link for each track
printf("
\n
");
makeSchemaLink(db,subtrack,"schema");
printf(" ");
// Do we have a restricted until date?
if (restrictions)
{
- char *dateDisplay = encodeRestrictionDateDisplay(db,subtrack);
+ char *dateDisplay = encodeRestrictionDate(db,subtrack,FALSE); // includes dates in the past
if (dateDisplay)
{
if (dateIsOld(dateDisplay,"%F"))
printf("
\n
%s ", dateDisplay);
else
printf("
\n
%s ", dateDisplay);
}
}
// End of row and free ourselves of this subtrack
puts("