Commit f8056686b3fe9956197ae65e3103333bfd85d739
1 parent
e9e9c522
replace div with only HTML_In_Form by a list of HTML_In_Form
add div with a list of CXM_Form_Field
Showing
1 changed file
with
30 additions
and
3 deletions
Show diff stats
web/CXM_form.anubis
| @@ -242,7 +242,8 @@ public type CXM_Form_Field: | @@ -242,7 +242,8 @@ public type CXM_Form_Field: | ||
| 242 | label_for ( String label, | 242 | label_for ( String label, |
| 243 | HTML_Id id, | 243 | HTML_Id id, |
| 244 | HTML_In_Form input), | 244 | HTML_In_Form input), |
| 245 | - div (List(CoreAttrs), HTML_In_Form content), | 245 | + div (List(CoreAttrs), List(HTML_In_Form) contents), |
| 246 | + div (List(CoreAttrs), List(CXM_Form_Field) fields), | ||
| 246 | partial (HTML_Partial_Content p_content), | 247 | partial (HTML_Partial_Content p_content), |
| 247 | br, | 248 | br, |
| 248 | hr (List(CoreAttrs) options), | 249 | hr (List(CoreAttrs) options), |
| @@ -410,6 +411,22 @@ public define CXM_Form_Field | @@ -410,6 +411,22 @@ public define CXM_Form_Field | ||
| 410 | hr([]) | 411 | hr([]) |
| 411 | . | 412 | . |
| 412 | 413 | ||
| 414 | +public define CXM_Form_Field | ||
| 415 | + div | ||
| 416 | + ( | ||
| 417 | + List(CoreAttrs) attrs, | ||
| 418 | + HTML_In_Form content | ||
| 419 | + )= | ||
| 420 | + div(attrs, [content]) | ||
| 421 | +. | ||
| 422 | + | ||
| 423 | +public define CXM_Form_Field | ||
| 424 | + div | ||
| 425 | + ( | ||
| 426 | + HTML_In_Form content | ||
| 427 | + )= | ||
| 428 | + div([], [content]) | ||
| 429 | +. | ||
| 413 | //--- explanation field --------------------- | 430 | //--- explanation field --------------------- |
| 414 | 431 | ||
| 415 | // ////////////////////////////////////////////////////////// | 432 | // ////////////////////////////////////////////////////////// |
| @@ -492,7 +509,7 @@ public define HTML_In_Form | @@ -492,7 +509,7 @@ public define HTML_In_Form | ||
| 492 | empty, | 509 | empty, |
| 493 | 510 | ||
| 494 | title(t) then | 511 | title(t) then |
| 495 | - literal("<h3>" + t + "</h3>"), | 512 | + literal("<h3>"+t+"</h3>"), |
| 496 | 513 | ||
| 497 | message(t) then | 514 | message(t) then |
| 498 | literal(t), | 515 | literal(t), |
| @@ -615,7 +632,7 @@ public define HTML_In_Form | @@ -615,7 +632,7 @@ public define HTML_In_Form | ||
| 615 | ]), | 632 | ]), |
| 616 | 633 | ||
| 617 | div(options, e) then div(options, e), | 634 | div(options, e) then div(options, e), |
| 618 | - | 635 | + div(options, fields)then div(options, format_div_CXM_Form_Field(fields, lwa, _class, b_with_label)), |
| 619 | partial(p_content) then partial(p_content), | 636 | partial(p_content) then partial(p_content), |
| 620 | br then br, | 637 | br then br, |
| 621 | hr(opts) then hr(opts), | 638 | hr(opts) then hr(opts), |
| @@ -878,6 +895,16 @@ public define HTML_Off_Form | @@ -878,6 +895,16 @@ public define HTML_Off_Form | ||
| 878 | public define HTML_Off_Form | 895 | public define HTML_Off_Form |
| 879 | cxm_form | 896 | cxm_form |
| 880 | ( | 897 | ( |
| 898 | + String form_id, | ||
| 899 | + List(CoreAttrs) options, | ||
| 900 | + List(HTML_In_Form) fields | ||
| 901 | + ) = | ||
| 902 | + cxm_form(html_Id(form_id), options, action_name(""), [], [], map((HTML_In_Form field) |-> raw_in_form(field), fields), "form_field aligned", true ) | ||
| 903 | +. | ||
| 904 | + | ||
| 905 | +public define HTML_Off_Form | ||
| 906 | + cxm_form | ||
| 907 | + ( | ||
| 881 | String form_id, | 908 | String form_id, |
| 882 | List(CoreAttrs) options, | 909 | List(CoreAttrs) options, |
| 883 | List(Web_arg) lwa, | 910 | List(Web_arg) lwa, |