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("<b>Track collection: " "<img height=12 src='../images/ab_up.gif'>" "<a href='%s?%s=%s&c=%s&g=%s'>%s </b></a>", hgTrackUiName(), cartSessionVarName(), cartSessionId(cart), chromosome, cgiEncode(tdbParent->track), tdbParent->longLabel); +printf("<p>"); +if (tdbParent->html) + { // collapsed panel for Description - -printf("<p>"); printf("<p><table>"); // required by jsCollapsible jsBeginCollapsibleSectionFontSize(cart, tdb->track, "superDescription", "Description", FALSE, "medium"); char *html = replaceChars(tdbParent->html, "<H", "<h"); html = replaceChars(html, "</H", "</h"); // remove Description header html = replaceChars(html, "<h2>Description</h2>", ""); html = replaceChars(html, "<h3>Description</h3>", ""); html = replaceChars(html, "<h1>Description</h1>", ""); // remove everything after Description text char *end = stringIn("<h2>", html); if (!end) end = stringIn("<h1>", html); if (!end) end = stringIn("<h3>", html); if (end) *end = '\0'; printf("%s", html); printf("<p><i>To view the full description, click " "<a target='_blank' href='%s?%s=%s&c=%s&g=%s#TRACK_HTML'>here.</i></a>\n", hgTrackUiName(), cartSessionVarName(), cartSessionId(cart), chromosome, cgiEncode(tdbParent->track)); jsEndCollapsibleSection(); printf("</table>"); // 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("<table>"); // required by jsCollapsible jsBeginCollapsibleSectionFontSize(cart, tdb->track, "superMembers", listTitle, FALSE, "medium"); printf("<table cellpadding='2' style='margin-left: 50px';>"); 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))