'Prepare the gis_hierarchy form'

@staticmethod
def gis_hierarchy_form_setup():

    T = current.T
    table = current.db.gis_hierarchy
    table.L1.label = T('Hierarchy    Level    1    Name    (e.g.    State    or    Province)')
    table.L1.comment = DIV(_class='tooltip', _title=('%s|%s' % (T('Location    Hierarchy    Level    1    Name'), T('Term    for    the    primary    within-country    administrative    division    (e.g.    State    or    Province).'))))
    table.L2.label = T('Hierarchy    Level    2    Name    (e.g.    District    or    County)')
    table.L2.comment = DIV(_class='tooltip', _title=('%s|%s' % (T('Location    Hierarchy    Level    2    Name'), T('Term    for    the    secondary    within-country    administrative    division    (e.g.    District    or    County).'))))
    table.L3.label = T('Hierarchy    Level    3    Name    (e.g.    City    /    Town    /    Village)')
    table.L3.comment = DIV(_class='tooltip', _title=('%s|%s' % (T('Location    Hierarchy    Level    3    Name'), T('Term    for    the    third-level    within-country    administrative    division    (e.g.    City    or    Town).'))))
    table.L4.label = T('Hierarchy    Level    4    Name    (e.g.    Neighbourhood)')
    table.L4.comment = DIV(_class='tooltip', _title=('%s|%s' % (T('Location    Hierarchy    Level    4    Name'), T('Term    for    the    fourth-level    within-country    administrative    division    (e.g.    Village,    Neighborhood    or    Precinct).'))))
    table.L5.label = T('Hierarchy    Level    5    Name')
    table.L5.comment = DIV(_class='tooltip', _title=('%s|%s' % (T('Location    Hierarchy    Level    5    Name'), T('Term    for    the    fifth-level    within-country    administrative    division    (e.g.    a    voting    or    postcode    subdivision).    This    level    is    not    often    used.'))))
    table.strict_hierarchy.label = T('Is    this    a    strict    hierarchy?')
    table.strict_hierarchy.comment = DIV(_class='tooltip', _title=('%s|%s' % (T('Is    this    a    strict    hierarchy?'), T("Select    this    if    all    specific    locations    need    a    parent    at    the    deepest    level    of    the    location    hierarchy.    For    example,    if    'district'    is    the    smallest    division    in    the    hierarchy,    then    all    specific    locations    would    be    required    to    have    a    district    as    a    parent."))))
    table.location_parent_required.label = T('Must    a    location    have    a    parent    location?')
    table.location_parent_required.comment = DIV(_class='tooltip', _title=('%s|%s' % (T('Must    a    location    have    a    parent    location?'), T("Select    this    if    all    specific    locations    need    a    parent    location    in    the    location    hierarchy.    This    can    assist    in    setting    up    a    'region'    representing    an    affected    area."))))
    edit_Ln_tip_1 = T('Set    True    to    allow    editing    this    level    of    the    location    hierarchy    by    users    who    are    not    MapAdmins.')
    edit_Ln_tip_2 = T('This    is    appropriate    if    this    level    is    under    construction.    To    prevent    accidental    modification    after    this    level    is    complete,    this    can    be    set    to    False.')
    max_allowed_level_num = current.gis.max_allowed_level_num
    for n in range(1, max_allowed_level_num):
        field = ('edit_L%d' % n)
        table[field].label = (T('Edit    Level    %d    Locations?') % n)
        table[field].comment = DIV(_class='tooltip', _title=('%s|%s|%s' % ((T('Is    editing    level    L%d    locations    allowed?') % n), edit_Ln_tip_1, edit_Ln_tip_2)))
