Next / Previous / Contents / TCC Help System / NM Tech homepage

22.4. PriIndex.htmlMain: First line of the primary index entry
# - - -   P r i I n d e x . h t m l M a i n

    def htmlMain(self, parent):
        '''Add the first line of a primary entry.

          [ parent is an et.Element ->
              parent  +:=  main entry for self with a submit button
                  for ]

For the XHTML generated here, see Section 4.3.1, “Primary entry format”. See also Section 27, “latLonFormat(): Present the center coordinates in standard format” and Section 24, “yearBrackets(): Display a bracketed list of years worked”.

We start by adding a div to contain the whole entry. Each of these defines a page anchor (id value); for the logic that derives the name of the page anchor for a given circle center, see Section 52, “anchorName(): Format a page anchor”. We also work up the "ddmm-DDDMM" string, which is used in several places.
        #-- 1
        # [ parent  +:=  a div, with an id derived from's
        #       center
        #   div  :=  that div element
        #   key  :=  the lat-lon key for ]
        div = subElement(parent,
            E.div(CLASS_PRI_DIV, id=anchorName(
        key = latLonKey(

First into the div is a checkbox whose name is derived by Section 53, “latLonKey(): Generate the lat-lon key for a given circle”.
        #-- 2
        # [ div  +:=  a checkbox whose name is regform.LAT_LON
        #       and whose value is (key) ]
        div.append(E.input(type='checkbox', value=key,

Next comes the submit button to get the report for just one circle. On the button we place the circle name, with the coordinates as well because there are often multiple identical circle names with different coordinates.
        #-- 3
        # [ div  +:=  a submit button whose name is
        #       (regform.S_ + (key)) and whose legend is
        #       circle's name, region list, and coordinates ]
        submitName = "%s%s" % (regform.S_, key)
        legend = ("%s, %s %s" %
        div.append(E.input(type='submit', name=submitName,

        #-- 4
        # [ div  +:=  a new span of class CLASS_YEAR_LIST containing
        #       the year list for self.effortList ]
        div.append (