3bd303d90463041294d0879f7a3ef64c6f8dcaf4
braney
  Sun May 7 17:44:39 2017 -0700
ongoing work on custom composites

diff --git src/hg/hgComposite/hgComposite.c src/hg/hgComposite/hgComposite.c
index 5c56e32..d35ac86 100644
--- src/hg/hgComposite/hgComposite.c
+++ src/hg/hgComposite/hgComposite.c
@@ -227,32 +227,32 @@
         fprintf(f, "\t%s %s\n", hel->name, (char *)hel->val);
     }
 if (bigDataUrl == NULL)
     {
     if (dataUrl != NULL)
         fprintf(f, "\tbigDataUrl %s\n", dataUrl);
     }
 fprintf(f, "\tparent %s\n",parent);
 fprintf(f, "\tcolor %d,%d,%d\n", (color >> 16) & 0xff,(color >> 8) & 0xff,color & 0xff);
 fprintf(f, "\n");
 }
 
 static void outComposite(FILE *f, struct composite *composite)
 {
 char *parent = composite->name;
-char *shortLabel = composite->name;
-char *longLabel = composite->name;
+char *shortLabel = composite->shortLabel;
+char *longLabel = composite->longLabel;
 fprintf(f,"track %s\n\
 shortLabel %s\n\
 compositeTrack on\n\
 aggregate none\n\
 longLabel %s\n\
 %s on\n\
 #container multiWig\n\
 type wig \n\
 visibility full\n\n", parent, shortLabel, longLabel, CUSTOM_COMPOSITE_SETTING);
 }
 
 static struct trackDb *findTrack(char *name, struct trackDb *fullTrackList)
 {
 struct trackDb *tdb;
 for (tdb = fullTrackList; tdb != NULL; tdb = tdb->next)
@@ -438,65 +438,67 @@
 //#*** ------------------ end verbatim ---------------
 
 printf("<div class='sectionLiteHeader noReorderRemove'>"
        "Select Genome Assembly</div>\n");
 
 /* Print clade, genome and assembly line. */
 hgGatewayCladeGenomeDb();
 
 }
 
 static void printCompositeList(struct composite *compositeList, struct composite *currentComposite)
 {
 if (compositeList == NULL)
     return;
 
-printf("<H4>My Composites</H4>\n");
+printf("<div class='sectionLiteHeader noReorderRemove'>"
+       "My Composites</div>\n");
 
 int count = slCount(compositeList);
 char *labels[count];
 char *names[count];
 count = 0;
 for(; compositeList; compositeList = compositeList->next)
     {
     labels[count] = compositeList->shortLabel;
     names[count] = compositeList->name;
     count++;
     }
 cgiMakeDropListFull("compositeList", labels, names, count,
                     currentComposite->name,
                     "change", 
                     "var e = document.getElementById('compositeList'); \
                     var strUser = e.options[e.selectedIndex].value; \
                     document.changeCompositeForm.elements['"hgsCurrentComposite"'].value = strUser; \
                     document.changeCompositeForm.submit();");
                     //document.addTrackForm.elements['hgComp_track'] = strUser;");
 
 }
 
 
 static void makeAddComposite()
 {
 printf("<BR>");
 printf("<BR>");
 printf("<H3>Make New Composite</H3>");
 printf("name ");
 cgiMakeTextVar(hgsNewCompositeName, "", 29);
-printf("short label ");
+printf("<BR>short label ");
 cgiMakeTextVar(hgsNewCompositeShortLabel, "", 29);
-printf("long label ");
+printf("<BR>long label ");
 cgiMakeTextVar(hgsNewCompositeLongLabel, "", 29);
+printf("<BR>");
 hOnClickButton("selVar_MakeNewComposite", 
                     "var e = document.getElementById('"hgsNewCompositeName"'); \
                     document.makeNewCompositeForm.elements['"hgsNewCompositeName"'].value = e.value; \
                     var e = document.getElementById('"hgsNewCompositeShortLabel"'); \
                     document.makeNewCompositeForm.elements['"hgsNewCompositeShortLabel"'].value = e.value; \
                     var e = document.getElementById('"hgsNewCompositeLongLabel"'); \
                     document.makeNewCompositeForm.elements['"hgsNewCompositeLongLabel"'].value = e.value; \
 document.makeNewCompositeForm.submit(); return false;", "submit");
 printf("<BR>");
 }
 
 static void printTrackList(struct composite *composite)
 {
 printf("<div class='sectionLiteHeader noReorderRemove'>"
        "Tracks in Composite</div>\n");
@@ -514,31 +516,31 @@
         printf("<TR><TD>%s</TD></TR>\n",track->shortLabel);
         }
 //printf("<TR><TD>track1</TD></TR>");
 //printf("<TR><TD>track2</TD></TR>");
 printf("</table>");
 }
 
 
 static boolean trackCanBeAdded(struct trackDb *tdb)
 {
 return  (tdb->subtracks == NULL) && !startsWith("wigMaf",tdb->type) &&  (startsWith("wig",tdb->type) || startsWith("bigWig",tdb->type)) ;
 }
 
 static void availableTracks(char *db, struct grp *groupList, struct trackDb *fullTrackList)
 {
-printf("<H4>Available tracks in %s</H4>", db);
+printf("<H4>Add tracks from %s</H4>", db);
 
 char *curGroupName = cartOptionalString(cart, hgsCurrentGroup);
 printf("<BR>groups: ");
 char **labels, **names;
 int count = slCount(groupList);
 AllocArray(labels, count);
 AllocArray(names, count);
 count = 0;
 struct grp *grp;
 for(grp = groupList; grp; grp = grp->next)
     {
     labels[count] = grp->label;
     names[count] = grp->name;
     count++;
     }
@@ -610,44 +612,46 @@
 void doMainPage(char *db, struct grp *groupList,  struct trackDb *fullTrackList, struct composite *currentComposite, struct composite *compositeList)
 /* Print out initial HTML of control page. */
 {
 //struct composite *currentComposite = compositeList;
 jsInit();
 webIncludeResourceFile("jquery-ui.css");
 webIncludeResourceFile("ui.dropdownchecklist.css");
 boolean alreadyAgreed = cartUsualBoolean(cart, "hgva_agreedToDisclaimer", FALSE);
 jsInlineF(
     "$(document).ready(function() { hgva.disclaimer.init(%s, hgva.userClickedAgree); });\n"
     , alreadyAgreed ? "true" : "false");
 addSomeCss();
 printAssemblySection();
 
 puts("<BR>");
+printf("<div class='sectionLiteHeader noReorderRemove'>"
+       "Add Hubs and Custom Tracks </div>\n");
 printCtAndHubButtons();
 
 //struct hashEl *hel = cartFindPrefix(cart, hgCompEditPrefix);
 //if (hel != NULL)
     {
  //   printf("printing EditCom\n");
   ///  printEditComposite();
     }
 
-printf("</FORMk");
+printf("</FORM>");
 puts("<BR>");
-makeAddComposite();
 puts("<BR>");
 printCompositeList(compositeList, currentComposite);
+makeAddComposite();
 puts("<BR>");
 printTrackList(currentComposite);
 puts("<BR>");
 availableTracks(db, groupList, fullTrackList);
 puts("<BR>");
 
 // Make wrapper table for collapsible sections:
 //selectVariants();
 //char *geneTrack = selectGenes();
 //if (geneTrack != NULL)
     {
     //selectRegulatory();
     //selectAnnotations(geneTrack);
     //selectFilters();
     //selectOutput();