Welcome | Get started | Dive into Lino | Contribute | Reference

More about layouts

Tabbed detail layouts

tabbed detail layout

A detail layout that has a series of tabs.

A detail layout becomes tabbed when its main attribute has only one row of layout elements. The layout elements mentioned in the main attribute of a tabbed detail layout must have labels.

For example, the detail layout of a lino_xl.lib.sales.VatProductInvoice is a relatively simple tabbed detail layout:

../../_images/sales.Invoicedetail.png

Here is the source code used to define it:

class InvoiceDetail(dd.DetailLayout):
    main = "general more ledger"

    general = dd.Panel("""
    panel1:30 panel3:30 panel2 totals:20
    ItemsByInvoice
    """, label=_("General"))

    more = dd.Panel("""
    id user language #project #item_vat
    intro
    """, label=_("More"))

    ledger = dd.Panel("""
    journal accounting_period number #narration
    vat.MovementsByVoucher
    """, label=_("Ledger"))

    totals = dd.Panel("""
    total_base
    total_vat
    total_incl
    workflow_buttons
    """)

    panel1 = dd.Panel("""
    entry_date
    #order subject
    payment_term
    due_date:20
    """)

    panel2 = dd.Panel("""
    partner
    subject
    vat_regime
    your_ref match
    """)

    panel3 = dd.Panel("""
    payment_method
    paper_type
    printed
    """)

Combined list and detail view

When you add a navigator_panel to a detail layout, it can make sense to "skip the list window" by setting the default action of a table view to detail. Examples:

Or the detail layout of lino_xl.lib.contacts.Person in Lino Amici:

class PersonDetail(PersonDetail):

    main = "general #contact family more"

    general = dd.Panel("navigation_panel:20 general_box:60", label=_("General"))

    general_box = """
    overview contact_box #phones.ContactDetailsByPartner
    contacts.RolesByPerson:30 lists.MembersByPartner:30 cal.EntriesByGuest:30
    """

    contact_box = dd.Panel("""
    last_name first_name:15
    gender #title:10 language:10
    birth_date age:10 id:6
    """)  #, label=_("Contact"))

    family = dd.Panel("""
    humanlinks.LinksByHuman:50 households.MembersByPerson:30
    households.SiblingsByPerson
    """, label=_("Family"))

    more = dd.Panel("""
    ... comments.CommentsByRFC:30
    """, label=_("More"))

The tree navigator

The lino.utils.sequenced.Hierarchical.treeview_panel is used to add a tree navigation view.