diff --git a/calexium_lib/web/CXM_making_a_web_site.anubis b/calexium_lib/web/CXM_making_a_web_site.anubis index e573756..f487f57 100644 --- a/calexium_lib/web/CXM_making_a_web_site.anubis +++ b/calexium_lib/web/CXM_making_a_web_site.anubis @@ -864,6 +864,10 @@ public type HTML_Row($T): public type HTML_Header_Row($T): empty, header_row(List(Cell_Option) options, List(HTML_Header_Cell($T)) cells). + +public type HTML_Footer_Row($T): + empty, + footer_row(List(Cell_Option) options, List(HTML_Cell($T)) cells). Same remark as for 'HTML_Cell($T)'. We define several convenience functions: @@ -974,7 +978,7 @@ public type HTML_In_Form: paragraph (List(Text_Option), HTML_In_Form content), image (String url), image (String url, Int32 width, Int32 height), - table (List(Table_Option), HTML_Header_Row(HTML_In_Form), List(HTML_Row(HTML_In_Form))), + table (List(Table_Option), HTML_Header_Row(HTML_In_Form), List(HTML_Row(HTML_In_Form)), HTML_Footer_Row(HTML_In_Form)), center (HTML_In_Form), mail_to (String email, HTML_In_Form element), scroller (Int32 width, Int32 height, @@ -1058,15 +1062,15 @@ public define HTML_In_Form ( List(HTML_Row(HTML_In_Form)) rows ) = - table([],empty,rows). + table([],empty,rows,empty). public define HTML_In_Form table ( - List(Table_Option) options, - List(HTML_Row(HTML_In_Form)) rows + List(Table_Option) options, + List(HTML_Row(HTML_In_Form)) rows ) = - table(options,empty,rows). + table(options,empty,rows,empty). public define HTML_In_Form table @@ -1074,7 +1078,16 @@ public define HTML_In_Form HTML_Header_Row(HTML_In_Form) h_row, List(HTML_Row(HTML_In_Form)) rows ) = - table([],h_row,rows). + table([],h_row,rows,empty). + +public define HTML_In_Form + table + ( + List(Table_Option) options, + HTML_Header_Row(HTML_In_Form) h_row, + List(HTML_Row(HTML_In_Form)) rows + ) = + table(options,h_row,rows,empty). public define HTML_In_Form private_download @@ -1133,7 +1146,7 @@ public type HTML_Off_Form: paragraph (List(Text_Option), HTML_Off_Form content), image (String url), image (String url, Int32 width, Int32 height), - table (List(Table_Option), HTML_Header_Row(HTML_Off_Form), List(HTML_Row(HTML_Off_Form))), + table (List(Table_Option), HTML_Header_Row(HTML_Off_Form), List(HTML_Row(HTML_Off_Form)), HTML_Footer_Row(HTML_Off_Form)), center (HTML_Off_Form), mail_to (String email, HTML_Off_Form element), scroller (Int32 width, Int32 height, @@ -1193,7 +1206,7 @@ public define HTML_Off_Form ( List(HTML_Row(HTML_Off_Form)) rows ) = - table([],empty,rows). + table([],empty,rows,empty). public define HTML_Off_Form table @@ -1201,15 +1214,24 @@ public define HTML_Off_Form List(Table_Option) options, List(HTML_Row(HTML_Off_Form)) rows ) = - table(options,empty,rows). + table(options,empty,rows,empty). + +public define HTML_Off_Form + table + ( + HTML_Header_Row(HTML_Off_Form) h_row, + List(HTML_Row(HTML_Off_Form)) rows + ) = + table([],h_row,rows,empty). public define HTML_Off_Form table ( + List(Table_Option) options, HTML_Header_Row(HTML_Off_Form) h_row, List(HTML_Row(HTML_Off_Form)) rows ) = - table([],h_row,rows). + table(options,h_row,rows,empty). We add two convenience functions for 'row'. The reason why we add two functions, one for 'HTML_In_Form' and one for 'HTML_Off_Form', is that adding a schema with an @@ -2364,7 +2386,7 @@ type HTML_Any($T): any_paragraph (List(Text_Option), $T content), any_image (String url), any_image (String url, Int32 width, Int32 height), - any_table (List(Table_Option), HTML_Header_Row($T), List(HTML_Row($T))), + any_table (List(Table_Option), HTML_Header_Row($T), List(HTML_Row($T)), HTML_Footer_Row($T)), any_center ($T), any_mail_to (String email, $T element), any_scroller (Int32 width, Int32 height, @@ -2687,7 +2709,7 @@ public define Printable_tree { [ ] then [ ], [h . t] then if h = selected.value - then ["\n" . format_choices(t)] + then ["\n" . format_choices(t)] else ["\n" . format_choices(t,selected)] }. @@ -3107,6 +3129,9 @@ define Printable_tree text, "" ], javascript(s,h) then + if action_name = "" then + [""] + else [s,""] } ], @@ -3350,7 +3375,7 @@ define Printable_tree [h . t] then if h is row(options,cells) then ["", format(cells,format_element), - "" + "\n" . format(t,format_element)] }. @@ -3366,7 +3391,23 @@ define Printable_tree header_row(options,cells) then [" ", format(cells,format_element), - " " + " \n" + ] + }. + +define Printable_tree + format + ( + HTML_Footer_Row($T) row, + $T -> Printable_tree format_element + ) = + if row is + { + empty then [ ], + footer_row(options,cells) then + [" ", + format(cells,format_element), + " \n" ] }. @@ -3572,10 +3613,12 @@ define Printable_tree ["\"",url,"\""], any_image(url,w,h) then ["\"",url,"\""], - any_table(opts,h_row, rows) then + any_table(opts,h_row, rows, f_row) then ["", - format(h_row,format_element), - "",format(rows,format_element),"
\n"], + format(h_row, format_element), + "",format(rows,format_element),"", + format(f_row, format_element), + "\n"], any_center(e) then ["
",format_element(e),"
"], any_mail_to(email,elem) then @@ -3652,8 +3695,8 @@ define Printable_tree format(cinfo,sn,ic_v,any_image(url),format_element,is_https), image(url,w,h) then format(cinfo,sn,ic_v,any_image(url,w,h),format_element,is_https), - table(opts,header_row,rows) then - format(cinfo,sn,ic_v,any_table(opts, header_row, rows),format_element,is_https), + table(opts,header_row,rows,footer_row) then + format(cinfo,sn,ic_v,any_table(opts, header_row, rows, footer_row),format_element,is_https), center(e) then format(cinfo,sn,ic_v,any_center(e),format_element,is_https), mail_to(a,e) then @@ -3740,6 +3783,18 @@ define Bool mapor(contains_an_upload, map(content,cells(row))). +define Bool + contains_an_upload + ( + HTML_Footer_Row(HTML_In_Form) row + ) = + if row is + { + empty then false, + footer_row(_, cells) then + mapor(contains_an_upload, + map(content,cells)) + }. define Bool contains_an_upload @@ -3756,7 +3811,8 @@ define Bool paragraph(o,t) then false, image(u) then false, image(u,w,h) then false, - table(o,_,rows) then mapor(contains_an_upload,rows), + table(o,_,rows,f_row) then if mapor(contains_an_upload,rows) then true + else contains_an_upload(f_row), center(e) then contains_an_upload(e), mail_to(m,e) then false, // 'e' may but should not contain an upload scroller(w,h,cw,ch,e) then contains_an_upload(e), @@ -3819,8 +3875,8 @@ define Printable_tree format(cinfo,sn,ic_v,any_image(url),format_element,is_https), image(url,w,h) then format(cinfo,sn,ic_v,any_image(url,w,h),format_element,is_https), - table(opts,header_row, rows) then - format(cinfo,sn,ic_v,any_table(opts,header_row, rows),format_element,is_https), + table(opts,header_row, rows, footer_row) then + format(cinfo,sn,ic_v,any_table(opts,header_row, rows, footer_row),format_element,is_https), center(e) then format(cinfo,sn,ic_v,any_center(e),format_element,is_https), mail_to(a,e) then -- libgit2 0.21.4