This function builds the index pages by first letter of personal account name, the access reports for each personal accounts, and the links to those pages from the index page.
# - - - b u i l d P e r s o n a l S i d e
def buildPersonalSide ( cell, accessSummary ):
'''Add links to letter pages, and build letter and personal pages.
[ (cell is an et.Element) and
(accessSummary is an AccessSummary instance) ->
cell +:= links to letter-pages(accessSummary)
letter-pages(accessSummary) := letter-content(accessSummary)
personal-reports(accessSummary) :=
personal-content(accessSummary) ]
'''
This process is driven by the set of unique first letters
of user names. For each letter, we add a link from the
index page to the letter page, then build the letter page,
then build all the user report pages for that letter.
See Section 18, “buildLetter(): Build one letter
page and related personal pages”.
#-- 1 --
for letter in accessSummary.genPersonalLetters():
#-- 1 body --
# [ cell +:= link to a letter-page for (letter)
# letter-page for (letter) := letter-content for (letter) ]
# personal-reports for accounts in accessSummary that start
# with (letter) := personal-content for those accounts ]
#-- 1.1 --
# [ letterWebPath := WebPath for letter-page for (letter) ]
relPath = "%s%s%s" % ( LETTER_PREFIX, letter, HTML_EXT )
letterWebPath = OUT_WEB_PATH.relative ( relPath )
#-- 1.2 --
# [ cell +:= link to letterWebPath.url using link text
# (NMT_WEB_PATH + "~" + letter + "...") ]
linkText = "%s~%s..." % (NMT_WEB_PATH.url, letter)
cell.append (
E.div (
E.a ( linkText, href=letterWebPath.url ) ) )
#-- 1.3 --
# [ letter-page for (letter) from accessSummary :=
# letter-content for (letter)
# personal-reports for accounts in accessSummary that start
# with (letter) := personal-content for those accounts ]
buildLetter ( letter, letterWebPath, accessSummary )