fa815602bbac262a6e07ac577e40558abcf93144 max Tue Oct 15 04:53:53 2024 -0700 suppress download link for protected tracks, refs #34629 diff --git src/hg/hgTables/mainPage.c src/hg/hgTables/mainPage.c index ac33ee3..0fa0f9c 100644 --- src/hg/hgTables/mainPage.c +++ src/hg/hgTables/mainPage.c @@ -630,30 +630,42 @@ hPrintf(" <div class='tbTooltip'>"); hPrintf("<span class='tbTooltipLabel'><b>%s</b>", stepLabels[num-1]); hPrintf(" "); printInfoIconSvg(); hPrintf("</span>"); hPrintf("<span class='tbTooltiptext'>%s <a target='_blank' href='%s'>%s</a></span>\n", stepHelp[num-1], stepHelpLinks[num-1], HELP_LABEL); hPrintf("</div>"); hPrintf("</td></tr>"); hPrintf("<tr height='6px'><td></td></tr>"); } +void printNoGenomeWarning(struct trackDb *curTrack) { + /* print a message box that explains why a track is not downloadable */ + hPrintf("<DIV style='background-color: #faf2bb; opacity:0.9; border: 1px solid #EEE; margin: 2px; padding: 4px'>"); + char *noGenomeNote = trackDbSettingClosestToHome(curTrack, "noGenomeReason"); + hPrintf("<b>Note:</b> This track is unavailable for genome-wide download. "); + if (noGenomeNote) + hPrintf("Reason: %s", noGenomeNote); + else + hPrintf("Usually, this is due to distribution restrictions of the source database or the size of the track. Please see the track documentation for more details. Contact us if you are still unable to access the data. "); + hPrintf("</DIV>"); +} + void showMainControlTable(struct sqlConnection *conn) /* Put up table with main controls for main page. */ { struct grp *selGroup; boolean isWig = FALSE, isPositional = FALSE, isMaf = FALSE, isBedGr = FALSE, isChromGraphCt = FALSE, isPal = FALSE, isArray = FALSE, isBam = FALSE, isVcf = FALSE, isHalSnake = FALSE, isLongTabix = FALSE, isHic = FALSE; boolean gotClade = hGotClade(); struct hTableInfo *hti = NULL; hPrintf("<TABLE BORDER=0>\n"); int stepNumber = 1; printStep(stepNumber++); @@ -802,38 +814,33 @@ cgiMakeButton(hgtaDoLookupPosition, "Lookup"); hPrintf(" "); if (userRegionsFileName() != NULL) { makeRegionButton(hgtaRegionTypeUserRegions, regionType); hPrintf(" Defined regions "); cgiMakeButton(hgtaDoSetUserRegions, "Change"); hPrintf(" "); cgiMakeButton(hgtaDoClearUserRegions, "Clear"); } else cgiMakeButton(hgtaDoSetUserRegions, "Define regions"); hPrintf("</TD></TR>\n"); if (disableGenome) { // no need to check curTrack for NULL, disableGenome can only be set if curTable is set - hPrintf("<tr><td><DIV style='background-color: #faf2bb; opacity:0.9; border: 1px solid #EEE; margin: 2px; padding: 4px'>"); - char *noGenomeNote = trackDbSettingClosestToHome(curTrack, "noGenomeReason"); - hPrintf("<b>Note:</b> This track is unavailable for genome-wide download. "); - if (noGenomeNote) - hPrintf("Reason: %s", noGenomeNote); - else - hPrintf("Usually, this is due to distribution restrictions of the source database or the size of the track. Please see the track documentation for more details. Contact us if you are still unable to access the data. "); - hPrintf("</DIV></td></tr>"); + hPrintf("<tr><td>"); + printNoGenomeWarning(curTrack); + hPrintf("</td></tr>"); } } else { /* Need to put at least stubs of cgi variables in for JavaScript to work. */ jsTrackingVar("regionType", regionType); cgiMakeHiddenVar(hgtaRange, range); cgiMakeHiddenVar(hgtaRegionType, regionType); } /* Select identifiers line (if applicable). */ if (!isWig && getIdField(database, curTrack, curTable, hti) != NULL) { hPrintf("<TR><TD><B>Identifiers (names/accessions):</B>\n");