3b6c7089dbb23dadedfce9b9bf75279bb2d1e6e2 tdreszer Mon Dec 20 16:08:44 2010 -0800 Added standardized preamble for the files downloads page. diff --git src/hg/lib/fileUi.c src/hg/lib/fileUi.c index b6ccda2..1af7aa7 100644 --- src/hg/lib/fileUi.c +++ src/hg/lib/fileUi.c @@ -252,47 +252,59 @@ oneFile->sortFields[sortOrder->order[ix] - 1] = field; oneFile->reverse[ sortOrder->order[ix] - 1] = (sortOrder->forward[ix] == FALSE); } else { oneFile->sortFields[sortOrder->order[ix] - 1] = NULL; oneFile->reverse[ sortOrder->order[ix] - 1] = FALSE; } oneFile->sortFields[sortOrder->count] = NULL; } } slSort(fileList,fileDbSortCmp); } } +static void filesDownloadsPreamble(char *db, struct trackDb *tdb) +{ +puts("

Data is RESTRICTED FROM USE"); +puts("in publication until the restriction date noted for the given data file.\nThere are two files within this directory that contain information about the downloads:"); +printf("
• files.txt which is a tab-separated file with the name and metadata for each download.\n", + hDownloadsServer(),db,ENCODE_DCC_DOWNLOADS, tdb->track); +printf("
• md5sum.txt which is a list of the md5sum output for each download.\n", + hDownloadsServer(),db,ENCODE_DCC_DOWNLOADS, tdb->track); +puts("

"); +} + void filesDownloadUi(char *db, struct cart *cart, struct trackDb *tdb) // UI for a "composite like" track: This will list downloadable files associated with // a single trackDb entry (composite or of type "downloadsOnly". The list of files // will have links to their download and have metadata information associated. // The list will be a sortable table and there may be filtering controls. { // The basic idea: // 1) tdb of composite or type=downloadsOnly tableless track // 2) All mdb Objs associated with "composite=tdb->track" and having fileName // 3) Verification of each file in its discovered location - // 4) Lookup of filters (tdb dimensions?) and filterComposite style controls - // 5) Presort of files list - // 6) make table class=sortable - // 7) Final file count - // Get preamble from dir ?? - // Use trackDb settings to get at html description, long and short labels - // Recommend different color background to get the point across that these are files, not tracks + // 4) Lookup of 'fileSortOrder' + // 5) TODO: present filter controls + // 6) Presort of files list + // 7) make table class=sortable + // 8) Final file count + // 9) Use trackDb settings to get at html description + // Nice to have: Make filtering and sorting persistent (saved to cart) // FIXME: Trick while developing: if (tdb->table != NULL) tdb->track = tdb->table; boolean debug = cartUsualBoolean(cart,"debug",FALSE); int ix; struct sqlConnection *conn = sqlConnect(db); char *mdbTable = mdbTableName(conn,TRUE); // Look for sandBox name first if(mdbTable == NULL) errAbort("TABLE NOT FOUND: '%s.%s'.\n",db,MDB_DEFAULT_NAME); struct fileDb *fileList = NULL, *oneFile = NULL; @@ -384,30 +396,33 @@ // cart contents //boolean filterAble = dimensionsExist(tdb); //membersForAll_t* membersForAll = membersForAllSubGroupsGet(tdb,cart); // Now update all files with their sortable fields and sort the list sortOrder_t *sortOrder = fileSortOrderGet(cart,tdb); if (sortOrder != NULL) { // Fill in and sort fileList fileDbSortList(&fileList,sortOrder); } jsIncludeFile("hui.js",NULL); jsIncludeFile("ajax.js",NULL); +// standard preamble +filesDownloadsPreamble(db,tdb); + // Table class=sortable int columnCount = 0; int restrictedColumn = 0; printf("\n"); printf("\n"); printf("\n"); printf("\n"); columnCount++;
 "); int filesCount = slCount(fileList); if (filesCount > 5) printf("%d files",filesCount); //puts(""); // Use this style when filterboxes are up and running //if (sortOrder) // NOTE: This could be done to preserve sort order FIXME: However hgFileUi would need form OR changes would need to be ajaxed over AND hgsid would be needed. // printf("",sortOrder->htmlId, sortOrder->sortOrder); printf("