ผลต่างระหว่างรุ่นของ "Multi-component Page"

จาก คูนิฟ็อกซ์ วิกิ
บรรทัดที่ 40: บรรทัดที่ 40:
* '''doccount''' ''(bool)'': Whether the document counter elements should be rendered.
* '''doccount''' ''(bool)'': Whether the document counter elements should be rendered.
* '''docverify'''
* '''docverify'''
<div id="img001">[[File:Document page sample.png|720px|thumb|center|alt=Example of a Document Page|'''Example of a Document Page:''' (1) Document Counter, (2) Document Verification, (3)~(4) Page Button Sets]]</div>


=== More {{code|render_template}} Arguments ===
=== More {{code|render_template}} Arguments ===

รุ่นแก้ไขเมื่อ 10:27, 27 มิถุนายน 2567

While CuneiForms and CuneiTables on each of their own can create functional pages for several purposes, most accounting and transaction records require both to be displayed and manipulated in a meaningful manner. And while it is possible for such pages to be perfectly functional by stringing stad-alone forms and tables together, the numbers of requests and database accesses are unnecessarily high.

In the CuneiFox framework, inter-related forms and tables can be linked together via the use of Document Context. Below are the key functions of Document Context:

  • Control page-level permissions and operations.
  • Perform a document-lock/unlock upon entering entering/exiting the page's edit mode.
  • Consolidate populating request for all forms and tables on the page.
  • String together page edit sequence.

Define a Document Context

Document Context is a dict fed to the Flask render_template function. Most of the keys in the dict are handled (with default values assigned, if not given) by a separate Python function prep_mainseq. We shall begin with these so-called Main Sequence keys, then we will discuss a few additional keys.

Main Sequence Keys

  • page_perm
  • mainseq
  • mainseq_name
  • mainseq_add
  • mainseq_del
  • mainseq_modaldel
  • mainseq_proceed
  • mainseq_beacon
  • mainseq_search
  • mainseq_schprmpt
  • mainseq_copy
  • mainseq_attach
  • mainseq_print
  • mainseq_modalprint
  • mainseq_qr
  • mainseq_vouch
  • mainseq_upload
  • mainseq_export
  • proceed_lock_seq
  • searchers

Additional Document Context Keys

  • btn_set (bool): Whether the page button sets should be rendered.
  • doccount (bool): Whether the document counter elements should be rendered.
  • docverify
Example of a Document Page
Example of a Document Page: (1) Document Counter, (2) Document Verification, (3)~(4) Page Button Sets

More render_template Arguments

Arguments discussed under this final sub-section are not parts of the Document Context, and are to be fed directly to the render_template function. However, they are commonly utilized in tandem with Document Context, so it seems fit to list them here as well.

  • mass_populate
  • pin_args
  • back_route
  • perm_to_show

Fit the Context on an HTML Page

Page-level Permission & Document Locking

Useful Patterns