9f8a4de9d3e78fbb5a084d2ce679681ebefc52e0 tdreszer Thu Dec 16 09:12:20 2010 -0800 Solved problem of subtrack table occasionally text wrapping to 2 lines per subtrack. Used the power of CSS. diff --git src/hg/lib/hui.c src/hg/lib/hui.c index e8e880a..03717a9 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -3850,50 +3850,50 @@ printf("all</B>"); if (slCount(subtrackRefList) > 5) printf(" (<FONT class='subCBcount'></font>)"); puts("</TD>"); // Add column headers which are sort button links if (sortOrder != NULL) { puts("<TD colspan=5> </TD></TR>"); printf("<TR id=\"subtracksHeader\" class='nodrop nodrag sortable'>\n"); printf("<TH> <INPUT TYPE=HIDDEN NAME='%s' class='sortOrder' VALUE=\"%s\"></TH>\n", sortOrder->htmlId, sortOrder->sortOrder); // keeing track of sortOrder // Columns in tdb order (unchanging), sort in cart order (changed by user action) int sIx=0; for(sIx=0;sIx<sortOrder->count;sIx++) { - printf("<TH id='%s' class='sortable%s sort%d' abbr='use' nowrap title='Sort list on this column' onclick='tableSortAtButtonPress(this);'>%s", + printf("<TH id='%s' class='sortable%s sort%d' abbr='use' title='Sort list on this column' onclick='tableSortAtButtonPress(this);'>%s", sortOrder->column[sIx],(sortOrder->forward[sIx]?"":" sortRev"),sortOrder->order[sIx],sortOrder->title[sIx]); printf("<sup>%s",(sortOrder->forward[sIx]?"↓":"↑")); if (sortOrder->count > 1) printf ("%d",sortOrder->order[sIx]); printf("</sup>"); puts ("</TH>"); } puts("<TD> </TD>"); } puts("<TH> </TH>"); // Determine whether there is a restricted until date column for (subtrackRef = subtrackRefList; subtrackRef != NULL; subtrackRef = subtrackRef->next) { subtrack = subtrackRef->val; (void)metadataForTable(db,subtrack,NULL); if (NULL != metadataFindValue(subtrack,"dateUnrestricted")) { - printf("<TH align=\"center\" nowrap> "); + printf("<TH align='center'> "); printf("<A HREF=\'%s\' TARGET=BLANK>Restricted Until</A>", ENCODE_DATA_RELEASE_POLICY); puts(" </TH>"); break; // Don't need more than one } } puts("</TR></THEAD>"); // The end of the header section. // The subtracks need to be sorted by priority but only sortable and dragable will have non-default (cart) priorities to sort on if (sortOrder != NULL || useDragAndDrop) { preSorted = tdbRefSortPrioritiesFromCart(cart, &subtrackRefList); // preserves user's prev sort/drags printf("<TBODY class='%saltColors'>\n",(sortOrder != NULL ? "sortable " : "") ); } else { @@ -3982,100 +3982,100 @@ #define CFG_SUBTRACK_LINK "<A HREF='#a_cfg_%s' onclick='return subtrackCfgShow(\"%s\");' title='Subtrack Configuration'>%s</A>" #define MAKE_CFG_SUBTRACK_LINK(table,title) printf(CFG_SUBTRACK_LINK, (table),(table),(title)) #endif///ndef SUBTRACK_CFG_POPUP // If sortable, then there must be a column per sortable dimension if (sortOrder != NULL) { int sIx=0; for(sIx=0;sIx<sortOrder->count;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=labelRoot(membership->titles[ix],NULL); // Each sortable column requires hidden goop (in the "abbr" field currently) which is the actual sort on value - printf ("<TD id='%s_%s' nowrap abbr='%s' align='left'> ",subtrack->track,sortOrder->column[sIx],membership->membership[ix]); + printf ("<TD id='%s_%s' abbr='%s' align='left'> ",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 else printf("%s",titleRoot); puts ("</TD>"); 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 ("<TD nowrap='true'> "); + printf ("<TD> "); 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 if (cType != cfgNone) MAKE_CFG_SUBTRACK_LINK(subtrack->track,subtrack->shortLabel); #endif///ndef SUBTRACK_CFG_POPUP else printf("%s",subtrack->shortLabel); puts ("</TD>"); } #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 ("<TD nowrap title='select to copy'> %s", subtrack->longLabel); + printf ("<TD title='select to copy'> %s", subtrack->longLabel); if (trackDbSetting(parentTdb, "wgEncode") && trackDbSetting(subtrack, "accession")) printf (" [GEO:%s]", trackDbSetting(subtrack, "accession")); compositeMetadataToggle(db,subtrack,"...",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) { dependentCfgsNeedBinding = TRUE; // configurable subtrack needs to be bound to composite settings #define CFG_SUBTRACK_DIV "<DIV id='div_%s_cfg'%s><INPUT TYPE=HIDDEN NAME='%s' value='%s'>\n" #define MAKE_CFG_SUBTRACK_DIV(table,cfgVar,open) printf(CFG_SUBTRACK_DIV,(table),((open)?"":" style='display:none'"),(cfgVar),((open)?"on":"off")) safef(htmlIdentifier,sizeof(htmlIdentifier),"%s.childShowCfg",subtrack->track); boolean open = cartUsualBoolean(cart, htmlIdentifier,FALSE); MAKE_CFG_SUBTRACK_DIV(subtrack->track,htmlIdentifier,open); safef(htmlIdentifier,sizeof(htmlIdentifier),"%s",subtrack->track); cfgByCfgType(cType,db,cart,subtrack,htmlIdentifier,"Subtrack",TRUE); printf("</DIV>"); } #endif///ndef SUBTRACK_CFG_POPUP // A schema link for each track - printf("</td>\n<TD nowrap> "); + printf("</td>\n<TD> "); makeSchemaLink(db,subtrack,"schema"); printf(" "); // Do we have a restricted until date? char *dateDisplay = encodeRestrictionDateDisplay(db,subtrack); if (dateDisplay) - printf("</TD>\n<TD align=\"CENTER\" nowrap> %s ", dateDisplay); + printf("</TD>\n<TD align='center'> %s ", dateDisplay); // End of row and free ourselves of this subtrack puts("</TD></TR>\n"); checkBoxIdFree(&id); subgroupMembershipFree(&membership); } // End of the table puts("</TBODY><TFOOT></TFOOT>"); puts("</TABLE>"); printf("</td></tr></table>"); // Count of subtracks is filled in by javascript. if (slCount(subtrackRefList) > 5) puts(" <FONT class='subCBcount'></font>");