cdebb4d04806710cd984f9501568d724a1b8e601
kate
Thu Jun 11 09:58:03 2020 -0700
Handle missing description page. refs #24948
diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c
index 5e4d6b6..73516f6 100644
--- src/hg/hgTrackUi/hgTrackUi.c
+++ src/hg/hgTrackUi/hgTrackUi.c
@@ -3091,60 +3091,62 @@
void showSupertrackInfo(struct trackDb *tdb)
{
// A bit of context when we're in hierarchy: parent description and sibling track list
if (!tdb->parent)
return;
// show super-track info
struct trackDb *tdbParent = tdb->parent;
printf("Track collection: "
"
"
"%s ",
hgTrackUiName(), cartSessionVarName(), cartSessionId(cart),
chromosome, cgiEncode(tdbParent->track), tdbParent->longLabel);
+printf("
");
+if (tdbParent->html)
+ {
// collapsed panel for Description
-
-printf("
");
printf("
"); // required by jsCollapsible
jsBeginCollapsibleSectionFontSize(cart, tdb->track, "superDescription", "Description", FALSE,
"medium");
char *html = replaceChars(tdbParent->html, "Description", "");
html = replaceChars(html, "Description
", "");
html = replaceChars(html, "Description
", "");
// remove everything after Description text
char *end = stringIn("", html);
if (!end)
end = stringIn("", html);
if (!end)
end = stringIn("", html);
if (end)
*end = '\0';
printf("%s", html);
printf("
To view the full description, click "
"here.\n",
hgTrackUiName(), cartSessionVarName(), cartSessionId(cart),
chromosome, cgiEncode(tdbParent->track));
jsEndCollapsibleSection();
printf("
"); // required by jsCollapsible
+ }
// collapsed panel for list of other tracks in the supertrack
char listTitle[1000];
safef(listTitle, sizeof listTitle, "All tracks in this collection (%d)",
slCount(tdbParent->children));
printf(""); // required by jsCollapsible
jsBeginCollapsibleSectionFontSize(cart, tdb->track, "superMembers", listTitle, FALSE, "medium");
printf("");
struct slRef *childRef;
tdbRefSortPrioritiesFromCart(cart, &tdbParent->children);
for (childRef = tdbParent->children; childRef != NULL; childRef = childRef->next)
{
struct trackDb *sibTdb = childRef->val;
if (sameString(sibTdb->track, tdb->track))